Search in sources :

Example 1 with ShowIncompatibleAppOverlayEvent

use of com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent in project android_frameworks_base by DirtyUnicorns.

the class RecentsViewTouchHandler method onBusEvent.

/**** Events ****/
public final void onBusEvent(DragStartEvent event) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    mRv.getParent().requestDisallowInterceptTouchEvent(true);
    mDragRequested = true;
    // We defer starting the actual drag handling until the user moves past the drag slop
    mIsDragging = false;
    mDragTask = event.task;
    mTaskView = event.taskView;
    mDropTargets.clear();
    int[] recentsViewLocation = new int[2];
    mRv.getLocationInWindow(recentsViewLocation);
    mTaskViewOffset.set(mTaskView.getLeft() - recentsViewLocation[0] + event.tlOffset.x, mTaskView.getTop() - recentsViewLocation[1] + event.tlOffset.y);
    float x = mDownPos.x - mTaskViewOffset.x;
    float y = mDownPos.y - mTaskViewOffset.y;
    mTaskView.setTranslationX(x);
    mTaskView.setTranslationY(y);
    mVisibleDockStates.clear();
    if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask() && mDividerSnapAlgorithm.isSplitScreenFeasible()) {
        Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(), event.task.resizeMode);
        if (!event.task.isDockable) {
            EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
        } else {
            // Add the dock state drop targets (these take priority)
            TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
            for (TaskStack.DockState dockState : dockStates) {
                registerDropTargetForCurrentDrag(dockState);
                dockState.update(mRv.getContext());
                mVisibleDockStates.add(dockState);
            }
        }
    }
    // Request other drop targets to register themselves
    EventBus.getDefault().send(new DragStartInitializeDropTargetsEvent(event.task, event.taskView, this));
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) TaskStack(com.android.systemui.recents.model.TaskStack) DragStartInitializeDropTargetsEvent(com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent) ShowIncompatibleAppOverlayEvent(com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent)

Example 2 with ShowIncompatibleAppOverlayEvent

use of com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent in project platform_frameworks_base by android.

the class RecentsViewTouchHandler method onBusEvent.

/**** Events ****/
public final void onBusEvent(DragStartEvent event) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    mRv.getParent().requestDisallowInterceptTouchEvent(true);
    mDragRequested = true;
    // We defer starting the actual drag handling until the user moves past the drag slop
    mIsDragging = false;
    mDragTask = event.task;
    mTaskView = event.taskView;
    mDropTargets.clear();
    int[] recentsViewLocation = new int[2];
    mRv.getLocationInWindow(recentsViewLocation);
    mTaskViewOffset.set(mTaskView.getLeft() - recentsViewLocation[0] + event.tlOffset.x, mTaskView.getTop() - recentsViewLocation[1] + event.tlOffset.y);
    float x = mDownPos.x - mTaskViewOffset.x;
    float y = mDownPos.y - mTaskViewOffset.y;
    mTaskView.setTranslationX(x);
    mTaskView.setTranslationY(y);
    mVisibleDockStates.clear();
    if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask() && mDividerSnapAlgorithm.isSplitScreenFeasible()) {
        Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(), event.task.resizeMode);
        if (!event.task.isDockable) {
            EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
        } else {
            // Add the dock state drop targets (these take priority)
            TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
            for (TaskStack.DockState dockState : dockStates) {
                registerDropTargetForCurrentDrag(dockState);
                dockState.update(mRv.getContext());
                mVisibleDockStates.add(dockState);
            }
        }
    }
    // Request other drop targets to register themselves
    EventBus.getDefault().send(new DragStartInitializeDropTargetsEvent(event.task, event.taskView, this));
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) TaskStack(com.android.systemui.recents.model.TaskStack) DragStartInitializeDropTargetsEvent(com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent) ShowIncompatibleAppOverlayEvent(com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent)

Example 3 with ShowIncompatibleAppOverlayEvent

use of com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent in project android_frameworks_base by AOSPA.

the class RecentsViewTouchHandler method onBusEvent.

/**** Events ****/
public final void onBusEvent(DragStartEvent event) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    mRv.getParent().requestDisallowInterceptTouchEvent(true);
    mDragRequested = true;
    // We defer starting the actual drag handling until the user moves past the drag slop
    mIsDragging = false;
    mDragTask = event.task;
    mTaskView = event.taskView;
    mDropTargets.clear();
    int[] recentsViewLocation = new int[2];
    mRv.getLocationInWindow(recentsViewLocation);
    mTaskViewOffset.set(mTaskView.getLeft() - recentsViewLocation[0] + event.tlOffset.x, mTaskView.getTop() - recentsViewLocation[1] + event.tlOffset.y);
    float x = mDownPos.x - mTaskViewOffset.x;
    float y = mDownPos.y - mTaskViewOffset.y;
    mTaskView.setTranslationX(x);
    mTaskView.setTranslationY(y);
    mVisibleDockStates.clear();
    if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask() && mDividerSnapAlgorithm.isSplitScreenFeasible()) {
        Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(), event.task.resizeMode);
        if (!event.task.isDockable) {
            EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
        } else {
            // Add the dock state drop targets (these take priority)
            TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
            for (TaskStack.DockState dockState : dockStates) {
                registerDropTargetForCurrentDrag(dockState);
                dockState.update(mRv.getContext());
                mVisibleDockStates.add(dockState);
            }
        }
    }
    // Request other drop targets to register themselves
    EventBus.getDefault().send(new DragStartInitializeDropTargetsEvent(event.task, event.taskView, this));
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) TaskStack(com.android.systemui.recents.model.TaskStack) DragStartInitializeDropTargetsEvent(com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent) ShowIncompatibleAppOverlayEvent(com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent)

Example 4 with ShowIncompatibleAppOverlayEvent

use of com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent in project android_frameworks_base by ResurrectionRemix.

the class RecentsViewTouchHandler method onBusEvent.

/**** Events ****/
public final void onBusEvent(DragStartEvent event) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    mRv.getParent().requestDisallowInterceptTouchEvent(true);
    mDragRequested = true;
    // We defer starting the actual drag handling until the user moves past the drag slop
    mIsDragging = false;
    mDragTask = event.task;
    mTaskView = event.taskView;
    mDropTargets.clear();
    int[] recentsViewLocation = new int[2];
    mRv.getLocationInWindow(recentsViewLocation);
    mTaskViewOffset.set(mTaskView.getLeft() - recentsViewLocation[0] + event.tlOffset.x, mTaskView.getTop() - recentsViewLocation[1] + event.tlOffset.y);
    float x = mDownPos.x - mTaskViewOffset.x;
    float y = mDownPos.y - mTaskViewOffset.y;
    mTaskView.setTranslationX(x);
    mTaskView.setTranslationY(y);
    mVisibleDockStates.clear();
    if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask() && mDividerSnapAlgorithm.isSplitScreenFeasible()) {
        Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(), event.task.resizeMode);
        if (!event.task.isDockable) {
            EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
        } else {
            // Add the dock state drop targets (these take priority)
            TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
            for (TaskStack.DockState dockState : dockStates) {
                registerDropTargetForCurrentDrag(dockState);
                dockState.update(mRv.getContext());
                mVisibleDockStates.add(dockState);
            }
        }
    }
    // Request other drop targets to register themselves
    EventBus.getDefault().send(new DragStartInitializeDropTargetsEvent(event.task, event.taskView, this));
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) TaskStack(com.android.systemui.recents.model.TaskStack) DragStartInitializeDropTargetsEvent(com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent) ShowIncompatibleAppOverlayEvent(com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent)

Example 5 with ShowIncompatibleAppOverlayEvent

use of com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent in project android_frameworks_base by crdroidandroid.

the class RecentsViewTouchHandler method onBusEvent.

/**** Events ****/
public final void onBusEvent(DragStartEvent event) {
    SystemServicesProxy ssp = Recents.getSystemServices();
    mRv.getParent().requestDisallowInterceptTouchEvent(true);
    mDragRequested = true;
    // We defer starting the actual drag handling until the user moves past the drag slop
    mIsDragging = false;
    mDragTask = event.task;
    mTaskView = event.taskView;
    mDropTargets.clear();
    int[] recentsViewLocation = new int[2];
    mRv.getLocationInWindow(recentsViewLocation);
    mTaskViewOffset.set(mTaskView.getLeft() - recentsViewLocation[0] + event.tlOffset.x, mTaskView.getTop() - recentsViewLocation[1] + event.tlOffset.y);
    float x = mDownPos.x - mTaskViewOffset.x;
    float y = mDownPos.y - mTaskViewOffset.y;
    mTaskView.setTranslationX(x);
    mTaskView.setTranslationY(y);
    mVisibleDockStates.clear();
    if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask() && mDividerSnapAlgorithm.isSplitScreenFeasible()) {
        Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(), event.task.resizeMode);
        if (!event.task.isDockable) {
            EventBus.getDefault().send(new ShowIncompatibleAppOverlayEvent());
        } else {
            // Add the dock state drop targets (these take priority)
            TaskStack.DockState[] dockStates = getDockStatesForCurrentOrientation();
            for (TaskStack.DockState dockState : dockStates) {
                registerDropTargetForCurrentDrag(dockState);
                dockState.update(mRv.getContext());
                mVisibleDockStates.add(dockState);
            }
        }
    }
    // Request other drop targets to register themselves
    EventBus.getDefault().send(new DragStartInitializeDropTargetsEvent(event.task, event.taskView, this));
}
Also used : SystemServicesProxy(com.android.systemui.recents.misc.SystemServicesProxy) TaskStack(com.android.systemui.recents.model.TaskStack) DragStartInitializeDropTargetsEvent(com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent) ShowIncompatibleAppOverlayEvent(com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent)

Aggregations

ShowIncompatibleAppOverlayEvent (com.android.systemui.recents.events.ui.ShowIncompatibleAppOverlayEvent)5 DragStartInitializeDropTargetsEvent (com.android.systemui.recents.events.ui.dragndrop.DragStartInitializeDropTargetsEvent)5 SystemServicesProxy (com.android.systemui.recents.misc.SystemServicesProxy)5 TaskStack (com.android.systemui.recents.model.TaskStack)5