diff options
author | Jon Miranda <jonmiranda@google.com> | 2016-11-01 16:55:56 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2016-11-02 13:39:46 -0700 |
commit | df3bc52ca9c4271398d35b17cf550ca9099b8249 (patch) | |
tree | 6f8a2a662a3bd9cfa5c1aca4c101ef0c3129036a | |
parent | e4f09a5f0a756de15fee663097071a08de1ec8dd (diff) | |
download | android_packages_apps_Trebuchet-df3bc52ca9c4271398d35b17cf550ca9099b8249.tar.gz android_packages_apps_Trebuchet-df3bc52ca9c4271398d35b17cf550ca9099b8249.tar.bz2 android_packages_apps_Trebuchet-df3bc52ca9c4271398d35b17cf550ca9099b8249.zip |
Center overview panel buttons.
Bug: 32313927
Change-Id: Ib6e82b12ef45d2fe59e46b5b2dd8945047eeb981
-rw-r--r-- | res/layout/overview_panel.xml | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/res/layout/overview_panel.xml b/res/layout/overview_panel.xml index 9ba3f09ae..209172143 100644 --- a/res/layout/overview_panel.xml +++ b/res/layout/overview_panel.xml @@ -15,11 +15,13 @@ limitations under the License. --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:launcher="http://schemas.android.com/apk/res-auto" + launcher:layout_ignoreInsets="true" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|bottom" android:gravity="top" - android:orientation="horizontal" > + android:orientation="horizontal"> <TextView android:id="@+id/wallpaper_button" diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index b25c0a18f..72004d6f0 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -555,18 +555,13 @@ public class DeviceProfile { // Layout the Overview Mode ViewGroup overviewMode = launcher.getOverviewPanel(); if (overviewMode != null) { - lp = (FrameLayout.LayoutParams) overviewMode.getLayoutParams(); - lp.gravity = Gravity.LEFT | Gravity.BOTTOM; - int visibleChildCount = getVisibleChildCount(overviewMode); int totalItemWidth = visibleChildCount * overviewModeBarItemWidthPx; - int maxWidth = totalItemWidth + (visibleChildCount-1) * overviewModeBarSpacerWidthPx; + int maxWidth = totalItemWidth + (visibleChildCount - 1) * overviewModeBarSpacerWidthPx; + lp = (FrameLayout.LayoutParams) overviewMode.getLayoutParams(); lp.width = Math.min(availableWidthPx, maxWidth); - lp.height = getOverviewModeButtonBarHeight(); - // Center the overview buttons on the workspace page - lp.leftMargin = workspacePadding.left + (availableWidthPx - - workspacePadding.left - workspacePadding.right - lp.width) / 2; + lp.height = getOverviewModeButtonBarHeight() + mInsets.bottom; overviewMode.setLayoutParams(lp); } |