Merge "Developer option to force RTL layout direction" into klp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
82f7c06448
@@ -4159,6 +4159,11 @@
|
|||||||
<!-- UI debug setting: show layout bounds information summary [CHAR LIMIT=50] -->
|
<!-- UI debug setting: show layout bounds information summary [CHAR LIMIT=50] -->
|
||||||
<string name="debug_layout_summary">Show clip bounds, margins, etc.</string>
|
<string name="debug_layout_summary">Show clip bounds, margins, etc.</string>
|
||||||
|
|
||||||
|
<!-- UI debug setting: force right to left layout [CHAR LIMIT=25] -->
|
||||||
|
<string name="force_rtl_layout_all_locales">Force RTL layout direction</string>
|
||||||
|
<!-- UI debug setting: force right to left layout summary [CHAR LIMIT=50] -->
|
||||||
|
<string name="force_rtl_layout_all_locales_summary">Force screen layout direction to RTL for all locales</string>
|
||||||
|
|
||||||
<!-- UI debug setting: show how CPU is being used? [CHAR LIMIT=25] -->
|
<!-- UI debug setting: show how CPU is being used? [CHAR LIMIT=25] -->
|
||||||
<string name="show_cpu_usage">Show CPU usage</string>
|
<string name="show_cpu_usage">Show CPU usage</string>
|
||||||
<!-- UI debug setting: show cpu usage summary [CHAR LIMIT=50] -->
|
<!-- UI debug setting: show cpu usage summary [CHAR LIMIT=50] -->
|
||||||
|
@@ -130,6 +130,11 @@
|
|||||||
android:title="@string/debug_layout"
|
android:title="@string/debug_layout"
|
||||||
android:summary="@string/debug_layout_summary"/>
|
android:summary="@string/debug_layout_summary"/>
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="force_rtl_layout_all_locales"
|
||||||
|
android:title="@string/force_rtl_layout_all_locales"
|
||||||
|
android:summary="@string/force_rtl_layout_all_locales_summary"/>
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="window_animation_scale"
|
android:key="window_animation_scale"
|
||||||
android:title="@string/window_animation_scale_title"
|
android:title="@string/window_animation_scale_title"
|
||||||
|
@@ -74,6 +74,7 @@ import java.io.File;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Displays preferences for application developers.
|
* Displays preferences for application developers.
|
||||||
@@ -128,6 +129,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
private static final String SHOW_HW_LAYERS_UPDATES_KEY = "show_hw_layers_udpates";
|
private static final String SHOW_HW_LAYERS_UPDATES_KEY = "show_hw_layers_udpates";
|
||||||
private static final String DEBUG_HW_OVERDRAW_KEY = "debug_hw_overdraw";
|
private static final String DEBUG_HW_OVERDRAW_KEY = "debug_hw_overdraw";
|
||||||
private static final String DEBUG_LAYOUT_KEY = "debug_layout";
|
private static final String DEBUG_LAYOUT_KEY = "debug_layout";
|
||||||
|
private static final String FORCE_RTL_LAYOUT_KEY = "force_rtl_layout_all_locales";
|
||||||
private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale";
|
private static final String WINDOW_ANIMATION_SCALE_KEY = "window_animation_scale";
|
||||||
private static final String TRANSITION_ANIMATION_SCALE_KEY = "transition_animation_scale";
|
private static final String TRANSITION_ANIMATION_SCALE_KEY = "transition_animation_scale";
|
||||||
private static final String ANIMATOR_DURATION_SCALE_KEY = "animator_duration_scale";
|
private static final String ANIMATOR_DURATION_SCALE_KEY = "animator_duration_scale";
|
||||||
@@ -189,6 +191,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
private CheckBoxPreference mShowHwScreenUpdates;
|
private CheckBoxPreference mShowHwScreenUpdates;
|
||||||
private CheckBoxPreference mShowHwLayersUpdates;
|
private CheckBoxPreference mShowHwLayersUpdates;
|
||||||
private CheckBoxPreference mDebugLayout;
|
private CheckBoxPreference mDebugLayout;
|
||||||
|
private CheckBoxPreference mForceRtlLayout;
|
||||||
private ListPreference mDebugHwOverdraw;
|
private ListPreference mDebugHwOverdraw;
|
||||||
private ListPreference mTrackFrameTime;
|
private ListPreference mTrackFrameTime;
|
||||||
private ListPreference mShowNonRectClip;
|
private ListPreference mShowNonRectClip;
|
||||||
@@ -302,6 +305,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
mShowHwScreenUpdates = findAndInitCheckboxPref(SHOW_HW_SCREEN_UPDATES_KEY);
|
mShowHwScreenUpdates = findAndInitCheckboxPref(SHOW_HW_SCREEN_UPDATES_KEY);
|
||||||
mShowHwLayersUpdates = findAndInitCheckboxPref(SHOW_HW_LAYERS_UPDATES_KEY);
|
mShowHwLayersUpdates = findAndInitCheckboxPref(SHOW_HW_LAYERS_UPDATES_KEY);
|
||||||
mDebugLayout = findAndInitCheckboxPref(DEBUG_LAYOUT_KEY);
|
mDebugLayout = findAndInitCheckboxPref(DEBUG_LAYOUT_KEY);
|
||||||
|
mForceRtlLayout = findAndInitCheckboxPref(FORCE_RTL_LAYOUT_KEY);
|
||||||
mDebugHwOverdraw = addListPreference(DEBUG_HW_OVERDRAW_KEY);
|
mDebugHwOverdraw = addListPreference(DEBUG_HW_OVERDRAW_KEY);
|
||||||
mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
|
mWindowAnimationScale = addListPreference(WINDOW_ANIMATION_SCALE_KEY);
|
||||||
mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY);
|
mTransitionAnimationScale = addListPreference(TRANSITION_ANIMATION_SCALE_KEY);
|
||||||
@@ -522,6 +526,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
updateExperimentalWebViewOptions();
|
updateExperimentalWebViewOptions();
|
||||||
updateVerifyAppsOverUsbOptions();
|
updateVerifyAppsOverUsbOptions();
|
||||||
updateBugreportOptions();
|
updateBugreportOptions();
|
||||||
|
updateForceRtlOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void resetDangerousOptions() {
|
private void resetDangerousOptions() {
|
||||||
@@ -958,6 +963,19 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
pokeSystemProperties();
|
pokeSystemProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateForceRtlOptions() {
|
||||||
|
updateCheckBox(mForceRtlLayout, Settings.Global.getInt(getActivity().getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_FORCE_RTL, 0) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void writeForceRtlOptions() {
|
||||||
|
boolean value = mForceRtlLayout.isChecked();
|
||||||
|
Settings.Global.putInt(getActivity().getContentResolver(),
|
||||||
|
Settings.Global.DEVELOPMENT_FORCE_RTL, value ? 1 : 0);
|
||||||
|
SystemProperties.set(Settings.Global.DEVELOPMENT_FORCE_RTL, value ? "1" : "0");
|
||||||
|
LocalePicker.updateLocale(getActivity().getResources().getConfiguration().locale);
|
||||||
|
}
|
||||||
|
|
||||||
private void updateCpuUsageOptions() {
|
private void updateCpuUsageOptions() {
|
||||||
updateCheckBox(mShowCpuUsage, Settings.Global.getInt(getActivity().getContentResolver(),
|
updateCheckBox(mShowCpuUsage, Settings.Global.getInt(getActivity().getContentResolver(),
|
||||||
Settings.Global.SHOW_PROCESSES, 0) != 0);
|
Settings.Global.SHOW_PROCESSES, 0) != 0);
|
||||||
@@ -1263,6 +1281,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
|
|||||||
writeShowHwLayersUpdatesOptions();
|
writeShowHwLayersUpdatesOptions();
|
||||||
} else if (preference == mDebugLayout) {
|
} else if (preference == mDebugLayout) {
|
||||||
writeDebugLayoutOptions();
|
writeDebugLayoutOptions();
|
||||||
|
} else if (preference == mForceRtlLayout) {
|
||||||
|
writeForceRtlOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user