Merge "[Overview Actions] onBackPressed for the modal state will go to overview." into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
48f600c51d
+12
@@ -20,6 +20,7 @@ import android.graphics.Rect;
|
||||
|
||||
import com.android.launcher3.BaseDraggingActivity;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
|
||||
import com.android.quickstep.views.RecentsView;
|
||||
|
||||
@@ -56,6 +57,17 @@ public class OverviewModalTaskState extends OverviewState {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed(Launcher launcher) {
|
||||
launcher.getStateManager().goToState(LauncherState.OVERVIEW);
|
||||
RecentsView recentsView = launcher.<RecentsView>getOverviewPanel();
|
||||
if (recentsView != null) {
|
||||
recentsView.resetModalVisuals();
|
||||
} else {
|
||||
super.onBackPressed(launcher);
|
||||
}
|
||||
}
|
||||
|
||||
public static float[] getOverviewScaleAndOffsetForModalState(BaseDraggingActivity activity) {
|
||||
Rect out = new Rect();
|
||||
activity.<RecentsView>getOverviewPanel().getTaskSize(out);
|
||||
|
||||
@@ -178,6 +178,12 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
|
||||
public void reset() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the system wants to reset the modal visuals.
|
||||
*/
|
||||
public void resetModalVisuals() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the modal state system shortcut.
|
||||
*/
|
||||
|
||||
@@ -1760,6 +1760,16 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
|
||||
return Math.max(getWidth(), 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the visuals when exit modal state.
|
||||
*/
|
||||
public void resetModalVisuals() {
|
||||
TaskView taskView = getCurrentPageTaskView();
|
||||
if (taskView != null) {
|
||||
taskView.getThumbnail().getTaskOverlay().resetModalVisuals();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateDeadZoneRects() {
|
||||
// Get the deadzone rect surrounding the clear all button to not dismiss overview to home
|
||||
mClearAllButtonDeadZoneRect.setEmpty();
|
||||
|
||||
Reference in New Issue
Block a user