Merge "Do not switch to screenshot and finish recents animation for menu options that already do so" into sc-dev am: e54f789de9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15176734 Change-Id: I6e980151382b7ce10fb4d206d86295a41e938b8f
This commit is contained in:
@@ -88,6 +88,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
|||||||
SystemShortcut screenshotShortcut = TaskShortcutFactory.SCREENSHOT
|
SystemShortcut screenshotShortcut = TaskShortcutFactory.SCREENSHOT
|
||||||
.getShortcut(activity, taskView);
|
.getShortcut(activity, taskView);
|
||||||
if (screenshotShortcut != null) {
|
if (screenshotShortcut != null) {
|
||||||
|
screenshotShortcut.setHasFinishRecentsInAction(true);
|
||||||
shortcuts.add(screenshotShortcut);
|
shortcuts.add(screenshotShortcut);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
|||||||
SystemShortcut modalShortcut = TaskShortcutFactory.MODAL
|
SystemShortcut modalShortcut = TaskShortcutFactory.MODAL
|
||||||
.getShortcut(activity, taskView);
|
.getShortcut(activity, taskView);
|
||||||
if (modalShortcut != null) {
|
if (modalShortcut != null) {
|
||||||
|
modalShortcut.setHasFinishRecentsInAction(true);
|
||||||
shortcuts.add(modalShortcut);
|
shortcuts.add(modalShortcut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ public class TaskMenuView extends AbstractFloatingView implements OnScrollChange
|
|||||||
menuOptionView.setEnabled(menuOption.isEnabled());
|
menuOptionView.setEnabled(menuOption.isEnabled());
|
||||||
menuOptionView.setAlpha(menuOption.isEnabled() ? 1 : 0.5f);
|
menuOptionView.setAlpha(menuOption.isEnabled() ? 1 : 0.5f);
|
||||||
menuOptionView.setOnClickListener(view -> {
|
menuOptionView.setOnClickListener(view -> {
|
||||||
if (LIVE_TILE.get()) {
|
if (LIVE_TILE.get() && !menuOption.hasFinishRecentsInAction()) {
|
||||||
RecentsView recentsView = mTaskView.getRecentsView();
|
RecentsView recentsView = mTaskView.getRecentsView();
|
||||||
recentsView.switchToScreenshot(null,
|
recentsView.switchToScreenshot(null,
|
||||||
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
|
|||||||
*/
|
*/
|
||||||
private boolean isEnabled = true;
|
private boolean isEnabled = true;
|
||||||
|
|
||||||
|
private boolean mHasFinishRecentsInAction = false;
|
||||||
|
|
||||||
public SystemShortcut(int iconResId, int labelResId, T target, ItemInfo itemInfo) {
|
public SystemShortcut(int iconResId, int labelResId, T target, ItemInfo itemInfo) {
|
||||||
mIconResId = iconResId;
|
mIconResId = iconResId;
|
||||||
mLabelResId = labelResId;
|
mLabelResId = labelResId;
|
||||||
@@ -100,6 +102,14 @@ public abstract class SystemShortcut<T extends BaseDraggingActivity> extends Ite
|
|||||||
return mAccessibilityActionId == action;
|
return mAccessibilityActionId == action;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHasFinishRecentsInAction(boolean hasFinishRecentsInAction) {
|
||||||
|
mHasFinishRecentsInAction = hasFinishRecentsInAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasFinishRecentsInAction() {
|
||||||
|
return mHasFinishRecentsInAction;
|
||||||
|
}
|
||||||
|
|
||||||
public interface Factory<T extends BaseDraggingActivity> {
|
public interface Factory<T extends BaseDraggingActivity> {
|
||||||
|
|
||||||
@Nullable SystemShortcut<T> getShortcut(T activity, ItemInfo itemInfo);
|
@Nullable SystemShortcut<T> getShortcut(T activity, ItemInfo itemInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user