diff options
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 1db7953d8..2832ec77f 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -156,9 +156,7 @@ public class DeviceProfile { int allAppsNumRows; int allAppsNumCols; int searchBarSpaceWidthPx; - int searchBarSpaceMaxWidthPx; int searchBarSpaceHeightPx; - int searchBarHeightPx; int pageIndicatorHeightPx; int allAppsButtonVisualSize; @@ -311,8 +309,9 @@ public class DeviceProfile { computeAllAppsButtonSize(context); // Search Bar searchBarVisible = isSearchBarEnabled(context); - searchBarSpaceWidthPx = Math.min(searchBarSpaceMaxWidthPx, widthPx); - searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 3 * edgeMarginPx); + searchBarSpaceWidthPx = Math.min(searchBarSpaceWidthPx, widthPx); + searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? + searchBarSpaceHeightPx - getSearchBarTopOffset() : 3 * edgeMarginPx); } /** @@ -434,11 +433,10 @@ public class DeviceProfile { iconDrawablePaddingPx = drawablePadding; hotseatIconSizePx = (int) (DynamicGrid.pxFromDp(hotseatIconSize, dm) * scale); - // Search Bar - searchBarSpaceMaxWidthPx = resources.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_max_width); - searchBarHeightPx = resources.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_height); - searchBarSpaceWidthPx = Math.min(searchBarSpaceMaxWidthPx, widthPx); - searchBarSpaceHeightPx = searchBarHeightPx + getSearchBarTopOffset(); + searchBarSpaceWidthPx = Math.min(widthPx, + resources.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_max_width)); + searchBarSpaceHeightPx = getSearchBarTopOffset() + + resources.getDimensionPixelSize(R.dimen.dynamic_grid_search_bar_height); // Calculate the actual text height Paint textPaint = new Paint(); @@ -461,10 +459,6 @@ public class DeviceProfile { folderIconSizePx = iconSizePx + 2 * -folderBackgroundOffset; // All Apps - Rect padding = getWorkspacePadding(isLandscape ? - CellLayout.LANDSCAPE : CellLayout.PORTRAIT); - int pageIndicatorOffset = - resources.getDimensionPixelSize(R.dimen.apps_customize_page_indicator_offset); allAppsCellWidthPx = allAppsIconSizePx; allAppsCellHeightPx = allAppsIconSizePx + drawablePadding + iconTextSizePx; int maxLongEdgeCellCount = @@ -775,7 +769,8 @@ public class DeviceProfile { public void layout(Launcher launcher) { // Update search bar for live settings searchBarVisible = isSearchBarEnabled(launcher); - searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? searchBarHeightPx : 3 * edgeMarginPx); + searchBarSpaceHeightPx = 2 * edgeMarginPx + (searchBarVisible ? + searchBarSpaceHeightPx - getSearchBarTopOffset() : 3 * edgeMarginPx); FrameLayout.LayoutParams lp; Resources res = launcher.getResources(); boolean hasVerticalBarLayout = isVerticalBarLayout(); @@ -792,9 +787,6 @@ public class DeviceProfile { lp.gravity = Gravity.TOP | Gravity.LEFT; lp.width = searchBarSpaceHeightPx; lp.height = LayoutParams.WRAP_CONTENT; - searchBar.setPadding( - 0, 2 * edgeMarginPx, 0, - 2 * edgeMarginPx); LinearLayout targets = (LinearLayout) searchBar.findViewById(R.id.drag_target_bar); targets.setOrientation(LinearLayout.VERTICAL); @@ -803,10 +795,6 @@ public class DeviceProfile { lp.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL; lp.width = searchBarSpaceWidthPx; lp.height = searchBarSpaceHeightPx; - searchBar.setPadding( - edgeMarginPx, - getSearchBarTopOffset(), - edgeMarginPx, edgeMarginPx); } if (launcher.mSearchWidgetId >= 0) { // remove padding on widget @@ -829,20 +817,6 @@ public class DeviceProfile { vglp.height = LayoutParams.MATCH_PARENT; qsbBar.setLayoutParams(vglp); - // Layout the voice proxy - View voiceButtonProxy = launcher.findViewById(R.id.voice_button_proxy); - if (voiceButtonProxy != null) { - if (hasVerticalBarLayout) { - // TODO: MOVE THIS INTO SEARCH BAR MEASURE - } else { - lp = (FrameLayout.LayoutParams) voiceButtonProxy.getLayoutParams(); - lp.gravity = Gravity.TOP | Gravity.END; - lp.width = (widthPx - searchBarSpaceWidthPx) / 2 + - 2 * iconSizePx; - lp.height = searchBarSpaceHeightPx; - } - } - // Layout the workspace PagedView workspace = (PagedView) launcher.findViewById(R.id.workspace); lp = (FrameLayout.LayoutParams) workspace.getLayoutParams(); |