Revert "Fix Task Icon menu behavior."

This reverts commit 6df0148b07.

Reason for revert: breaks the task icon behavior.

Change-Id: I6f654478e0ffe7827efeca1553622dad2e02c5da
This commit is contained in:
Becky Qiu 2020-06-09 23:42:19 +00:00
parent 8984fea211
commit 23986e9a84
2 changed files with 8 additions and 15 deletions

View File

@ -607,10 +607,6 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
}
}
public boolean isCenterPageTask() {
return getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen());
}
@Override
protected void onPageBeginTransition() {
super.onPageBeginTransition();
@ -620,7 +616,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
@Override
protected void onPageEndTransition() {
super.onPageEndTransition();
if (isCenterPageTask()) {
if (getScrollX() == getScrollForPage(getPageNearestToCenterOfScreen())) {
LayoutUtils.setViewEnabled(mActionsView, true);
}
if (getNextPage() > 0) {

View File

@ -425,16 +425,13 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
}
private boolean showTaskMenu(int action) {
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);
}
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);
}
return mMenuView != null;
}