Merge "Allow dragging outside TaskView on fallback recents" into sc-v2-dev am: 41655c3d4a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15179053

Change-Id: I9240ec3951ec42558d9189cc0cf7d37fa31ba1dd
This commit is contained in:
Alex Chau
2021-07-05 14:50:27 +00:00
committed by Automerger Merge Worker
2 changed files with 19 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.annotation.Nullable;
@@ -209,4 +210,11 @@ public class FallbackRecentsView extends RecentsView<RecentsActivity, RecentsSta
setDisallowScrollToClearAll(!state.hasClearAllButton());
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
boolean result = super.onTouchEvent(ev);
// Do not let touch escape to siblings below this view.
return result || mActivity.getStateManager().getState().overviewUi();
}
}

View File

@@ -40,15 +40,16 @@ public class RecentsState implements BaseState<RecentsState> {
private static final int FLAG_SHOW_AS_GRID = BaseState.getFlag(4);
private static final int FLAG_SCRIM = BaseState.getFlag(5);
private static final int FLAG_LIVE_TILE = BaseState.getFlag(6);
private static final int FLAG_OVERVIEW_UI = BaseState.getFlag(7);
public static final RecentsState DEFAULT = new RecentsState(0,
FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_SHOW_AS_GRID | FLAG_SCRIM
| FLAG_LIVE_TILE);
| FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
public static final RecentsState MODAL_TASK = new ModalState(1,
FLAG_DISABLE_RESTORE | FLAG_CLEAR_ALL_BUTTON | FLAG_OVERVIEW_ACTIONS | FLAG_MODAL
| FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE);
| FLAG_SHOW_AS_GRID | FLAG_SCRIM | FLAG_LIVE_TILE | FLAG_OVERVIEW_UI);
public static final RecentsState BACKGROUND_APP = new BackgroundAppState(2,
FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN);
FLAG_DISABLE_RESTORE | FLAG_NON_INTERACTIVE | FLAG_FULL_SCREEN | FLAG_OVERVIEW_UI);
public static final RecentsState HOME = new RecentsState(3, 0);
public static final RecentsState BG_LAUNCHER = new LauncherState(4, 0);
@@ -140,6 +141,13 @@ public class RecentsState implements BaseState<RecentsState> {
return deviceProfile.isTablet && FeatureFlags.ENABLE_OVERVIEW_GRID.get();
}
/**
* True if the state has overview panel visible.
*/
public boolean overviewUi() {
return hasFlag(FLAG_OVERVIEW_UI);
}
private static class ModalState extends RecentsState {
public ModalState(int id, int flags) {