From 22235bcb40071af464fc9accf0fbf082056182f7 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Fri, 3 Apr 2015 09:23:43 -0700 Subject: Reinflating QBS on resume, if the widget orientation is not same as launcher orientation Bug: 20044969 Change-Id: I5c285ddb09fc8b5d8444795eda64cd28486ab81d --- src/com/android/launcher3/Launcher.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/com/android') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 8a21d624c..c040d93f2 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1047,6 +1047,7 @@ public class Launcher extends Activity // (framework issue). On resuming, we ensure that any widgets are inflated for the current // orientation. getWorkspace().reinflateWidgetsIfNecessary(); + reinflateQSBIfNecessary(); // Process any items that were added while Launcher was away. InstallShortcutReceiver.disableAndFlushInstallQueue(this); @@ -3505,6 +3506,15 @@ public class Launcher extends Activity return mQsb; } + private void reinflateQSBIfNecessary() { + if (mQsb instanceof LauncherAppWidgetHostView && + ((LauncherAppWidgetHostView) mQsb).isReinflateRequired()) { + mSearchDropTargetBar.removeView(mQsb); + mQsb = null; + mSearchDropTargetBar.setQsbSearchBar(getOrCreateQsbBar()); + } + } + @Override public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { final boolean result = super.dispatchPopulateAccessibilityEvent(event); -- cgit v1.2.3