Search in sources :

Example 1 with ShowApplicationInfoEvent

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

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 == mMoveTaskButton) {
        TaskView tv = Utilities.findParent(this, TaskView.class);
        Rect bounds = mMoveTaskTargetStackId == FREEFORM_WORKSPACE_STACK_ID ? new Rect(mTaskViewRect) : new Rect();
        EventBus.getDefault().send(new LaunchTaskEvent(tv, mTask, bounds, mMoveTaskTargetStackId, false));
    } else if (v == mAppInfoView) {
        EventBus.getDefault().send(new ShowApplicationInfoEvent(mTask));
    } else if (v == mAppIconView) {
        hideAppOverlay(false);
    }
}
Also used : Rect(android.graphics.Rect) LaunchTaskEvent(com.android.systemui.recents.events.activity.LaunchTaskEvent) ShowApplicationInfoEvent(com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)

Example 2 with ShowApplicationInfoEvent

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

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);
        if (!Recents.sLockedTasks.contains(tv.getTask())) {
            tv.dismissTask();
            // Keep track of deletions by the dismiss button
            MetricsLogger.histogram(getContext(), "overview_task_dismissed_source", Constants.Metrics.DismissSourceHeaderButton);
        }
    } 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 (Recents.sLockedTasks.contains(mTask)) {
            Recents.sLockedTasks.remove(mTask);
        } else {
            Recents.sLockedTasks.add(mTask);
        }
        updateLockTaskDrawable();
    }
}
Also used : LaunchTaskEvent(com.android.systemui.recents.events.activity.LaunchTaskEvent) ShowApplicationInfoEvent(com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)

Example 3 with ShowApplicationInfoEvent

use of com.android.systemui.recents.events.ui.ShowApplicationInfoEvent 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 4 with ShowApplicationInfoEvent

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

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);
        if (!Recents.sLockedTasks.contains(tv.getTask())) {
            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 (Recents.sLockedTasks.contains(mTask)) {
            Recents.sLockedTasks.remove(mTask);
        } else {
            Recents.sLockedTasks.add(mTask);
        }
        updateLockTaskDrawable();
    }
}
Also used : LaunchTaskEvent(com.android.systemui.recents.events.activity.LaunchTaskEvent) ShowApplicationInfoEvent(com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)

Example 5 with ShowApplicationInfoEvent

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

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);
        if (!Recents.sLockedTasks.contains(tv.getTask())) {
            tv.dismissTask();
            // Keep track of deletions by the dismiss button
            MetricsLogger.histogram(getContext(), "overview_task_dismissed_source", Constants.Metrics.DismissSourceHeaderButton);
        }
    } 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 (Recents.sLockedTasks.contains(mTask)) {
            Recents.sLockedTasks.remove(mTask);
        } else {
            Recents.sLockedTasks.add(mTask);
        }
        updateLockTaskDrawable();
    }
}
Also used : LaunchTaskEvent(com.android.systemui.recents.events.activity.LaunchTaskEvent) ShowApplicationInfoEvent(com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)

Aggregations

LaunchTaskEvent (com.android.systemui.recents.events.activity.LaunchTaskEvent)5 ShowApplicationInfoEvent (com.android.systemui.recents.events.ui.ShowApplicationInfoEvent)5 Rect (android.graphics.Rect)1 LockTaskStateChangedEvent (com.android.systemui.recents.events.ui.LockTaskStateChangedEvent)1