diff options
Diffstat (limited to 'src/com/android/settings')
10 files changed, 27 insertions, 20 deletions
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( |