use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class TaskStackView method onDraw.
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// Draw the freeform workspace background
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.hasFreeformWorkspaceSupport()) {
if (mFreeformWorkspaceBackground.getAlpha() > 0) {
mFreeformWorkspaceBackground.draw(canvas);
}
}
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class TaskStackViewTouchHandler method maybeHideRecentsFromBackgroundTap.
/** Hides recents if the up event at (x, y) is a tap on the background area. */
void maybeHideRecentsFromBackgroundTap(int x, int y) {
// Ignore the up event if it's too far from its start position. The user might have been
// trying to scroll or swipe.
int dx = Math.abs(mDownX - x);
int dy = Math.abs(mDownY - y);
if (dx > mScrollTouchSlop || dy > mScrollTouchSlop) {
return;
}
// Shift the tap position toward the center of the task stack and check to see if it would
// have hit a view. The user might have tried to tap on a task and missed slightly.
int shiftedX = x;
if (x > (mSv.getRight() - mSv.getLeft()) / 2) {
shiftedX -= mWindowTouchSlop;
} else {
shiftedX += mWindowTouchSlop;
}
if (findViewAtPoint(shiftedX, y) != null) {
return;
}
// Disallow tapping above and below the stack to dismiss recents
if (x > mSv.mLayoutAlgorithm.mStackRect.left && x < mSv.mLayoutAlgorithm.mStackRect.right) {
return;
}
// If tapping on the freeform workspace background, just launch the first freeform task
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.hasFreeformWorkspaceSupport()) {
Rect freeformRect = mSv.mLayoutAlgorithm.mFreeformRect;
if (freeformRect.top <= y && y <= freeformRect.bottom) {
if (mSv.launchFreeformTasks()) {
// TODO: Animate Recents away as we launch the freeform tasks
return;
}
}
}
// The user intentionally tapped on the background, which is like a tap on the "desktop".
// Hide recents and transition to the launcher.
EventBus.getDefault().send(new HideRecentsEvent(false, true));
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class TaskStackView method readSystemFlags.
/**
* Reads current system flags related to accessibility and screen pinning.
*/
private void readSystemFlags() {
SystemServicesProxy ssp = Recents.getSystemServices();
mTouchExplorationEnabled = ssp.isTouchExplorationEnabled();
mScreenPinningEnabled = ssp.getSystemSetting(getContext(), Settings.System.LOCK_TO_APP_ENABLED) != 0;
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class TaskStackView method onBusEvent.
public final void onBusEvent(DragStartInitializeDropTargetsEvent event) {
SystemServicesProxy ssp = Recents.getSystemServices();
if (ssp.hasFreeformWorkspaceSupport()) {
event.handler.registerDropTargetForCurrentDrag(mStackDropTarget);
event.handler.registerDropTargetForCurrentDrag(mFreeformWorkspaceDropTarget);
}
}
use of com.android.systemui.recents.misc.SystemServicesProxy in project android_frameworks_base by crdroidandroid.
the class DividerView method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mHandle = (DividerHandleView) findViewById(R.id.docked_divider_handle);
mBackground = findViewById(R.id.docked_divider_background);
mMinimizedShadow = (MinimizedDockShadow) findViewById(R.id.minimized_dock_shadow);
mHandle.setOnTouchListener(this);
mDividerWindowWidth = getResources().getDimensionPixelSize(com.android.internal.R.dimen.docked_stack_divider_thickness);
mDividerInsets = getResources().getDimensionPixelSize(com.android.internal.R.dimen.docked_stack_divider_insets);
mDividerSize = mDividerWindowWidth - 2 * mDividerInsets;
mTouchElevation = getResources().getDimensionPixelSize(R.dimen.docked_stack_divider_lift_elevation);
mLongPressEntraceAnimDuration = getResources().getInteger(R.integer.long_press_dock_anim_duration);
mGrowRecents = getResources().getBoolean(R.bool.recents_grow_in_multiwindow);
mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
mFlingAnimationUtils = new FlingAnimationUtils(getContext(), 0.3f);
updateDisplayInfo();
boolean landscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
mHandle.setPointerIcon(PointerIcon.getSystemIcon(getContext(), landscape ? TYPE_HORIZONTAL_DOUBLE_ARROW : TYPE_VERTICAL_DOUBLE_ARROW));
getViewTreeObserver().addOnComputeInternalInsetsListener(this);
mHandle.setAccessibilityDelegate(mHandleDelegate);
mGestureDetector = new GestureDetector(mContext, new SimpleOnGestureListener() {
@Override
public boolean onSingleTapUp(MotionEvent e) {
if (SWAPPING_ENABLED) {
updateDockSide();
SystemServicesProxy ssp = Recents.getSystemServices();
if (mDockSide != WindowManager.DOCKED_INVALID && !ssp.isRecentsActivityVisible()) {
mWindowManagerProxy.swapTasks();
return true;
}
}
return false;
}
});
}
Aggregations