summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherAppWidgetHostView.java
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-09-19 14:43:17 -0700
committerJon Miranda <jonmiranda@google.com>2017-09-19 14:43:17 -0700
commit6bed350b75ad407ba85ae15d62551194dd0a69d4 (patch)
tree363c2c2169a60199342422f1848bab283c41c2d0 /src/com/android/launcher3/LauncherAppWidgetHostView.java
parentd926a9316f61a7540b00ecd42acba8013e715f92 (diff)
downloadandroid_packages_apps_Trebuchet-6bed350b75ad407ba85ae15d62551194dd0a69d4.tar.gz
android_packages_apps_Trebuchet-6bed350b75ad407ba85ae15d62551194dd0a69d4.tar.bz2
android_packages_apps_Trebuchet-6bed350b75ad407ba85ae15d62551194dd0a69d4.zip
Fix bug where widgets are inflated in the wrong orientation.
The bug is that in onResume, the context may tell us the wrong orientation. As a workaround, we store the orientation that the Launcher is created with, and we use that orientation to check whether we actually need to reinflate the widgets. Bug: 64916689 Change-Id: I5194debbd217a573d1f177c31d8c0abdf9da51b5
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetHostView.java')
-rw-r--r--src/com/android/launcher3/LauncherAppWidgetHostView.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetHostView.java b/src/com/android/launcher3/LauncherAppWidgetHostView.java
index b65b74ea0..7fe130876 100644
--- a/src/com/android/launcher3/LauncherAppWidgetHostView.java
+++ b/src/com/android/launcher3/LauncherAppWidgetHostView.java
@@ -142,9 +142,8 @@ public class LauncherAppWidgetHostView extends AppWidgetHostView
return false;
}
- public boolean isReinflateRequired() {
+ public boolean isReinflateRequired(int orientation) {
// Re-inflate is required if the orientation has changed since last inflated.
- int orientation = mContext.getResources().getConfiguration().orientation;
if (mPreviousOrientation != orientation) {
return true;
}