adding a setting for increasing volume gradually

This commit is contained in:
tibbi
2018-07-06 23:27:54 +02:00
parent 8d611535f0
commit 12d9aecc28
4 changed files with 37 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class SettingsActivity : SimpleActivity() {
setupSnoozeTime()
setupVibrate()
setupTimerMaxReminder()
setupIncreaseVolumeGradually()
setupUseTextShadow()
setupCustomizeWidgetColors()
updateTextColors(settings_holder)
@ -152,6 +153,14 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupIncreaseVolumeGradually() {
settings_increase_volume_gradually.isChecked = config.increaseVolumeGradually
settings_increase_volume_gradually_holder.setOnClickListener {
settings_increase_volume_gradually.toggle()
config.increaseVolumeGradually = settings_increase_volume_gradually.isChecked
}
}
private fun setupUseTextShadow() {
settings_use_text_shadow.isChecked = config.useTextShadow
settings_use_text_shadow_holder.setOnClickListener {

View File

@ -50,4 +50,8 @@ class Config(context: Context) : BaseConfig(context) {
var useTextShadow: Boolean
get() = prefs.getBoolean(USE_TEXT_SHADOW, true)
set(useTextShadow) = prefs.edit().putBoolean(USE_TEXT_SHADOW, useTextShadow).apply()
var increaseVolumeGradually: Boolean
get() = prefs.getBoolean(INCREASE_VOLUME_GRADUALLY, true)
set(increaseVolumeGradually) = prefs.edit().putBoolean(INCREASE_VOLUME_GRADUALLY, increaseVolumeGradually).apply()
}

View File

@ -14,6 +14,7 @@ const val TIMER_SOUND_TITLE = "timer_sound_title"
const val TIMER_MAX_REMINDER_SECS = "timer_max_reminder_secs"
const val ALARM_MAX_REMINDER_SECS = "alarm_max_reminder_secs"
const val USE_TEXT_SHADOW = "use_text_shadow"
const val INCREASE_VOLUME_GRADUALLY = "increase_volume_gradually"
const val TABS_COUNT = 4
const val EDITED_TIME_ZONE_SEPARATOR = ":"