summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-09-20 10:18:41 -0700
committerJon Miranda <jonmiranda@google.com>2017-09-20 10:18:41 -0700
commit11ee2f6e8fe4075856589fd5dd3e4b5ba326be2c (patch)
tree87d012e4cd5c2494a276ba23d18c608072544cfe
parent6bed350b75ad407ba85ae15d62551194dd0a69d4 (diff)
downloadandroid_packages_apps_Trebuchet-11ee2f6e8fe4075856589fd5dd3e4b5ba326be2c.tar.gz
android_packages_apps_Trebuchet-11ee2f6e8fe4075856589fd5dd3e4b5ba326be2c.tar.bz2
android_packages_apps_Trebuchet-11ee2f6e8fe4075856589fd5dd3e4b5ba326be2c.zip
Move orientation initialization to onCreate.
Bug: 64916689 Change-Id: Iacc04dcc261fc049b83cb81792975414fb00b3cc
-rw-r--r--src/com/android/launcher3/qsb/QsbContainerView.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/launcher3/qsb/QsbContainerView.java b/src/com/android/launcher3/qsb/QsbContainerView.java
index 27a07c217..65acaa973 100644
--- a/src/com/android/launcher3/qsb/QsbContainerView.java
+++ b/src/com/android/launcher3/qsb/QsbContainerView.java
@@ -80,10 +80,15 @@ public class QsbContainerView extends FrameLayout {
private AppWidgetProviderInfo mWidgetInfo;
private QsbWidgetHostView mQsb;
+ // We need to store the orientation here, due to a bug (b/64916689) that results in widgets
+ // being inflated in the wrong orientation.
+ private int mOrientation;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mQsbWidgetHost = new QsbWidgetHost(getActivity());
+ mOrientation = getContext().getResources().getConfiguration().orientation;
}
private FrameLayout mWrapper;
@@ -194,8 +199,7 @@ public class QsbContainerView extends FrameLayout {
@Override
public void onResume() {
super.onResume();
- int orientation = Launcher.getLauncher(getContext()).getOrientation();
- if (mQsb != null && mQsb.isReinflateRequired(orientation)) {
+ if (mQsb != null && mQsb.isReinflateRequired(mOrientation)) {
rebindFragment();
}
}