mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 18:03:33 +00:00
feat: Implemented continuous playing
This commit is contained in:
parent
2c3aebc83b
commit
176db09662
9 changed files with 101 additions and 44 deletions
|
|
@ -62,6 +62,8 @@ object Preferences {
|
|||
private const val HOME_SECTOR_LIST = "home_sector_list"
|
||||
private const val RATING_PER_ITEM = "rating_per_item"
|
||||
private const val NEXT_UPDATE_CHECK = "next_update_check"
|
||||
private const val CONTINUOUS_PLAY = "continuous_play"
|
||||
private const val LAST_INSTANT_MIX = "last_instant_mix"
|
||||
|
||||
|
||||
@JvmStatic
|
||||
|
|
@ -476,4 +478,21 @@ object Preferences {
|
|||
fun setTempoUpdateReminder() {
|
||||
App.getInstance().preferences.edit().putLong(NEXT_UPDATE_CHECK, System.currentTimeMillis()).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isContinuousPlayEnabled(): Boolean {
|
||||
return App.getInstance().preferences.getBoolean(CONTINUOUS_PLAY, true)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setLastInstantMix() {
|
||||
App.getInstance().preferences.edit().putLong(LAST_INSTANT_MIX, System.currentTimeMillis()).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isInstantMixUsable(): Boolean {
|
||||
return App.getInstance().preferences.getLong(
|
||||
LAST_INSTANT_MIX, 0
|
||||
) + 5000 < System.currentTimeMillis()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue