From ad4e9c53c3f1ec0a6357344c6c389a42a15936f9 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 8 Mar 2018 17:03:48 +0100 Subject: [PATCH] adding a config item for vibrating on button press --- build.gradle | 2 +- .../com/simplemobiletools/commons/helpers/BaseConfig.kt | 4 ++++ .../kotlin/com/simplemobiletools/commons/helpers/Constants.kt | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 9fde2d98c..2caa31822 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 - propVersionName = '3.15.8' + propVersionName = '3.15.9' kotlin_version = '1.2.30' support_libs = '27.1.0' } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt index 3f2c6be24..0ff5ad75b 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/BaseConfig.kt @@ -207,4 +207,8 @@ open class BaseConfig(val context: Context) { var snoozeTime: Int get() = prefs.getInt(SNOOZE_TIME, 10) set(snoozeDelay) = prefs.edit().putInt(SNOOZE_TIME, snoozeDelay).apply() + + var vibrateOnButtonPress: Boolean + get() = prefs.getBoolean(VIBRATE_ON_BUTTON_PRESS, true) + set(vibrateOnButton) = prefs.edit().putBoolean(VIBRATE_ON_BUTTON_PRESS, vibrateOnButton).apply() } diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt index e22de4443..837a53193 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/helpers/Constants.kt @@ -66,6 +66,7 @@ const val WAS_ALARM_WARNING_SHOWN = "was_alarm_warning_shown" const val WAS_REMINDER_WARNING_SHOWN = "was_reminder_warning_shown" const val USE_SAME_SNOOZE = "use_same_snooze" const val SNOOZE_TIME = "snooze_delay" +const val VIBRATE_ON_BUTTON_PRESS = "vibrate_on_button_press" // licenses internal const val LICENSE_KOTLIN = 1