summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherRootView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2018-01-08 14:19:34 -0800
committerSunny Goyal <sunnygoyal@google.com>2018-01-10 15:13:25 -0800
commit07b6929cd94e6d55fb660f85baf1df840de48f46 (patch)
tree1a36a8f59b943d5440d72efa12d5ce2a2a027188 /src/com/android/launcher3/LauncherRootView.java
parent228153d92ae68c82efd3fcad4ad3df6af7fc24a2 (diff)
downloadandroid_packages_apps_Trebuchet-07b6929cd94e6d55fb660f85baf1df840de48f46.tar.gz
android_packages_apps_Trebuchet-07b6929cd94e6d55fb660f85baf1df840de48f46.tar.bz2
android_packages_apps_Trebuchet-07b6929cd94e6d55fb660f85baf1df840de48f46.zip
Removing layout handling in DeviceProfile and moving it to
individual views Bug: 71709920 Change-Id: I8300fa7a84b31898bdb135d774cca576d2928525
Diffstat (limited to 'src/com/android/launcher3/LauncherRootView.java')
-rw-r--r--src/com/android/launcher3/LauncherRootView.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java
index a81432363..1a1bec684 100644
--- a/src/com/android/launcher3/LauncherRootView.java
+++ b/src/com/android/launcher3/LauncherRootView.java
@@ -16,6 +16,8 @@ import static com.android.launcher3.util.SystemUiController.UI_STATE_ROOT_VIEW;
public class LauncherRootView extends InsettableFrameLayout {
+ private final Launcher mLauncher;
+
private final Paint mOpaquePaint;
@ViewDebug.ExportedProperty(category = "launcher")
private boolean mDrawSideInsetBar;
@@ -32,6 +34,8 @@ public class LauncherRootView extends InsettableFrameLayout {
mOpaquePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mOpaquePaint.setColor(Color.BLACK);
mOpaquePaint.setStyle(Paint.Style.FILL);
+
+ mLauncher = Launcher.getLauncher(context);
}
@Override
@@ -57,10 +61,11 @@ public class LauncherRootView extends InsettableFrameLayout {
} else {
mLeftInsetBarWidth = mRightInsetBarWidth = 0;
}
- Launcher.getLauncher(getContext()).getSystemUiController().updateUiState(
+ mLauncher.getSystemUiController().updateUiState(
UI_STATE_ROOT_VIEW, mDrawSideInsetBar ? FLAG_DARK_NAV : 0);
- boolean rawInsetsChanged = !mInsets.equals(insets);
+ // Update device profile before notifying th children.
+ mLauncher.getDeviceProfile().updateInsets(insets);
setInsets(insets);
if (mAlignedView != null) {
@@ -73,15 +78,13 @@ public class LauncherRootView extends InsettableFrameLayout {
}
}
- if (rawInsetsChanged) {
- // Update the grid again
- Launcher launcher = Launcher.getLauncher(getContext());
- launcher.onInsetsChanged(insets);
- }
-
return true; // I'll take it from here
}
+ public void dispatchInsets() {
+ fitSystemWindows(mInsets);
+ }
+
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);