diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-03-06 15:38:32 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-03-06 15:41:29 -0800 |
commit | 371ea051d19c26398779db9e43bacb47097e1858 (patch) | |
tree | 3b535b6be0a22564b7cc90b2efd4ab14e8e7267c /src/com/android/launcher3/Launcher.java | |
parent | 826405d0952a2d72db6b3f5f446c992d8ede2243 (diff) | |
download | android_packages_apps_Trebuchet-371ea051d19c26398779db9e43bacb47097e1858.tar.gz android_packages_apps_Trebuchet-371ea051d19c26398779db9e43bacb47097e1858.tar.bz2 android_packages_apps_Trebuchet-371ea051d19c26398779db9e43bacb47097e1858.zip |
Fixing launcher UI not reapplied properly when IDP changed as a result of display changes
> Removing unnecessary check when binding model data as its safe to bind old data,
we should just not persist it (that check is already there in model writer)
> Adding additional check in model bind to skip old bind if there are multiple binds
Bug: 126259547
Bug: 118441555
Change-Id: Ic250d2af13797d3e70c6e1fc70da65ebe6ab8d70
Diffstat (limited to 'src/com/android/launcher3/Launcher.java')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d82044887..8d029e71b 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -378,14 +378,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, } if ((diff & (CONFIG_ORIENTATION | CONFIG_SCREEN_SIZE)) != 0) { - mUserEventDispatcher = null; - initDeviceProfile(mDeviceProfile.inv); - dispatchDeviceProfileChanged(); - reapplyUi(); - mDragLayer.recreateControllers(); - - // TODO: We can probably avoid rebind when only screen size changed. - rebindModel(); + onIdpChanged(mDeviceProfile.inv); } mOldConfig.setTo(newConfig); @@ -410,8 +403,19 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, @Override public void onIdpChanged(int changeFlags, InvariantDeviceProfile idp) { + onIdpChanged(idp); + } + + private void onIdpChanged(InvariantDeviceProfile idp) { + mUserEventDispatcher = null; + initDeviceProfile(idp); - getRootView().dispatchInsets(); + dispatchDeviceProfileChanged(); + reapplyUi(); + mDragLayer.recreateControllers(); + + // TODO: We can probably avoid rebind when only screen size changed. + rebindModel(); } private void initDeviceProfile(InvariantDeviceProfile idp) { |