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,9 +425,7 @@ 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,
@ -435,7 +433,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
if (mMenuView != null) {
mMenuView.addOnAttachStateChangeListener(mTaskMenuStateListener);
}
}
return mMenuView != null;
}