Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df3bc52c authored by Jon Miranda's avatar Jon Miranda
Browse files

Center overview panel buttons.

Bug: 32313927
Change-Id: Ib6e82b12ef45d2fe59e46b5b2dd8945047eeb981
parent e4f09a5f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
     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"
+3 −8
Original line number Diff line number Diff line
@@ -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;

            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);
        }