summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony <twickham@google.com>2018-03-06 23:50:03 +0000
committerTony <twickham@google.com>2018-03-07 12:21:10 +0000
commit865ee02d20c9bbdf4f37ea0bd035a7aa65196f66 (patch)
tree5e826915f27c071784771b37a25f9a1557f08434
parent5589583dcf9689400c2e4a7348bc1d9facac8af7 (diff)
downloadpackages_apps_Trebuchet-865ee02d20c9bbdf4f37ea0bd035a7aa65196f66.tar.gz
packages_apps_Trebuchet-865ee02d20c9bbdf4f37ea0bd035a7aa65196f66.tar.bz2
packages_apps_Trebuchet-865ee02d20c9bbdf4f37ea0bd035a7aa65196f66.zip
Show back button when a floating view is visible
Bug: 74184060 Bug: 74243869 Change-Id: I3b1806e10d3f910ce3a8a980c2b1e0609e01582b
-rw-r--r--quickstep/src/com/android/launcher3/uioverrides/UiFactory.java20
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java2
2 files changed, 20 insertions, 2 deletions
diff --git a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
index 352cd9c95..a8bcb11ff 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/UiFactory.java
@@ -19,11 +19,14 @@ package com.android.launcher3.uioverrides;
import static com.android.launcher3.LauncherState.NORMAL;
import android.graphics.PointF;
+import android.view.View;
import android.view.View.AccessibilityDelegate;
+import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherStateManager.StateHandler;
import com.android.launcher3.config.FeatureFlags;
+import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.util.TouchController;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.RecentsModel;
@@ -62,8 +65,21 @@ public class UiFactory {
}
public static void onLauncherStateOrFocusChanged(Launcher launcher) {
- OverviewInteractionState.setBackButtonVisible(launcher, launcher == null
- || !launcher.isInState(NORMAL) || !launcher.hasWindowFocus());
+ boolean shouldBackButtonBeVisible = launcher == null
+ || !launcher.isInState(NORMAL)
+ || !launcher.hasWindowFocus();
+ if (!shouldBackButtonBeVisible) {
+ // Show the back button if there is a floating view visible.
+ DragLayer dragLayer = launcher.getDragLayer();
+ for (int i = dragLayer.getChildCount() - 1; i >= 0; i--) {
+ View child = dragLayer.getChildAt(i);
+ if (child instanceof AbstractFloatingView) {
+ shouldBackButtonBeVisible = true;
+ break;
+ }
+ }
+ }
+ OverviewInteractionState.setBackButtonVisible(launcher, shouldBackButtonBeVisible);
}
public static void resetOverview(Launcher launcher) {
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index 301070cad..f5d0b2492 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -709,12 +709,14 @@ public class DragLayer extends InsettableFrameLayout {
public void onViewAdded(View child) {
super.onViewAdded(child);
updateChildIndices();
+ UiFactory.onLauncherStateOrFocusChanged(mLauncher);
}
@Override
public void onViewRemoved(View child) {
super.onViewRemoved(child);
updateChildIndices();
+ UiFactory.onLauncherStateOrFocusChanged(mLauncher);
}
@Override