mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-03-10 00:20:04 +01:00
adding a setting for increasing volume gradually
This commit is contained in:
parent
8d611535f0
commit
12d9aecc28
@ -34,6 +34,7 @@ class SettingsActivity : SimpleActivity() {
|
|||||||
setupSnoozeTime()
|
setupSnoozeTime()
|
||||||
setupVibrate()
|
setupVibrate()
|
||||||
setupTimerMaxReminder()
|
setupTimerMaxReminder()
|
||||||
|
setupIncreaseVolumeGradually()
|
||||||
setupUseTextShadow()
|
setupUseTextShadow()
|
||||||
setupCustomizeWidgetColors()
|
setupCustomizeWidgetColors()
|
||||||
updateTextColors(settings_holder)
|
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() {
|
private fun setupUseTextShadow() {
|
||||||
settings_use_text_shadow.isChecked = config.useTextShadow
|
settings_use_text_shadow.isChecked = config.useTextShadow
|
||||||
settings_use_text_shadow_holder.setOnClickListener {
|
settings_use_text_shadow_holder.setOnClickListener {
|
||||||
|
@ -50,4 +50,8 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
var useTextShadow: Boolean
|
var useTextShadow: Boolean
|
||||||
get() = prefs.getBoolean(USE_TEXT_SHADOW, true)
|
get() = prefs.getBoolean(USE_TEXT_SHADOW, true)
|
||||||
set(useTextShadow) = prefs.edit().putBoolean(USE_TEXT_SHADOW, useTextShadow).apply()
|
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()
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ const val TIMER_SOUND_TITLE = "timer_sound_title"
|
|||||||
const val TIMER_MAX_REMINDER_SECS = "timer_max_reminder_secs"
|
const val TIMER_MAX_REMINDER_SECS = "timer_max_reminder_secs"
|
||||||
const val ALARM_MAX_REMINDER_SECS = "alarm_max_reminder_secs"
|
const val ALARM_MAX_REMINDER_SECS = "alarm_max_reminder_secs"
|
||||||
const val USE_TEXT_SHADOW = "use_text_shadow"
|
const val USE_TEXT_SHADOW = "use_text_shadow"
|
||||||
|
const val INCREASE_VOLUME_GRADUALLY = "increase_volume_gradually"
|
||||||
|
|
||||||
const val TABS_COUNT = 4
|
const val TABS_COUNT = 4
|
||||||
const val EDITED_TIME_ZONE_SEPARATOR = ":"
|
const val EDITED_TIME_ZONE_SEPARATOR = ":"
|
||||||
|
@ -242,6 +242,29 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/settings_increase_volume_gradually_holder"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/medium_margin"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingBottom="@dimen/activity_margin"
|
||||||
|
android:paddingLeft="@dimen/normal_margin"
|
||||||
|
android:paddingRight="@dimen/normal_margin"
|
||||||
|
android:paddingTop="@dimen/activity_margin">
|
||||||
|
|
||||||
|
<com.simplemobiletools.commons.views.MySwitchCompat
|
||||||
|
android:id="@+id/settings_increase_volume_gradually"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:paddingLeft="@dimen/medium_margin"
|
||||||
|
android:paddingStart="@dimen/medium_margin"
|
||||||
|
android:text="@string/increase_volume_gradually"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/settings_use_same_snooze_holder"
|
android:id="@+id/settings_use_same_snooze_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user