Fix Task Icon menu behavior.
Tapping task icon will now show the scrim for rest of thumbnail and not snap to page that is already snapped to. Pressing task icon from clear all will scroll to the page. Bug: 158004853 Change-Id: I79d0a4ac5be3641c6bdf71c34dcbf136ddbbebd1
This commit is contained in:
@@ -607,6 +607,10 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCenterPageTask() {
|
||||
return getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPageBeginTransition() {
|
||||
super.onPageBeginTransition();
|
||||
@@ -616,7 +620,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
@Override
|
||||
protected void onPageEndTransition() {
|
||||
super.onPageEndTransition();
|
||||
if (getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen())) {
|
||||
if (isCenterPageTask()) {
|
||||
LayoutUtils.setViewEnabled(mActionsView, true);
|
||||
}
|
||||
if (getNextPage() > 0) {
|
||||
|
||||
@@ -425,13 +425,16 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
}
|
||||
|
||||
private boolean showTaskMenu(int action) {
|
||||
getRecentsView().snapToPage(getRecentsView().indexOfChild(this));
|
||||
mMenuView = TaskMenuView.showForTask(this);
|
||||
mActivity.getStatsLogManager().log(LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS, buildProto());
|
||||
UserEventDispatcher.newInstance(getContext()).logActionOnItem(action, Direction.NONE,
|
||||
LauncherLogProto.ItemType.TASK_ICON);
|
||||
if (mMenuView != null) {
|
||||
mMenuView.addOnAttachStateChangeListener(mTaskMenuStateListener);
|
||||
if (!getRecentsView().isCenterPageTask()) {
|
||||
getRecentsView().snapToPage(getRecentsView().indexOfChild(this));
|
||||
} else {
|
||||
mMenuView = TaskMenuView.showForTask(this);
|
||||
mActivity.getStatsLogManager().log(LAUNCHER_TASK_ICON_TAP_OR_LONGPRESS, buildProto());
|
||||
UserEventDispatcher.newInstance(getContext()).logActionOnItem(action, Direction.NONE,
|
||||
LauncherLogProto.ItemType.TASK_ICON);
|
||||
if (mMenuView != null) {
|
||||
mMenuView.addOnAttachStateChangeListener(mTaskMenuStateListener);
|
||||
}
|
||||
}
|
||||
return mMenuView != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user