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

Commit 8afcd149 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Make SystemUI RTL aware

- see bug #5429822 UI should be mirrored for RTL locales (Arabic, Hebrew, farsi)

Change-Id: Ica88ed68f893d5272691a9207788b65623849dee
parent f50a37d3
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -121,6 +121,12 @@ public class SizeAdaptiveLayout extends ViewGroup {
        mTransitionAnimation.addListener(mAnimatorListener);
    }

    @Override
    public void setLayoutDirection(int layoutDirection) {
        super.setLayoutDirection(layoutDirection);
        mModestyPanel.setLayoutDirection(layoutDirection);
    }

    /**
     * Visible for testing
     * @hide
@@ -225,14 +231,12 @@ public class SizeAdaptiveLayout extends ViewGroup {
        if (unboundedView != null) {
            tallestView = unboundedView;
        }
        if (heightMode == MeasureSpec.UNSPECIFIED) {
            return tallestView;
        }
        if (heightSize > tallestViewSize) {
        if (heightMode == MeasureSpec.UNSPECIFIED || heightSize > tallestViewSize) {
            return tallestView;
        }
        } else {
            return smallestView;
        }
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
@@ -242,6 +246,7 @@ public class SizeAdaptiveLayout extends ViewGroup {
                                                           View.MeasureSpec.EXACTLY);
        mActiveChild = selectActiveChild(measureSpec);
        mActiveChild.setVisibility(View.VISIBLE);
        mActiveChild.setLayoutDirection(getLayoutDirection());

        if (mLastActive != mActiveChild && mLastActive != null) {
            if (DEBUG) Log.d(TAG, this + " changed children from: " + mLastActive +
@@ -272,10 +277,10 @@ public class SizeAdaptiveLayout extends ViewGroup {
        final int childWidth = mActiveChild.getMeasuredWidth();
        final int childHeight = mActiveChild.getMeasuredHeight();
        // TODO investigate setting LAYER_TYPE_HARDWARE on mLastActive
        mActiveChild.layout(0, 0, 0 + childWidth, 0 + childHeight);
        mActiveChild.layout(0, 0, childWidth, childHeight);

        if (DEBUG) Log.d(TAG, "got modesty offset of " + mModestyPanelTop);
        mModestyPanel.layout(0, mModestyPanelTop, 0 + childWidth, mModestyPanelTop + childHeight);
        mModestyPanel.layout(0, mModestyPanelTop, childWidth, mModestyPanelTop + childHeight);
    }

    @Override
+2 −1
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@
        android:allowBackup="false"
        android:hardwareAccelerated="true"
        android:label="@string/app_label"
        android:icon="@*android:drawable/platlogo">
        android:icon="@*android:drawable/platlogo"
        android:supportsRtl="true">

        <!-- Broadcast receiver that gets the broadcast at boot time and starts
             up everything else.
+367 B
Loading image diff...
+550 B
Loading image diff...
+983 B
Loading image diff...
Loading