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

Commit 97299f2b authored by Daniel Norman's avatar Daniel Norman
Browse files

Fix UI location and snackbar padding for RTL.

Screenshots:
- Padding: https://screenshot.googleplex.com/3yd42n8MzSaw7Xv
- LTR portrait: https://screenshot.googleplex.com/5uskVaFs5hPHxod
- RTL portrait: https://screenshot.googleplex.com/4zn8Ds76TXZF7BP
- LTR landscape: https://screenshot.googleplex.com/5GQFYN5MTiJWxyB
- RTL landscape: https://screenshot.googleplex.com/ANmwpmf2A53GE5D

Fix: 276298668
Fix: 276236465
Test: Change device to RTL locale, open and interact with the
      AccessibilityMenu service.
Change-Id: I1633840bae0da0a576efb16d9d45659083deb1b9
parent abd084a6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingStart="16dp"
      android:paddingEnd="16dp"
      android:gravity="center_vertical"
      android:textColor="@color/colorControlNormal"
      android:textSize="@dimen/label_text_size"
+7 −5
Original line number Diff line number Diff line
@@ -194,13 +194,15 @@ public class A11yMenuOverlayLayout {
    /** Updates a11y menu layout position by configuring layout params. */
    private void updateLayoutPosition() {
        final Display display = mDisplayManager.getDisplay(Display.DEFAULT_DISPLAY);
        final int orientation = mService.getResources().getConfiguration().orientation;
        final Configuration configuration = mService.getResources().getConfiguration();
        final int orientation = configuration.orientation;
        if (display != null && orientation == Configuration.ORIENTATION_LANDSCAPE) {
            final boolean ltr = configuration.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR;
            switch (display.getRotation()) {
                case Surface.ROTATION_90:
                case Surface.ROTATION_0:
                case Surface.ROTATION_180:
                    mLayoutParameter.gravity =
                            Gravity.END | Gravity.BOTTOM
                            (ltr ? Gravity.END : Gravity.START) | Gravity.BOTTOM
                                    | Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL;
                    mLayoutParameter.width = WindowManager.LayoutParams.WRAP_CONTENT;
                    mLayoutParameter.height = WindowManager.LayoutParams.MATCH_PARENT;
@@ -208,10 +210,10 @@ public class A11yMenuOverlayLayout {
                    mLayoutParameter.flags |= WindowManager.LayoutParams.FLAG_LAYOUT_INSET_DECOR;
                    mLayout.setBackgroundResource(R.drawable.shadow_90deg);
                    break;
                case Surface.ROTATION_0:
                case Surface.ROTATION_90:
                case Surface.ROTATION_270:
                    mLayoutParameter.gravity =
                            Gravity.START | Gravity.BOTTOM
                            (ltr ? Gravity.START : Gravity.END) | Gravity.BOTTOM
                                    | Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL;
                    mLayoutParameter.width = WindowManager.LayoutParams.WRAP_CONTENT;
                    mLayoutParameter.height = WindowManager.LayoutParams.MATCH_PARENT;