Search in sources :

Example 1 with LockTaskStateChangedEvent

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

the class TaskViewHeader method onClick.

@Override
public void onClick(View v) {
    if (v == mIconView) {
        // In accessibility, a single click on the focused app info button will show it
        EventBus.getDefault().send(new ShowApplicationInfoEvent(mTask));
    } else if (v == mDismissButton) {
        TaskView tv = Utilities.findParent(this, TaskView.class);
        tv.dismissTask();
        // Keep track of deletions by the dismiss button
        MetricsLogger.histogram(getContext(), "overview_task_dismissed_source", Constants.Metrics.DismissSourceHeaderButton);
    } else if (v == mPinButton) {
        TaskView tv = Utilities.findParent(this, TaskView.class);
        tv.screenPinning();
    } else if (v == mMoveTaskButton) {
        TaskView tv = Utilities.findParent(this, TaskView.class);
        EventBus.getDefault().send(new LaunchTaskEvent(tv, mTask, null, mMoveTaskTargetStackId, false));
    } else if (v == mAppInfoView) {
        EventBus.getDefault().send(new ShowApplicationInfoEvent(mTask));
    } else if (v == mAppIconView) {
        hideAppOverlay(false);
    } else if (v == mLockTaskButton) {
        if (mTask.isLockedTask) {
            mLockTaskHelper.removeTask(mTask.packageName);
        } else {
            mLockTaskHelper.addTask(mTask.packageName);
        }
        mTask.isLockedTask = !mTask.isLockedTask;
        updateLockTaskDrawable();
        EventBus.getDefault().send(new LockTaskStateChangedEvent(true));
    }
}
Also used : LockTaskStateChangedEvent(com.android.systemui.recents.events.ui.LockTaskStateChangedEvent) LaunchTaskEvent(com.android.systemui.recents.events.activity.LaunchTaskEvent) ShowApplicationInfoEvent(com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)

Example 2 with LockTaskStateChangedEvent

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

the class TaskStackView method onBusEvent.

public final void onBusEvent(TaskViewDismissedEvent event) {
    // Announce for accessibility
    announceForAccessibility(getContext().getString(R.string.accessibility_recents_item_dismissed, event.task.title));
    if (useGridLayout() && event.animation != null) {
        event.animation.setListener(new AnimatorListenerAdapter() {

            public void onAnimationEnd(Animator animator) {
                if (mTaskViewFocusFrame != null) {
                    // Resize the grid layout task view focus frame
                    mTaskViewFocusFrame.resize();
                }
            }
        });
    }
    // Remove the task from the stack
    mStack.removeTask(event.task, event.animation, false);
    EventBus.getDefault().send(new LockTaskStateChangedEvent(true));
    EventBus.getDefault().send(new DeleteTaskDataEvent(event.task));
    MetricsLogger.action(getContext(), MetricsEvent.OVERVIEW_DISMISS, event.task.key.getComponent().toString());
}
Also used : LockTaskStateChangedEvent(com.android.systemui.recents.events.ui.LockTaskStateChangedEvent) Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) ValueAnimator(android.animation.ValueAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) DeleteTaskDataEvent(com.android.systemui.recents.events.ui.DeleteTaskDataEvent)

Aggregations

LockTaskStateChangedEvent (com.android.systemui.recents.events.ui.LockTaskStateChangedEvent)2 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 ObjectAnimator (android.animation.ObjectAnimator)1 ValueAnimator (android.animation.ValueAnimator)1 LaunchTaskEvent (com.android.systemui.recents.events.activity.LaunchTaskEvent)1 DeleteTaskDataEvent (com.android.systemui.recents.events.ui.DeleteTaskDataEvent)1 ShowApplicationInfoEvent (com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)1