summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2015-10-23 18:38:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-23 18:38:46 +0000
commit52040c2d51d9c4d1bfaeda8e067deb7655099840 (patch)
tree966dba691620fb21b277bfad0e4b9458b5e5b79f
parentdf315180f0653702b470beea62f27927e45fab4b (diff)
parenteef443248a86bdb2dc5c21e81d3eeaef67a695bc (diff)
downloadandroid_packages_apps_Trebuchet-52040c2d51d9c4d1bfaeda8e067deb7655099840.tar.gz
android_packages_apps_Trebuchet-52040c2d51d9c4d1bfaeda8e067deb7655099840.tar.bz2
android_packages_apps_Trebuchet-52040c2d51d9c4d1bfaeda8e067deb7655099840.zip
Merge "Set search bar height before setting up views in Launcher." into ub-launcher3-burnaby-polish
-rw-r--r--src/com/android/launcher3/DeviceProfile.java20
-rw-r--r--src/com/android/launcher3/Launcher.java6
2 files changed, 17 insertions, 9 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 5778763a4..ed6b7d7a8 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,
@@ -396,6 +395,17 @@ public class DeviceProfile {
return visibleChildren;
}
+ // TODO(twickham): b/25154513
+ public void setSearchBarHeight(int searchBarHeight) {
+ if (searchBarHeight == LauncherCallbacks.SEARCH_BAR_HEIGHT_TALL) {
+ hotseatBarHeightPx = hotseatBarHeightShortPx;
+ searchBarSpaceHeightPx = searchBarSpaceHeightTallPx;
+ } else {
+ hotseatBarHeightPx = hotseatBarHeightNormalPx;
+ searchBarSpaceHeightPx = searchBarSpaceHeightNormalPx;
+ }
+ }
+
public void layout(Launcher launcher) {
FrameLayout.LayoutParams lp;
boolean hasVerticalBarLayout = isVerticalBarLayout();
@@ -404,14 +414,6 @@ public class DeviceProfile {
// Layout the search bar space
View searchBar = launcher.getSearchDropTargetBar();
lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams();
- searchBarHeight = launcher.getSearchBarHeight();
- if (searchBarHeight == LauncherCallbacks.SEARCH_BAR_HEIGHT_TALL) {
- hotseatBarHeightPx = hotseatBarHeightShortPx;
- searchBarSpaceHeightPx = searchBarSpaceHeightTallPx;
- } else {
- hotseatBarHeightPx = hotseatBarHeightNormalPx;
- searchBarSpaceHeightPx = searchBarSpaceHeightNormalPx;
- }
if (hasVerticalBarLayout) {
// Vertical search bar space -- The search bar is fixed in the layout to be on the left
// of the screen regardless of RTL
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 7ba9cc8ca..969edff0e 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -454,6 +454,8 @@ public class Launcher extends Activity
setContentView(R.layout.launcher);
+ app.getInvariantDeviceProfile().landscapeProfile.setSearchBarHeight(getSearchBarHeight());
+ app.getInvariantDeviceProfile().portraitProfile.setSearchBarHeight(getSearchBarHeight());
setupViews();
mDeviceProfile.layout(this);
@@ -3641,6 +3643,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());