diff options
author | Michael Bestas <mikeioannina@gmail.com> | 2014-12-10 21:48:29 +0200 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-29 17:36:29 -0700 |
commit | d4ebf3a59930db25be8296c88b40c3ee4330768f (patch) | |
tree | 5b2b617d9243dbe4da9d431250bf589ccd7f561f | |
parent | f71d7438ea0b30fe08d0297b8bbb9ea68124348b (diff) | |
download | packages_apps_Settings-d4ebf3a59930db25be8296c88b40c3ee4330768f.zip packages_apps_Settings-d4ebf3a59930db25be8296c88b40c3ee4330768f.tar.gz packages_apps_Settings-d4ebf3a59930db25be8296c88b40c3ee4330768f.tar.bz2 |
Settings: Cleanup display settings code
Change-Id: Ib2a00bd7f7932ca6a75834e3cd5b4953d5b050de
-rw-r--r-- | res/xml/display_settings.xml | 14 | ||||
-rw-r--r-- | src/com/android/settings/DisplaySettings.java | 53 | ||||
-rw-r--r-- | src/com/android/settings/hardware/DisplayColor.java | 2 | ||||
-rw-r--r-- | src/com/android/settings/hardware/DisplayGamma.java | 2 | ||||
-rw-r--r-- | src/com/android/settings/hardware/VibratorIntensity.java | 2 |
5 files changed, 9 insertions, 64 deletions
diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml index 255348f..08875cf 100644 --- a/res/xml/display_settings.xml +++ b/res/xml/display_settings.xml @@ -50,9 +50,9 @@ android:fragment="com.android.settings.WallpaperTypeSettings" /> <PreferenceScreen - android:key="display_rotation" - android:fragment="com.android.settings.cyanogenmod.DisplayRotation" - android:title="@string/display_rotation_title" /> + android:key="display_rotation" + android:title="@string/display_rotation_title" + android:fragment="com.android.settings.cyanogenmod.DisplayRotation" /> <ListPreference android:key="screen_timeout" @@ -91,10 +91,6 @@ android:summary="@string/summary_font_size" android:dialogTitle="@string/dialog_title_font_size" /> - <com.android.settings.DropDownPreference - android:key="auto_rotate" - android:title="@string/display_auto_rotate_title" /> - <PreferenceScreen android:key="wifi_display" android:title="@string/wifi_display_settings_title" @@ -133,13 +129,13 @@ android:summary="@string/adaptive_backlight_summary" android:defaultValue="true" /> - <SwitchPreference + <SwitchPreference android:key="sunlight_enhancement" android:title="@string/sunlight_enhancement_title" android:summary="@string/sunlight_enhancement_summary" android:defaultValue="true" /> - <SwitchPreference + <SwitchPreference android:key="color_enhancement" android:title="@string/color_enhancement_title" android:summary="@string/color_enhancement_summary" diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java index 8645377..2f429da 100644 --- a/src/com/android/settings/DisplaySettings.java +++ b/src/com/android/settings/DisplaySettings.java @@ -62,14 +62,10 @@ import android.provider.Settings; import android.text.TextUtils; import android.util.Log; -import com.android.settings.DreamSettings; -import com.android.settings.Utils; -import com.android.settings.cyanogenmod.DisplayRotation; - import java.util.ArrayList; import java.util.List; - import com.android.settings.Utils; +import com.android.settings.cyanogenmod.DisplayRotation; import com.android.settings.hardware.DisplayColor; import com.android.settings.hardware.DisplayGamma; @@ -100,10 +96,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private static final String KEY_TAP_TO_WAKE = "double_tap_wake_gesture"; private static final String KEY_PROXIMITY_WAKE = "proximity_on_wake"; private static final String KEY_DISPLAY_ROTATION = "display_rotation"; - private static final String KEY_ADVANCED_DISPLAY_SETTINGS = "advanced_display_settings"; - private static final String CATEGORY_LIGHTS = "lights_prefs"; - private static final String KEY_NOTIFICATION_PULSE = "notification_pulse"; - private static final String KEY_BATTERY_LIGHT = "battery_light"; private static final String KEY_WAKE_WHEN_PLUGGED_OR_UNPLUGGED = "wake_when_plugged_or_unplugged"; private static final String CATEGORY_ADVANCED = "advanced_display_prefs"; @@ -113,8 +105,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements private static final int DLG_GLOBAL_CHANGE_WARNING = 1; private FontDialogPreference mFontSizePref; - private PreferenceScreen mNotificationPulse; - private PreferenceScreen mBatteryPulse; private PreferenceScreen mDisplayRotationPreference; private final Configuration mCurConfig = new Configuration(); @@ -239,44 +229,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements removePreference(KEY_TAP_TO_WAKE); } - if (RotationPolicy.isRotationLockToggleVisible(activity)) { - DropDownPreference rotatePreference = - (DropDownPreference) findPreference(KEY_AUTO_ROTATE); - rotatePreference.addItem(activity.getString(R.string.display_auto_rotate_rotate), - false); - int rotateLockedResourceId; - // The following block sets the string used when rotation is locked. - // If the device locks specifically to portrait or landscape (rather than current - // rotation), then we use a different string to include this information. - if (allowAllRotations(activity)) { - rotateLockedResourceId = R.string.display_auto_rotate_stay_in_current; - } else { - if (RotationPolicy.getRotationLockOrientation(activity) - == Configuration.ORIENTATION_PORTRAIT) { - rotateLockedResourceId = - R.string.display_auto_rotate_stay_in_portrait; - } else { - rotateLockedResourceId = - R.string.display_auto_rotate_stay_in_landscape; - } - } - rotatePreference.addItem(activity.getString(rotateLockedResourceId), true); - rotatePreference.setSelectedItem(RotationPolicy.isRotationLocked(activity) ? - 1 : 0); - rotatePreference.setCallback(new Callback() { - @Override - public boolean onItemSelected(int pos, Object value) { - final boolean locked = (Boolean) value; - MetricsLogger.action(getActivity(), MetricsLogger.ACTION_ROTATION_LOCK, - locked); - RotationPolicy.setRotationLock(activity, locked); - return true; - } - }); - } else { - removePreference(KEY_AUTO_ROTATE); - } - mNightModePreference = (ListPreference) findPreference(KEY_NIGHT_MODE); if (mNightModePreference != null) { final UiModeManager uiManager = (UiModeManager) getSystemService( @@ -781,9 +733,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements if (!Utils.isDozeAvailable(context)) { result.add(KEY_DOZE); } - if (!RotationPolicy.isRotationLockToggleVisible(context)) { - result.add(KEY_AUTO_ROTATE); - } if (!isTapToWakeAvailable(context.getResources())) { result.add(KEY_TAP_TO_WAKE); } diff --git a/src/com/android/settings/hardware/DisplayColor.java b/src/com/android/settings/hardware/DisplayColor.java index f9dd845..8441297 100644 --- a/src/com/android/settings/hardware/DisplayColor.java +++ b/src/com/android/settings/hardware/DisplayColor.java @@ -72,7 +72,7 @@ public class DisplayColor extends DialogPreference { @Override protected void onPrepareDialogBuilder(AlertDialog.Builder builder) { - builder.setNeutralButton(R.string.auto_brightness_reset_button, + builder.setNeutralButton(R.string.settings_reset_button, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/src/com/android/settings/hardware/DisplayGamma.java b/src/com/android/settings/hardware/DisplayGamma.java index 5ce0390..b2592ee 100644 --- a/src/com/android/settings/hardware/DisplayGamma.java +++ b/src/com/android/settings/hardware/DisplayGamma.java @@ -75,7 +75,7 @@ public class DisplayGamma extends DialogPreference { @Override protected void onPrepareDialogBuilder(AlertDialog.Builder builder) { - builder.setNeutralButton(R.string.auto_brightness_reset_button, + builder.setNeutralButton(R.string.settings_reset_button, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/src/com/android/settings/hardware/VibratorIntensity.java b/src/com/android/settings/hardware/VibratorIntensity.java index 346caa4..88f1298 100644 --- a/src/com/android/settings/hardware/VibratorIntensity.java +++ b/src/com/android/settings/hardware/VibratorIntensity.java @@ -63,7 +63,7 @@ public class VibratorIntensity extends DialogPreference implements @Override protected void onPrepareDialogBuilder(AlertDialog.Builder builder) { - builder.setNeutralButton(R.string.auto_brightness_reset_button, + builder.setNeutralButton(R.string.settings_reset_button, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { |