Merge "Set exclusion rect for launcher before it gains focus" into ub-launcher3-master

This commit is contained in:
Vinit Nayak authored and Android (Google) Code Review committed 2019-10-01 15:54:05 +00:00
commit a62de7aa88
2 files changed
+18 -2

No files matched your search

@@ -109,6 +109,14 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
// Ensure recents is at the correct position for NORMAL state. For example, when we detach
// recents, we assume the first task is invisible, making translation off by one task.
activity.getStateManager().reapplyState();
setLauncherHideBackArrow(false);
}
private void setLauncherHideBackArrow(boolean hideBackArrow) {
Launcher launcher = getCreatedActivity();
if (launcher != null) {
launcher.getRootView().setForceHideBackArrow(hideBackArrow);
}
}
@Override
@@ -139,7 +147,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe
? FloatingIconView.getFloatingIconView(activity, workspaceView,
true /* hideOriginal */, iconLocation, false /* isOpening */)
: null;
setLauncherHideBackArrow(true);
return new HomeAnimationFactory() {
@Nullable
@Override
@@ -39,6 +39,8 @@ public class LauncherRootView extends InsettableFrameLayout {
private WindowStateListener mWindowStateListener;
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mDisallowBackGesture;
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mForceHideBackArrow;
public LauncherRootView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -175,13 +177,19 @@ public class LauncherRootView extends InsettableFrameLayout {
setDisallowBackGesture(mDisallowBackGesture);
}
@TargetApi(Build.VERSION_CODES.Q)
public void setForceHideBackArrow(boolean forceHideBackArrow) {
this.mForceHideBackArrow = forceHideBackArrow;
setDisallowBackGesture(mDisallowBackGesture);
}
@TargetApi(Build.VERSION_CODES.Q)
public void setDisallowBackGesture(boolean disallowBackGesture) {
if (!Utilities.ATLEAST_Q) {
return;
}
mDisallowBackGesture = disallowBackGesture;
setSystemGestureExclusionRects(mDisallowBackGesture
setSystemGestureExclusionRects((mForceHideBackArrow || mDisallowBackGesture)
? SYSTEM_GESTURE_EXCLUSION_RECT
: Collections.emptyList());
}