diff --git a/app/src/main/res/values/settings_defaults.xml b/app/src/main/res/values/settings_defaults.xml index 7734d39..0bcdfd5 100644 --- a/app/src/main/res/values/settings_defaults.xml +++ b/app/src/main/res/values/settings_defaults.xml @@ -2,6 +2,8 @@ 15 + + true 1000000 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index da549a7..01ed81b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -66,6 +66,9 @@ Scan Interval (seconds) + + Notification Sounds + Maximum Number of Connections diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index acc5399..e04724c 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -13,6 +13,11 @@ android:inputType="number" android:numeric="integer" /> + + } + /** + * Returns the default notification options that should be used. + */ + def defaults(): Int = { + val sp = PreferenceManager.getDefaultSharedPreferences(context) + val defaultSounds = context.getResources.getBoolean(R.bool.default_notification_sounds) + if (sp.getBoolean("notification_sounds", defaultSounds)) + Notification.DEFAULT_ALL + else + Notification.DEFAULT_VIBRATE | Notification.DEFAULT_LIGHTS + } + }