Search in sources :

Example 96 with SystemServicesProxy

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);
        }
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy)

Example 97 with SystemServicesProxy

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));
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) Rect(android.graphics.Rect) HideRecentsEvent(com.android.systemui.recents.events.activity.HideRecentsEvent)

Example 98 with SystemServicesProxy

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;
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy)

Example 99 with SystemServicesProxy

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);
    }
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy)

Example 100 with SystemServicesProxy

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;
        }
    });
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) FlingAnimationUtils(com.android.systemui.statusbar.FlingAnimationUtils) SimpleOnGestureListener(android.view.GestureDetector.SimpleOnGestureListener) GestureDetector(android.view.GestureDetector) MotionEvent(android.view.MotionEvent)

Aggregations

SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)243 Rect (android.graphics.Rect)45 ActivityManager (android.app.ActivityManager)35 ActivityInfo (android.content.pm.ActivityInfo)34 RecentsTaskLoader (com.android.systemui.recents.model.RecentsTaskLoader)30 TaskStack (com.android.systemui.recents.model.TaskStack)30 Task (com.android.systemui.recents.model.Task)25 Drawable (android.graphics.drawable.Drawable)19 Point (android.graphics.Point)16 ActivityOptions (android.app.ActivityOptions)15 ComponentName (android.content.ComponentName)15 RemoteException (android.os.RemoteException)15 MutableBoolean (android.util.MutableBoolean)15 RecentsActivityLaunchState (com.android.systemui.recents.RecentsActivityLaunchState)15 RecentsConfiguration (com.android.systemui.recents.RecentsConfiguration)15 Bitmap (android.graphics.Bitmap)14 ArrayList (java.util.ArrayList)14 BitmapDrawable (android.graphics.drawable.BitmapDrawable)12 ActivityNotFoundException (android.content.ActivityNotFoundException)10 Intent (android.content.Intent)10