diff options
-rw-r--r-- | res/values/cm_strings.xml | 2 | ||||
-rw-r--r-- | res/xml/lockscreen_interface_settings.xml | 12 | ||||
-rw-r--r-- | src/com/android/settings/cyanogenmod/LockscreenInterface.java | 13 |
3 files changed, 24 insertions, 3 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 1769df4..9a8b07f 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -183,6 +183,8 @@ <string name="lockscreen_battery_status_title">Battery status</string> <string name="lockscreen_battery_status_charging">Only when charging</string> <string name="lockscreen_battery_status_alwayson">Always on</string> + <string name="lockscreen_music_controls_title">Music controls</string> + <string name="lockscreen_music_controls_summary">Show player controls while music is playing</string> <!-- Profiles settings --> <string name="profiles_settings_title">Profiles</string> diff --git a/res/xml/lockscreen_interface_settings.xml b/res/xml/lockscreen_interface_settings.xml index a2d4fa0..333824f 100644 --- a/res/xml/lockscreen_interface_settings.xml +++ b/res/xml/lockscreen_interface_settings.xml @@ -52,19 +52,25 @@ android:targetClass="com.cyanogenmod.lockclock.preference.Preferences" /> </PreferenceScreen> - <CheckBoxPreference + <CheckBoxPreference android:key="lockscreen_maximize_widgets" android:persistent="false" android:title="@string/lockscreen_maximize_widgets_title" android:summary="@string/lockscreen_maximize_widgets_summary" /> - <Preference + <CheckBoxPreference + android:key="lockscreen_music_controls" + android:persistent="false" + android:title="@string/lockscreen_music_controls_title" + android:summary="@string/lockscreen_music_controls_summary" /> + + <Preference android:fragment="com.android.settings.cyanogenmod.LockscreenTargets" android:key="lockscreen_targets" android:summary="@string/lockscreen_target_summary" android:title="@string/lockscreen_target_title" /> - <PreferenceScreen + <PreferenceScreen android:fragment="com.android.settings.cyanogenmod.LockscreenButtons" android:key="lockscreen_buttons" android:title="@string/lockscreen_buttons_title" diff --git a/src/com/android/settings/cyanogenmod/LockscreenInterface.java b/src/com/android/settings/cyanogenmod/LockscreenInterface.java index 740182e..37d56e8 100644 --- a/src/com/android/settings/cyanogenmod/LockscreenInterface.java +++ b/src/com/android/settings/cyanogenmod/LockscreenInterface.java @@ -60,12 +60,14 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements private static final String KEY_LOCKSCREEN_BUTTONS = "lockscreen_buttons"; private static final String KEY_LOCK_CLOCK = "lock_clock"; private static final String KEY_LOCKSCREEN_MAXIMIZE_WIDGETS = "lockscreen_maximize_widgets"; + private static final String KEY_LOCKSCREEN_MUSIC_CONTROLS = "lockscreen_music_controls"; private static final String KEY_BACKGROUND = "lockscreen_background"; private static final String KEY_SCREEN_SECURITY = "screen_security"; private ListPreference mCustomBackground; private ListPreference mBatteryStatus; private CheckBoxPreference mMaximizeWidgets; + private CheckBoxPreference mMusicControls; private File mWallpaperImage; private File mWallpaperTemporary; @@ -99,6 +101,9 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements mMaximizeWidgets.setOnPreferenceChangeListener(this); } + mMusicControls = (CheckBoxPreference) findPreference(KEY_LOCKSCREEN_MUSIC_CONTROLS); + mMusicControls.setOnPreferenceChangeListener(this); + PreferenceScreen lockscreenButtons = (PreferenceScreen) findPreference(KEY_LOCKSCREEN_BUTTONS); if (!hasButtons()) { getPreferenceScreen().removePreference(lockscreenButtons); @@ -158,6 +163,10 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements mMaximizeWidgets.setChecked(Settings.System.getInt(cr, Settings.System.LOCKSCREEN_MAXIMIZE_WIDGETS, 0) == 1); } + if (mMusicControls != null) { + mMusicControls.setChecked(Settings.System.getInt(cr, + Settings.System.LOCKSCREEN_MUSIC_CONTROLS, 1) == 1); + } } } @@ -200,6 +209,10 @@ public class LockscreenInterface extends SettingsPreferenceFragment implements boolean value = (Boolean) objValue; Settings.System.putInt(cr, Settings.System.LOCKSCREEN_MAXIMIZE_WIDGETS, value ? 1 : 0); return true; + } else if (preference == mMusicControls) { + boolean value = (Boolean) objValue; + Settings.System.putInt(cr, Settings.System.LOCKSCREEN_MUSIC_CONTROLS, value ? 1 : 0); + return true; } else if (preference == mCustomBackground) { int selection = mCustomBackground.findIndexOfValue(objValue.toString()); return handleBackgroundSelection(selection); |