Added a sleep timer
This commit is contained in:
parent
b5f160dd89
commit
4d82b91465
25 changed files with 350 additions and 47 deletions
|
|
@ -44,6 +44,8 @@ public final class PreferenceUtils {
|
|||
public static final String GAPLESS_PLAYBACK = "gapless_playback";
|
||||
public static final String LAST_ADDED_CUTOFF_TIMESTAMP = "last_added_cutoff_timestamp";
|
||||
public static final String ALBUM_ART_ON_LOCKSCREEN = "album_art_on_lockscreen";
|
||||
public static final String LAST_SLEEP_TIMER_VALUE = "last_sleep_timer_value";
|
||||
public static final String NEXT_SLEEP_TIMER_ELAPSED_REALTIME = "next_sleep_timer_elapsed_real_time";
|
||||
|
||||
private static PreferenceUtils sInstance;
|
||||
|
||||
|
|
@ -285,7 +287,7 @@ public final class PreferenceUtils {
|
|||
return mPreferences.getInt(ALBUM_GRID_COLUMNS_LAND, 3);
|
||||
}
|
||||
|
||||
public long getLastAddedCutOff() {
|
||||
public long getLastAddedCutOffTimestamp() {
|
||||
return mPreferences.getLong(LAST_ADDED_CUTOFF_TIMESTAMP, 0L);
|
||||
}
|
||||
|
||||
|
|
@ -295,4 +297,24 @@ public final class PreferenceUtils {
|
|||
editor.putLong(LAST_ADDED_CUTOFF_TIMESTAMP, timestamp);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
public int getLastSleepTimerValue() {
|
||||
return mPreferences.getInt(LAST_SLEEP_TIMER_VALUE, 30);
|
||||
}
|
||||
|
||||
public void setLastSleepTimerValue(final int value) {
|
||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||
editor.putInt(LAST_SLEEP_TIMER_VALUE, value);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public long getNextSleepTimerElapsedRealTime() {
|
||||
return mPreferences.getLong(NEXT_SLEEP_TIMER_ELAPSED_REALTIME, -1);
|
||||
}
|
||||
|
||||
public void setNextSleepTimerElapsedRealtime(final long value) {
|
||||
final SharedPreferences.Editor editor = mPreferences.edit();
|
||||
editor.putLong(NEXT_SLEEP_TIMER_ELAPSED_REALTIME, value);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue