diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt index c8b3333ca..3e7b3efe0 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/activities/SettingsActivity.kt @@ -10,6 +10,7 @@ import com.simplemobiletools.calendar.extensions.hideKeyboard import com.simplemobiletools.calendar.extensions.showKeyboard import com.simplemobiletools.calendar.extensions.value import com.simplemobiletools.calendar.helpers.* +import com.simplemobiletools.filepicker.extensions.getFilenameFromPath import com.simplemobiletools.filepicker.extensions.toast import kotlinx.android.synthetic.main.activity_settings.* @@ -22,6 +23,7 @@ class SettingsActivity : SimpleActivity() { setupSundayFirst() setupWeekNumbers() setupVibrate() + setupReminderSound() setupEventReminder() } @@ -50,6 +52,13 @@ class SettingsActivity : SimpleActivity() { } } + private fun setupReminderSound() { + settings_reminder_sound.text = mConfig.reminderSound.getFilenameFromPath() + settings_reminder_sound_holder.setOnClickListener { + + } + } + private fun setupVibrate() { settings_vibrate.isChecked = mConfig.vibrateOnReminder settings_vibrate_holder.setOnClickListener { diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt index eb511dea5..e9f361d84 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Config.kt @@ -2,6 +2,7 @@ package com.simplemobiletools.calendar.helpers import android.content.Context import android.content.SharedPreferences +import android.media.RingtoneManager import java.util.* class Config(context: Context) { @@ -38,6 +39,10 @@ class Config(context: Context) { get() = mPrefs.getBoolean(VIBRATE, false) set(vibrate) = mPrefs.edit().putBoolean(VIBRATE, vibrate).apply() + var reminderSound: String + get() = mPrefs.getString(REMINDER_SOUND, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION).toString()) + set(path) = mPrefs.edit().putString(REMINDER_SOUND, path).apply() + var storedView: Int get() = mPrefs.getInt(VIEW, MONTHLY_VIEW) set(view) = mPrefs.edit().putInt(VIEW, view).apply() diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt index e0aa0f9b4..74ad07089 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/Constants.kt @@ -34,6 +34,7 @@ val IS_DARK_THEME = "is_dark_theme" val SUNDAY_FIRST = "sunday_first" val WEEK_NUMBERS = "week_numbers" val VIBRATE = "vibrate" +val REMINDER_SOUND = "reminder_sound" val VIEW = "view" val REMINDER_TYPE = "reminder_type" val REMINDER_MINUTES = "reminder_minutes" diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 26ac09c36..c06f524d5 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -123,6 +123,36 @@ + + + + + + + + + android:paddingTop="@dimen/tiny_margin"> diff --git a/app/src/main/res/layout/event_list_section_widget.xml b/app/src/main/res/layout/event_list_section_widget.xml index 73129ab21..5a1d657c7 100644 --- a/app/src/main/res/layout/event_list_section_widget.xml +++ b/app/src/main/res/layout/event_list_section_widget.xml @@ -6,6 +6,6 @@ android:layout_height="wrap_content" android:drawablePadding="1dp" android:drawableTop="@drawable/divider" - android:paddingTop="@dimen/small_padding" + android:paddingTop="@dimen/tiny_margin" android:textSize="@dimen/normal_text_size" android:textStyle="bold"/> diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 9e75c0400..1f993d3d9 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -71,6 +71,7 @@ Sonntag als erster Wochentag Zeige Kalenderwoche an Vibrate on reminder notification + Reminder sound Standard Termin Erinnerung Erinnerung gespeichert diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index a35a44423..448ce1953 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -71,6 +71,7 @@ Domingo como primer día Mostrar los números de la semana Vibrate on reminder notification + Reminder sound Recordatorio predeterminado de un evento Recordatorio guardado diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml index f0d6d5c69..e476c641b 100644 --- a/app/src/main/res/values-hi-rIN/strings.xml +++ b/app/src/main/res/values-hi-rIN/strings.xml @@ -71,6 +71,7 @@ रविवार पहला दिन हैं सफ्ताह क्रमांक दिखाए Vibrate on reminder notification + Reminder sound Default event reminder Reminder saved diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 09ef135bb..e55641e21 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -71,6 +71,7 @@ Vasárnap a hét első napja Hetek sorszámának mutatása Emlékeztetőnél rezgés + Reminder sound Alapértelmezett emlékeztetés Emlékeztető elmentve diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 656cd8b11..ef187558d 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -71,6 +71,7 @@ Sunday as first day Display week numbers Vibrate on reminder notification + Reminder sound Default event reminder Reminder saved diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 95904949f..3ad937cae 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -71,6 +71,7 @@ 日曜日が最初 週番号を表示 リマインダー通知で振動 + Reminder sound デフォルトのイベント リマインダー リマインダーを保存しました diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 013130c68..908835446 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -71,6 +71,7 @@ Domingo como primeiro dia Mostrar número das semanas Vibrar ao notificar sobre o lembrete + Reminder sound Lembrete padrão Lembrete guardado diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index 3c62f4901..49025daf6 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -71,6 +71,7 @@ Sunday as first day Display week numbers Vibrate on reminder notification + Reminder sound Default event reminder Reminder saved diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index b86532aa8..43de6a3f3 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -1,7 +1,7 @@ 16dp 24dp - 4dp + 4dp 8dp 8dp 40dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c1cc05c2e..a9ff545df 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -72,6 +72,7 @@ Sunday as first day Display week numbers Vibrate on reminder notification + Reminder sound Default event reminder Reminder saved