diff options
author | Or Harambam <or15000@gmail.com> | 2013-01-04 21:28:08 +0200 |
---|---|---|
committer | Or Harambam <or15000@gmail.com> | 2013-01-19 18:14:25 +0200 |
commit | 55248c06a0a0f126eaa983ae25892f1316e54e7e (patch) | |
tree | 68f6175bd85b0b43534c6df0ed22810264f93669 | |
parent | 874e2fade0a8a5b1592e1615d3bd3b7a60cb49a1 (diff) | |
download | packages_apps_settings-55248c06a0a0f126eaa983ae25892f1316e54e7e.zip packages_apps_settings-55248c06a0a0f126eaa983ae25892f1316e54e7e.tar.gz packages_apps_settings-55248c06a0a0f126eaa983ae25892f1316e54e7e.tar.bz2 |
Settings: RTL layout fixes
Replaced Left with Start, and Right with End to fit Google's new RTL API.
Replaced setPadding with setPaddingRelative (which uses Start and End instead of Left and Right) around switches to make them look right in RTL UIs
Added RTL Support to LinearColorBar in order to make App Management's storageBar compatible with the RTL UI.
Reversed App Management's ViewPager in RTL langs
Fastscroll aligned to the left
Change-Id: I495f4794a9861fa01692d766ef86f4fdd8e4b38d
32 files changed, 95 insertions, 88 deletions
diff --git a/res/layout/account_sync_screen.xml b/res/layout/account_sync_screen.xml index aa080cf..67a62b9 100644 --- a/res/layout/account_sync_screen.xml +++ b/res/layout/account_sync_screen.xml @@ -46,7 +46,7 @@ android:layout_margin="8dip" android:text="@string/sync_is_failing" android:drawablePadding="8dip" - android:drawableLeft="@drawable/ic_sync_error_holo" /> + android:drawableStart="@drawable/ic_sync_error_holo" /> <!-- <LinearLayout android:id="@+id/remove_account_area" diff --git a/res/layout/crypt_keeper_status.xml b/res/layout/crypt_keeper_status.xml index c7264be..8a16e7f 100644 --- a/res/layout/crypt_keeper_status.xml +++ b/res/layout/crypt_keeper_status.xml @@ -35,6 +35,6 @@ android:textSize="18sp" android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/enter_password" - android:drawableLeft="@*android:drawable/ic_lock_idle_lock" + android:drawableStart="@*android:drawable/ic_lock_idle_lock" /> </LinearLayout> diff --git a/res/layout/dialog_light_settings.xml b/res/layout/dialog_light_settings.xml index a82556f..aa78c39 100644 --- a/res/layout/dialog_light_settings.xml +++ b/res/layout/dialog_light_settings.xml @@ -23,15 +23,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" /> + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" /> <LinearLayout android:id="@+id/color_panel_view" android:layout_width="match_parent" android:layout_height="40dp" - android:layout_alignLeft="@id/color_picker_view" - android:layout_alignRight="@id/color_picker_view" + android:layout_alignStart="@id/color_picker_view" + android:layout_alignEnd="@id/color_picker_view" android:layout_below="@id/color_picker_view" android:layout_marginBottom="4dp" android:layout_marginTop="4dp" @@ -46,8 +46,8 @@ <TextView android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" android:gravity="center" android:text="@string/picker_arrow" android:textColor="#ffffff" @@ -65,8 +65,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/color_panel_view" - android:layout_marginLeft="10dp" - android:layout_marginRight="10dp" + android:layout_marginStart="10dp" + android:layout_marginEnd="10dp" android:layout_marginTop="4dp" android:orientation="vertical" > diff --git a/res/layout/keyguard_appwidget_item.xml b/res/layout/keyguard_appwidget_item.xml index de0c855..6d99369 100755 --- a/res/layout/keyguard_appwidget_item.xml +++ b/res/layout/keyguard_appwidget_item.xml @@ -24,10 +24,10 @@ android:background="@drawable/appwidget_item_bg" android:layout_marginTop="2dip" android:layout_marginBottom="2dip" - android:layout_marginLeft="2dip" - android:layout_marginRight="2dip" - android:paddingLeft="16dip" - android:paddingRight="16dip" + android:layout_marginStart="2dip" + android:layout_marginEnd="2dip" + android:paddingStart="16dip" + android:paddingEnd="16dip" android:paddingTop="16dip" android:paddingBottom="16dip" > <ImageView @@ -40,8 +40,8 @@ style="@style/KeyguardAppWidgetItem" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingLeft="24dip" + android:paddingStart="24dip" android:paddingBottom="8dip" - android:gravity="left|bottom" /> + android:gravity="start|bottom" /> </LinearLayout> </FrameLayout> diff --git a/res/layout/keyguard_appwidget_picker_layout.xml b/res/layout/keyguard_appwidget_picker_layout.xml index e533672..a278004 100644 --- a/res/layout/keyguard_appwidget_picker_layout.xml +++ b/res/layout/keyguard_appwidget_picker_layout.xml @@ -18,8 +18,8 @@ android:id="@+id/layout_root" android:layout_width="match_parent" android:layout_height="match_parent" - android:paddingLeft="@dimen/keyguard_appwidget_picker_margin_left" - android:paddingRight="@dimen/keyguard_appwidget_picker_margin_right" + android:paddingStart="@dimen/keyguard_appwidget_picker_margin_left" + android:paddingEnd="@dimen/keyguard_appwidget_picker_margin_right" android:paddingTop="2dip" android:paddingBottom="2dip" android:orientation="vertical" > diff --git a/res/layout/lockscreen_shortcut_dialog.xml b/res/layout/lockscreen_shortcut_dialog.xml index 638af0f..fda4ff6 100644 --- a/res/layout/lockscreen_shortcut_dialog.xml +++ b/res/layout/lockscreen_shortcut_dialog.xml @@ -5,7 +5,7 @@ android:minHeight="?android:attr/listPreferredItemHeight" android:layout_height="wrap_content" android:paddingBottom="5dp" - android:paddingLeft="8dp" + android:paddingStart="8dp" android:gravity="center_vertical" android:orientation="horizontal"> <ImageButton @@ -19,14 +19,14 @@ android:layout_height="match_parent" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" - android:layout_marginRight="5dp" - android:layout_marginLeft="5dp" + android:layout_marginEnd="5dp" + android:layout_marginStart="5dp" android:background="@android:drawable/divider_horizontal_dark" /> <Button android:layout_width="match_parent" style="?android:attr/borderlessButtonStyle" - android:gravity="left|center_vertical" - android:paddingLeft="5dp" + android:gravity="start|center_vertical" + android:paddingStart="5dp" android:layout_height="wrap_content" android:id="@+id/label" /> -</LinearLayout>
\ No newline at end of file +</LinearLayout> diff --git a/res/layout/lockscreen_targets.xml b/res/layout/lockscreen_targets.xml index cff327c..9ca41a5 100644 --- a/res/layout/lockscreen_targets.xml +++ b/res/layout/lockscreen_targets.xml @@ -10,8 +10,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/holo_blue_light" - android:layout_marginRight="8dip" - android:layout_marginLeft="8dip" + android:layout_marginEnd="8dip" + android:layout_marginStart="8dip" android:padding="4dip" android:gravity="center_horizontal" android:textColor="#FFFFFF" diff --git a/res/layout/manage_accounts_screen.xml b/res/layout/manage_accounts_screen.xml index 2717805..329ebc5 100644 --- a/res/layout/manage_accounts_screen.xml +++ b/res/layout/manage_accounts_screen.xml @@ -37,6 +37,6 @@ android:layout_margin="8dip" android:text="@string/sync_is_failing" android:drawablePadding="8dip" - android:drawableLeft="@drawable/ic_sync_error_holo" /> + android:drawableStart="@drawable/ic_sync_error_holo" /> </LinearLayout> diff --git a/res/layout/manage_applications_content.xml b/res/layout/manage_applications_content.xml index 9e415a9..4ef1d49 100644 --- a/res/layout/manage_applications_content.xml +++ b/res/layout/manage_applications_content.xml @@ -35,8 +35,8 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:textAppearance="@style/TextAppearance.PagerTabs" - android:paddingLeft="@dimen/pager_tabs_padding" - android:paddingRight="@dimen/pager_tabs_padding"> + android:paddingStart="@dimen/pager_tabs_padding" + android:paddingEnd="@dimen/pager_tabs_padding"> </android.support.v4.view.PagerTabStrip> </android.support.v4.view.ViewPager> diff --git a/res/layout/nfc_select.xml b/res/layout/nfc_select.xml index f52a998..e72a979 100644 --- a/res/layout/nfc_select.xml +++ b/res/layout/nfc_select.xml @@ -32,8 +32,8 @@ style="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="30dip" - android:layout_marginRight="30dip" + android:layout_marginStart="30dip" + android:layout_marginEnd="30dip" android:layout_marginBottom="30dip" android:layout_gravity="center" android:text="@string/profile_add_nfc_text" /> diff --git a/res/layout/nfc_writer.xml b/res/layout/nfc_writer.xml index 06a1f71..959217c 100644 --- a/res/layout/nfc_writer.xml +++ b/res/layout/nfc_writer.xml @@ -32,8 +32,8 @@ style="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="30dip" - android:layout_marginRight="30dip" + android:layout_marginStart="30dip" + android:layout_marginEnd="30dip" android:layout_marginBottom="30dip" android:layout_gravity="center" android:text="@string/profile_nfc_text" /> diff --git a/res/layout/pick_item.xml b/res/layout/pick_item.xml index e937d7b..0ae0113 100755 --- a/res/layout/pick_item.xml +++ b/res/layout/pick_item.xml @@ -21,5 +21,5 @@ android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="center_vertical" android:drawablePadding="14dip" - android:paddingLeft="15dip" - android:paddingRight="15dip" /> + android:paddingStart="15dip" + android:paddingEnd="15dip" /> diff --git a/res/layout/preference_application_light.xml b/res/layout/preference_application_light.xml index 0dde402..3ada418 100644 --- a/res/layout/preference_application_light.xml +++ b/res/layout/preference_application_light.xml @@ -36,7 +36,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@android:id/title" - android:layout_alignLeft="@android:id/title" + android:layout_alignStart="@android:id/title" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorSecondary" android:maxLines="1" /> @@ -51,14 +51,14 @@ android:id="@+id/textViewTimeOnValue" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="right" + android:layout_gravity="end" android:textAppearance="?android:attr/textAppearanceSmall" /> <TextView android:id="@+id/textViewTimeOffValue" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="right" + android:layout_gravity="end" android:textAppearance="?android:attr/textAppearanceSmall" /> </LinearLayout> @@ -68,4 +68,4 @@ android:layout_height="wrap_content" android:layout_gravity="center" /> -</LinearLayout>
\ No newline at end of file +</LinearLayout> diff --git a/res/layout/preference_dialog_increasing_ring.xml b/res/layout/preference_dialog_increasing_ring.xml index 949f2c8..09bf181 100644 --- a/res/layout/preference_dialog_increasing_ring.xml +++ b/res/layout/preference_dialog_increasing_ring.xml @@ -44,8 +44,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="2dip" - android:paddingLeft="14dip" - android:paddingRight="14dip" /> + android:paddingStart="14dip" + android:paddingEnd="14dip" /> <TextView android:id="@+id/increasing_ring_volume_notice" android:layout_width="match_parent" diff --git a/res/layout/preference_dialog_ringervolume.xml b/res/layout/preference_dialog_ringervolume.xml index 0fc54c2..5636a35 100644 --- a/res/layout/preference_dialog_ringervolume.xml +++ b/res/layout/preference_dialog_ringervolume.xml @@ -163,14 +163,14 @@ android:id="@+id/link_volumes_section" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingLeft="8dip" + android:paddingStart="8dip" android:orientation="vertical" android:gravity="center_vertical"> <CheckBox android:id="@+id/link_ring_and_volume" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left" + android:layout_gravity="start" android:text="@string/link_volume_ringtones" android:textAppearance="?android:attr/textAppearanceSmall" /> @@ -178,7 +178,7 @@ android:id="@+id/link_mutes" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="left" + android:layout_gravity="start" android:text="@string/link_volume_mutes" android:textAppearance="?android:attr/textAppearanceSmall" /> diff --git a/res/layout/preference_name.xml b/res/layout/preference_name.xml index 61ba355..5b3ff86 100644 --- a/res/layout/preference_name.xml +++ b/res/layout/preference_name.xml @@ -29,15 +29,15 @@ android:gravity="center_vertical" android:clickable="true" android:focusable="true" - android:paddingLeft="@*android:dimen/preference_item_padding_side" - android:paddingRight="?android:attr/scrollbarSize" + android:paddingStart="@*android:dimen/preference_item_padding_side" + android:paddingEnd="?android:attr/scrollbarSize" android:background="?android:attr/selectableItemBackground"> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="@*android:dimen/preference_icon_minWidth" - android:layout_marginRight="6dip" + android:layout_marginStart="@*android:dimen/preference_icon_minWidth" + android:layout_marginEnd="6dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" android:layout_weight="1"> @@ -55,4 +55,4 @@ </LinearLayout> -</LinearLayout>
\ No newline at end of file +</LinearLayout> diff --git a/res/layout/preference_profiles.xml b/res/layout/preference_profiles.xml index 26f1ba1..916c2ee 100644 --- a/res/layout/preference_profiles.xml +++ b/res/layout/preference_profiles.xml @@ -33,15 +33,15 @@ <LinearLayout android:id="@android:id/widget_frame" - android:layout_width="68dip" + android:layout_width="wrap_content" android:layout_height="wrap_content" - android:gravity="center_vertical" + android:gravity="center_vertical|end" android:orientation="vertical" /> <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginRight="6dip" + android:layout_marginEnd="6dip" android:layout_marginTop="6dip" android:layout_marginBottom="6dip" android:layout_weight="1"> @@ -60,7 +60,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@android:id/title" - android:layout_alignLeft="@android:id/title" + android:layout_alignStart="@android:id/title" android:paddingBottom="3dip" android:visibility="gone" android:textAppearance="?android:attr/textAppearanceSmall" @@ -84,8 +84,8 @@ android:id="@+id/profiles_settings" android:layout_width="wrap_content" android:layout_height="match_parent" - android:paddingLeft="15dip" - android:paddingRight="?android:attr/scrollbarSize" + android:paddingStart="15dip" + android:paddingEnd="?android:attr/scrollbarSize" android:src="@drawable/ic_sysbar_quicksettings" android:contentDescription="@string/input_method_settings_button" android:layout_gravity="center" diff --git a/res/layout/preference_streamvolume.xml b/res/layout/preference_streamvolume.xml index 4e62a34..f84ba6b 100644 --- a/res/layout/preference_streamvolume.xml +++ b/res/layout/preference_streamvolume.xml @@ -27,8 +27,8 @@ android:gravity="center_vertical" android:clickable="true" android:focusable="true" - android:paddingLeft="@*android:dimen/preference_item_padding_side" - android:paddingRight="@*android:dimen/preference_item_padding_inner" + android:paddingStart="@*android:dimen/preference_item_padding_side" + android:paddingEnd="@*android:dimen/preference_item_padding_inner" android:background="?android:attr/selectableItemBackground"> <RelativeLayout @@ -36,7 +36,7 @@ android:layout_height="match_parent" android:paddingTop="6dip" android:paddingBottom="6dip" - android:paddingLeft="@*android:dimen/preference_icon_minWidth" > + android:paddingStart="@*android:dimen/preference_icon_minWidth" > <TextView android:id="@+android:id/title" android:layout_width="wrap_content" @@ -50,7 +50,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@android:id/title" - android:layout_alignLeft="@android:id/title" + android:layout_alignStart="@android:id/title" android:textAppearance="?android:attr/textAppearanceSmall" android:textColor="?android:attr/textColorSecondary" android:maxLines="2" /> diff --git a/res/layout/preference_time_range.xml b/res/layout/preference_time_range.xml index ae809b8..52117d8 100644 --- a/res/layout/preference_time_range.xml +++ b/res/layout/preference_time_range.xml @@ -20,7 +20,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingLeft="16dip" + android:paddingStart="16dip" android:paddingTop="6dip" android:text="@string/start_time_title" android:focusable="false" @@ -59,7 +59,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingLeft="16dip" + android:paddingStart="16dip" android:paddingTop="6dip" android:text="@string/end_time_title" android:focusable="false" diff --git a/res/layout/pulse_time_item.xml b/res/layout/pulse_time_item.xml index 9404ed3..9052caf 100644 --- a/res/layout/pulse_time_item.xml +++ b/res/layout/pulse_time_item.xml @@ -2,10 +2,10 @@ <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/textViewName" - android:paddingLeft="4dp" - android:paddingRight="4dp" + android:paddingStart="4dp" + android:paddingEnd="4dp" android:paddingTop="8dp" android:paddingBottom="8dp" android:textAppearance="?android:attr/textAppearanceMedium" > -</TextView>
\ No newline at end of file +</TextView> diff --git a/res/layout/qs_tile.xml b/res/layout/qs_tile.xml index 7cfc43b..9ea88e3 100644 --- a/res/layout/qs_tile.xml +++ b/res/layout/qs_tile.xml @@ -9,8 +9,8 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" - android:paddingLeft="6dp" - android:paddingRight="6dp" + android:paddingStart="6dp" + android:paddingEnd="6dp" android:paddingBottom="2dp" android:drawablePadding="12dp" android:textSize="12dp" diff --git a/res/layout/vpn_lockdown_editor.xml b/res/layout/vpn_lockdown_editor.xml index 933c5ec..8190018 100644 --- a/res/layout/vpn_lockdown_editor.xml +++ b/res/layout/vpn_lockdown_editor.xml @@ -22,8 +22,8 @@ <TextView android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingLeft="16dip" - android:paddingRight="16dip" + android:paddingStart="16dip" + android:paddingEnd="16dip" android:paddingTop="8dip" android:paddingBottom="8dip" android:textAppearance="?android:attr/textAppearanceMedium" diff --git a/src/com/android/settings/AccessibilitySettings.java b/src/com/android/settings/AccessibilitySettings.java index b7e7c42..dd382e0 100644 --- a/src/com/android/settings/AccessibilitySettings.java +++ b/src/com/android/settings/AccessibilitySettings.java @@ -1057,7 +1057,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements ToggleSwitch toggleSwitch = new ToggleSwitch(activity); final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - toggleSwitch.setPadding(0, 0, padding, 0); + toggleSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(toggleSwitch, diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java index c45c0b2..563e3bf 100644 --- a/src/com/android/settings/DevelopmentSettings.java +++ b/src/com/android/settings/DevelopmentSettings.java @@ -350,7 +350,7 @@ public class DevelopmentSettings extends PreferenceFragment final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - mEnabledSwitch.setPadding(0, 0, padding, 0); + mEnabledSwitch.setPaddingRelative(0, 0, padding, 0); mEnabledSwitch.setOnCheckedChangeListener(this); } diff --git a/src/com/android/settings/DreamSettings.java b/src/com/android/settings/DreamSettings.java index 32328d9..6107954 100644 --- a/src/com/android/settings/DreamSettings.java +++ b/src/com/android/settings/DreamSettings.java @@ -99,7 +99,7 @@ public class DreamSettings extends SettingsPreferenceFragment { final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - mSwitch.setPadding(0, 0, padding, 0); + mSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(mSwitch, new ActionBar.LayoutParams( diff --git a/src/com/android/settings/applications/LinearColorBar.java b/src/com/android/settings/applications/LinearColorBar.java index 74fb02e..65d5815 100644 --- a/src/com/android/settings/applications/LinearColorBar.java +++ b/src/com/android/settings/applications/LinearColorBar.java @@ -101,11 +101,11 @@ public class LinearColorBar extends LinearLayout { int indicatorLeft, indicatorRight; if (mShowingGreen) { - indicatorLeft = right2; - indicatorRight = right3; + indicatorLeft = (isLayoutRtl() ? width - right3 : right2); + indicatorRight = (isLayoutRtl() ? width - right2 : right3); } else { - indicatorLeft = right; - indicatorRight = right2; + indicatorLeft = (isLayoutRtl() ? width - right2 : right); + indicatorRight = (isLayoutRtl() ? width - right : right2); } if (mLastInterestingLeft != indicatorLeft || mLastInterestingRight != indicatorRight) { @@ -144,8 +144,8 @@ public class LinearColorBar extends LinearLayout { } if (left < right) { - mRect.left = left; - mRect.right = right; + mRect.left = (isLayoutRtl() ? width-right+left : left); + mRect.right = (isLayoutRtl() ? width : right); mPaint.setColor(LEFT_COLOR); canvas.drawRect(mRect, mPaint); width -= (right-left); @@ -155,8 +155,8 @@ public class LinearColorBar extends LinearLayout { right = right2; if (left < right) { - mRect.left = left; - mRect.right = right; + mRect.left = (isLayoutRtl() ? width-right+left : left); + mRect.right = (isLayoutRtl() ? width : right); mPaint.setColor(MIDDLE_COLOR); canvas.drawRect(mRect, mPaint); width -= (right-left); @@ -166,10 +166,10 @@ public class LinearColorBar extends LinearLayout { right = left + width; if (left < right) { - mRect.left = left; - mRect.right = right; + mRect.left = (isLayoutRtl() ? width-right+left : left); + mRect.right = (isLayoutRtl() ? width : right); mPaint.setColor(RIGHT_COLOR); canvas.drawRect(mRect, mPaint); } } -}
\ No newline at end of file +} diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index 532b5ee..95222c3 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -77,6 +77,7 @@ import com.android.settings.deviceinfo.StorageMeasurement; import com.android.settings.Utils; import java.util.ArrayList; +import java.util.Collections; import java.util.Comparator; import java.util.List; @@ -243,6 +244,7 @@ public class ManageApplications extends Fragment implements mRootView = inflater.inflate(mListType == LIST_TYPE_RUNNING ? R.layout.manage_applications_running : R.layout.manage_applications_apps, null); + mRootView.setLayoutDirection(mRootView.getResources().getConfiguration().getLayoutDirection()); mLoadingContainer = mRootView.findViewById(R.id.loading_container); mLoadingContainer.setVisibility(View.VISIBLE); mListContainer = mRootView.findViewById(R.id.list_container); @@ -878,6 +880,7 @@ public class ManageApplications extends Fragment implements @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + container.setLayoutDirection(container.getResources().getConfiguration().getLayoutDirection()); // initialize the inflater mInflater = inflater; @@ -904,6 +907,10 @@ public class ManageApplications extends Fragment implements } if (savedInstanceState == null) { + //Reverse the tab list once if the language is RTL. + if(container.isLayoutRtl()){ + Collections.reverse(mTabs); + } // First time init: make sure view pager is showing the correct tab. for (int i = 0; i < mTabs.size(); i++) { TabInfo tab = mTabs.get(i); diff --git a/src/com/android/settings/bluetooth/BluetoothSettings.java b/src/com/android/settings/bluetooth/BluetoothSettings.java index e9ba39d..c0bfd32 100755 --- a/src/com/android/settings/bluetooth/BluetoothSettings.java +++ b/src/com/android/settings/bluetooth/BluetoothSettings.java @@ -119,7 +119,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment { if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - actionBarSwitch.setPadding(0, 0, padding, 0); + actionBarSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(actionBarSwitch, new ActionBar.LayoutParams( diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java index 032681a..833711a 100644 --- a/src/com/android/settings/nfc/AndroidBeam.java +++ b/src/com/android/settings/nfc/AndroidBeam.java @@ -52,7 +52,7 @@ public class AndroidBeam extends Fragment PreferenceActivity preferenceActivity = (PreferenceActivity) activity; final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - mActionBarSwitch.setPadding(0, 0, padding, 0); + mActionBarSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(mActionBarSwitch, new ActionBar.LayoutParams( diff --git a/src/com/android/settings/profiles/ProfilesSettings.java b/src/com/android/settings/profiles/ProfilesSettings.java index d6769e1..b98724e 100644 --- a/src/com/android/settings/profiles/ProfilesSettings.java +++ b/src/com/android/settings/profiles/ProfilesSettings.java @@ -113,13 +113,13 @@ public class ProfilesSettings extends SettingsPreferenceFragment { if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - mActionBarSwitch.setPadding(0, 0, padding, 0); + mActionBarSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(mActionBarSwitch, new ActionBar.LayoutParams( ActionBar.LayoutParams.WRAP_CONTENT, ActionBar.LayoutParams.WRAP_CONTENT, - Gravity.CENTER_VERTICAL | Gravity.RIGHT)); + Gravity.CENTER_VERTICAL | Gravity.END)); } } diff --git a/src/com/android/settings/wfd/WifiDisplaySettings.java b/src/com/android/settings/wfd/WifiDisplaySettings.java index 36e97f8..9aaf1f1 100755 --- a/src/com/android/settings/wfd/WifiDisplaySettings.java +++ b/src/com/android/settings/wfd/WifiDisplaySettings.java @@ -103,7 +103,7 @@ public final class WifiDisplaySettings extends SettingsPreferenceFragment { if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - mActionBarSwitch.setPadding(0, 0, padding, 0); + mActionBarSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(mActionBarSwitch, diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java index aedb79e..a481b08 100644 --- a/src/com/android/settings/wifi/WifiSettings.java +++ b/src/com/android/settings/wifi/WifiSettings.java @@ -382,7 +382,7 @@ public class WifiSettings extends SettingsPreferenceFragment if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) { final int padding = activity.getResources().getDimensionPixelSize( R.dimen.action_bar_switch_padding); - actionBarSwitch.setPadding(0, 0, padding, 0); + actionBarSwitch.setPaddingRelative(0, 0, padding, 0); activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM, ActionBar.DISPLAY_SHOW_CUSTOM); activity.getActionBar().setCustomView(actionBarSwitch, new ActionBar.LayoutParams( |