diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 4ee8a5115b..feb5f920e4 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -104,7 +104,6 @@ public class DeviceProfile { private int searchBarSpaceWidthPx; private int searchBarSpaceHeightNormalPx, searchBarSpaceHeightTallPx; private int searchBarSpaceHeightPx; // One of the above. - private int searchBarHeight = LauncherCallbacks.SEARCH_BAR_HEIGHT_NORMAL; public DeviceProfile(Context context, InvariantDeviceProfile inv, Point minSize, Point maxSize, @@ -408,13 +407,8 @@ public class DeviceProfile { return visibleChildren; } - public void layout(Launcher launcher) { - FrameLayout.LayoutParams lp; - boolean hasVerticalBarLayout = isVerticalBarLayout(); - final boolean isLayoutRtl = Utilities.isRtl(launcher.getResources()); - - // Layout the search bar space - searchBarHeight = launcher.getSearchBarHeight(); + // TODO(twickham): b/25154513 + public void setSearchBarHeight(int searchBarHeight) { if (searchBarHeight == LauncherCallbacks.SEARCH_BAR_HEIGHT_TALL) { hotseatBarHeightPx = hotseatBarHeightShortPx; searchBarSpaceHeightPx = searchBarSpaceHeightTallPx; @@ -422,6 +416,14 @@ public class DeviceProfile { hotseatBarHeightPx = hotseatBarHeightNormalPx; searchBarSpaceHeightPx = searchBarSpaceHeightNormalPx; } + } + + public void layout(Launcher launcher) { + FrameLayout.LayoutParams lp; + boolean hasVerticalBarLayout = isVerticalBarLayout(); + final boolean isLayoutRtl = Utilities.isRtl(launcher.getResources()); + + // Layout the search bar space View searchBar = launcher.getSearchDropTargetBar(); lp = getDropTargetBarLayoutParams(hasVerticalBarLayout, searchBar, Gravity.TOP); searchBar.setLayoutParams(lp); @@ -542,7 +544,7 @@ public class DeviceProfile { // Vertical drop target bar space -- The drop target bar is fixed in the layout to be on // the left of the screen regardless of RTL lp.gravity = Gravity.LEFT; - lp.width = searchBarSpaceHeightPx; + lp.width = searchBarSpaceHeightNormalPx; LinearLayout targets = (LinearLayout) dropTargetBar.findViewById(R.id.drag_target_bar); targets.setOrientation(LinearLayout.VERTICAL); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index a1dd2fb378..4687bb7636 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -441,6 +441,8 @@ public class Launcher extends Activity setContentView(R.layout.launcher); + app.getInvariantDeviceProfile().landscapeProfile.setSearchBarHeight(getSearchBarHeight()); + app.getInvariantDeviceProfile().portraitProfile.setSearchBarHeight(getSearchBarHeight()); setupViews(); mDeviceProfile.layout(this); @@ -3601,6 +3603,10 @@ public class Launcher extends Activity opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT, minHeight); opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MAX_WIDTH, maxWidth); opts.putInt(AppWidgetManager.OPTION_APPWIDGET_MIN_WIDTH, minWidth); + if (LOGD) { + Log.d(TAG, "QSB widget options: maxHeight=" + maxHeight + " minHeight=" + minHeight + + " maxWidth=" + maxWidth + " minWidth=" + minWidth); + } if (mLauncherCallbacks != null) { opts.putAll(mLauncherCallbacks.getAdditionalSearchWidgetOptions());