resolve merge conflicts of 52040c2d51 to ub-launcher3-master.
Change-Id: Ie3cf72ef11b43e2c681d6d614c668062c7e7b74c
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 4ee8a51..feb5f92 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -104,7 +104,6 @@
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 @@
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 @@
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 @@
// 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 a1dd2fb..4687bb7 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -441,6 +441,8 @@
setContentView(R.layout.launcher);
+ app.getInvariantDeviceProfile().landscapeProfile.setSearchBarHeight(getSearchBarHeight());
+ app.getInvariantDeviceProfile().portraitProfile.setSearchBarHeight(getSearchBarHeight());
setupViews();
mDeviceProfile.layout(this);
@@ -3601,6 +3603,10 @@
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());