Merge "[Live Tile] Switch to screenshot when any task menu option is selected" into ub-launcher3-master
This commit is contained in:
commit
32b9f3dc40
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package com.android.quickstep.views;
|
package com.android.quickstep.views;
|
||||||
|
|
||||||
|
import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE;
|
||||||
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA;
|
import static com.android.quickstep.views.TaskThumbnailView.DIM_ALPHA;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
|
@ -229,7 +230,16 @@ public class TaskMenuView extends AbstractFloatingView {
|
||||||
menuOptionView.findViewById(R.id.icon), menuOptionView.findViewById(R.id.text));
|
menuOptionView.findViewById(R.id.icon), menuOptionView.findViewById(R.id.text));
|
||||||
LayoutParams lp = (LayoutParams) menuOptionView.getLayoutParams();
|
LayoutParams lp = (LayoutParams) menuOptionView.getLayoutParams();
|
||||||
mTaskView.getPagedOrientationHandler().setLayoutParamsForTaskMenuOptionItem(lp);
|
mTaskView.getPagedOrientationHandler().setLayoutParamsForTaskMenuOptionItem(lp);
|
||||||
menuOptionView.setOnClickListener(menuOption);
|
menuOptionView.setOnClickListener(view -> {
|
||||||
|
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
||||||
|
RecentsView recentsView = mTaskView.getRecentsView();
|
||||||
|
recentsView.switchToScreenshot(null,
|
||||||
|
() -> recentsView.finishRecentsAnimation(true /* toRecents */,
|
||||||
|
() -> menuOption.onClick(view)));
|
||||||
|
} else {
|
||||||
|
menuOption.onClick(view);
|
||||||
|
}
|
||||||
|
});
|
||||||
mOptionLayout.addView(menuOptionView);
|
mOptionLayout.addView(menuOptionView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue