Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e54f789d authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Do not switch to screenshot and finish recents animation for menu...

Merge "Do not switch to screenshot and finish recents animation for menu options that already do so" into sc-dev
parents 3334c321 99adef95
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
            SystemShortcut screenshotShortcut = TaskShortcutFactory.SCREENSHOT
                    .getShortcut(activity, taskView);
            if (screenshotShortcut != null) {
                screenshotShortcut.setHasFinishRecentsInAction(true);
                shortcuts.add(screenshotShortcut);
            }

@@ -96,6 +97,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
                SystemShortcut modalShortcut = TaskShortcutFactory.MODAL
                        .getShortcut(activity, taskView);
                if (modalShortcut != null) {
                    modalShortcut.setHasFinishRecentsInAction(true);
                    shortcuts.add(modalShortcut);
                }
            }
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ public class TaskMenuView extends AbstractFloatingView implements OnScrollChange
        menuOptionView.setEnabled(menuOption.isEnabled());
        menuOptionView.setAlpha(menuOption.isEnabled() ? 1 : 0.5f);
        menuOptionView.setOnClickListener(view -> {
            if (LIVE_TILE.get()) {
            if (LIVE_TILE.get() && !menuOption.hasFinishRecentsInAction()) {
                RecentsView recentsView = mTaskView.getRecentsView();
                recentsView.switchToScreenshot(null,
                        () -> recentsView.finishRecentsAnimation(true /* toRecents */,
+10 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
     */
    private boolean isEnabled = true;

    private boolean mHasFinishRecentsInAction = false;

    public SystemShortcut(int iconResId, int labelResId, T target, ItemInfo itemInfo) {
        mIconResId = iconResId;
        mLabelResId = labelResId;
@@ -100,6 +102,14 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
        return mAccessibilityActionId == action;
    }

    public void setHasFinishRecentsInAction(boolean hasFinishRecentsInAction) {
        mHasFinishRecentsInAction = hasFinishRecentsInAction;
    }

    public boolean hasFinishRecentsInAction() {
        return mHasFinishRecentsInAction;
    }

    public interface Factory<T extends BaseDraggingActivity> {

        @Nullable SystemShortcut<T> getShortcut(T activity, ItemInfo itemInfo);