diff --git a/core/java/com/android/internal/widget/SizeAdaptiveLayout.java b/core/java/com/android/internal/widget/SizeAdaptiveLayout.java index 273f6fef321e4..0280a0bd0ef88 100644 --- a/core/java/com/android/internal/widget/SizeAdaptiveLayout.java +++ b/core/java/com/android/internal/widget/SizeAdaptiveLayout.java @@ -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,13 +231,11 @@ public class SizeAdaptiveLayout extends ViewGroup { if (unboundedView != null) { tallestView = unboundedView; } - if (heightMode == MeasureSpec.UNSPECIFIED) { + if (heightMode == MeasureSpec.UNSPECIFIED || heightSize > tallestViewSize) { return tallestView; + } else { + return smallestView; } - if (heightSize > tallestViewSize) { - return tallestView; - } - return smallestView; } @Override @@ -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 diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index cfe70dc862c05..14fe6af42c44a 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -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"> @@ -71,7 +71,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginRight="16dip" /> + android:layout_marginEnd="16dip" /> diff --git a/packages/SystemUI/res/layout/system_bar_notification_area.xml b/packages/SystemUI/res/layout/system_bar_notification_area.xml index a59dad2a64551..51ffda776159a 100644 --- a/packages/SystemUI/res/layout/system_bar_notification_area.xml +++ b/packages/SystemUI/res/layout/system_bar_notification_area.xml @@ -22,7 +22,7 @@ android:id="@+id/notificationArea" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:orientation="horizontal" android:background="?android:attr/listChoiceBackgroundIndicator" android:clickable="true" @@ -39,7 +39,7 @@ android:id="@+id/imeSwitchButton" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_marginLeft="8dip" + android:layout_marginStart="8dip" android:src="@drawable/ic_sysbar_ime_default" android:visibility="gone" android:contentDescription="@string/accessibility_ime_switch_button" @@ -49,7 +49,7 @@ android:id="@+id/compatModeButton" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_marginLeft="8dip" + android:layout_marginStart="8dip" android:src="@drawable/ic_sysbar_zoom" android:visibility="gone" android:contentDescription="@string/accessibility_compatibility_zoom_button" @@ -66,7 +66,7 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_vertical" - android:layout_marginLeft="8dp" + android:layout_marginStart="8dp" android:alpha="0.4" /> @@ -85,16 +85,16 @@ android:layout_height="match_parent" android:singleLine="true" android:paddingLeft="6dip" - android:layout_marginRight="8dip" - android:gravity="center_vertical|left" + android:layout_marginEnd="8dip" + android:gravity="center_vertical|start" /> diff --git a/packages/SystemUI/res/layout/system_bar_notification_panel.xml b/packages/SystemUI/res/layout/system_bar_notification_panel.xml index 315639ea2c679..58a6de36fc589 100644 --- a/packages/SystemUI/res/layout/system_bar_notification_panel.xml +++ b/packages/SystemUI/res/layout/system_bar_notification_panel.xml @@ -21,7 +21,7 @@ android:id="@+id/content_parent" android:layout_height="match_parent" android:layout_width="match_parent" - android:gravity="right" + android:gravity="end" > @@ -29,7 +29,7 @@ android:id="@+id/system_bar_notification_panel_bottom_space" android:layout_height="56dp" android:layout_width="478dp" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_alignParentBottom="true" /> @@ -39,7 +39,7 @@ android:layout_height="wrap_content" android:layout_width="478dp" android:orientation="vertical" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_above="@id/system_bar_notification_panel_bottom_space" android:paddingBottom="8dp" > @@ -48,7 +48,7 @@ android:layout_width="match_parent" android:layout_height="130dp" android:layout_above="@id/content_frame" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:layout_weight="0" /> diff --git a/packages/SystemUI/res/layout/system_bar_notification_panel_title.xml b/packages/SystemUI/res/layout/system_bar_notification_panel_title.xml index 59544f4f778a6..97f774a045fbe 100644 --- a/packages/SystemUI/res/layout/system_bar_notification_panel_title.xml +++ b/packages/SystemUI/res/layout/system_bar_notification_panel_title.xml @@ -32,7 +32,7 @@ android:id="@+id/icons" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_alignParentBottom="true" android:layout_marginTop="16dp" android:layout_marginBottom="16dp" @@ -86,7 +86,7 @@ diff --git a/packages/SystemUI/res/layout/system_bar_recent_item.xml b/packages/SystemUI/res/layout/system_bar_recent_item.xml index b5f7da7bda8cd..34f60b217c2fe 100644 --- a/packages/SystemUI/res/layout/system_bar_recent_item.xml +++ b/packages/SystemUI/res/layout/system_bar_recent_item.xml @@ -30,9 +30,9 @@ android:fadingEdge="horizontal" android:fadingEdgeLength="@dimen/status_bar_recents_text_fading_edge_length" android:scrollHorizontally="true" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_alignParentTop="true" - android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin" + android:layout_marginStart="@dimen/status_bar_recents_app_label_left_margin" android:layout_marginTop="32dip" android:singleLine="true" android:ellipsize="marquee" @@ -43,8 +43,8 @@ @@ -89,9 +89,9 @@ android:fadingEdge="horizontal" android:fadingEdgeLength="@dimen/status_bar_recents_text_fading_edge_length" android:scrollHorizontally="true" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_below="@id/recents_callout_line" - android:layout_marginLeft="@dimen/status_bar_recents_app_label_left_margin" + android:layout_marginStart="@dimen/status_bar_recents_app_label_left_margin" android:layout_marginTop="3dip" android:singleLine="true" android:ellipsize="marquee" diff --git a/packages/SystemUI/res/layout/system_bar_recent_panel.xml b/packages/SystemUI/res/layout/system_bar_recent_panel.xml index 3951bba7acd6e..aed8a8cfc0121 100644 --- a/packages/SystemUI/res/layout/system_bar_recent_panel.xml +++ b/packages/SystemUI/res/layout/system_bar_recent_panel.xml @@ -41,13 +41,13 @@ @@ -65,7 +65,7 @@ android:id="@+id/recents_no_apps" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginLeft="58dip" + android:layout_marginStart="58dip" android:layout_marginBottom="36dip" android:visibility="invisible" /> @@ -76,7 +76,7 @@ android:layout_width="match_parent" android:layout_height="@*android:dimen/system_bar_height" android:layout_alignParentBottom="true" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" /> diff --git a/packages/SystemUI/res/layout/system_bar_settings_view.xml b/packages/SystemUI/res/layout/system_bar_settings_view.xml index d07e45dc7bc8f..3e959d544aa8b 100644 --- a/packages/SystemUI/res/layout/system_bar_settings_view.xml +++ b/packages/SystemUI/res/layout/system_bar_settings_view.xml @@ -43,7 +43,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginRight="5dp" + android:layout_marginEnd="5dp" /> @@ -86,7 +86,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginRight="5dp" + android:layout_marginEnd="5dp" /> @@ -130,7 +130,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginRight="5dp" + android:layout_marginEnd="5dp" /> diff --git a/packages/SystemUI/res/layout/system_bar_ticker_compat.xml b/packages/SystemUI/res/layout/system_bar_ticker_compat.xml index 0d255e7f279dd..14cdc40048954 100644 --- a/packages/SystemUI/res/layout/system_bar_ticker_compat.xml +++ b/packages/SystemUI/res/layout/system_bar_ticker_compat.xml @@ -50,7 +50,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_vertical" - android:layout_marginLeft="12dp" + android:layout_marginStart="12dp" android:gravity="center_vertical" android:maxLines="2" /> diff --git a/packages/SystemUI/res/layout/system_bar_ticker_panel.xml b/packages/SystemUI/res/layout/system_bar_ticker_panel.xml index 1738b48c9212c..49d0405dec2b9 100644 --- a/packages/SystemUI/res/layout/system_bar_ticker_panel.xml +++ b/packages/SystemUI/res/layout/system_bar_ticker_panel.xml @@ -25,7 +25,7 @@ android:layout_height="@*android:dimen/system_bar_height" android:layout_width="match_parent" android:background="@drawable/system_bar_ticker_background" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_alignParentBottom="true" android:clickable="false" /> @@ -36,7 +36,7 @@ android:layout_height="@android:dimen/notification_large_icon_width" android:scaleType="center" android:visibility="gone" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_alignParentBottom="true" /> @@ -45,7 +45,7 @@ android:layout_weight="1" android:layout_height="@*android:dimen/system_bar_height" android:layout_width="match_parent" - android:layout_toRightOf="@id/large_icon" + android:layout_toEndOf="@id/large_icon" android:layout_alignParentBottom="true" android:layout_alignWithParentIfMissing="true" /> diff --git a/packages/SystemUI/res/layout/universe.xml b/packages/SystemUI/res/layout/universe.xml index 6102d2ee064e1..390c46764c344 100644 --- a/packages/SystemUI/res/layout/universe.xml +++ b/packages/SystemUI/res/layout/universe.xml @@ -22,7 +22,7 @@