settings: add option to force-reload the app

Add an option to force-reload the app.

Currently, Auxio will load music once and then never re-load it. This
is a really decision I made early on and now regret completely. The
only way to remedy this properly is to create an automatic rescanning
system, but that is a major technical undertaking that I want to save
for later.

Resolves #71.
This commit is contained in:
OxygenCobalt
2022-02-05 10:30:03 -07:00
parent 0a216def1b
commit b047b50411
5 changed files with 25 additions and 0 deletions
@@ -37,6 +37,7 @@ import org.oxycblt.auxio.home.tabs.TabCustomizeDialog
import org.oxycblt.auxio.playback.PlaybackViewModel
import org.oxycblt.auxio.settings.pref.IntListPrefDialog
import org.oxycblt.auxio.settings.pref.IntListPreference
import org.oxycblt.auxio.util.hardRestart
import org.oxycblt.auxio.util.isNight
import org.oxycblt.auxio.util.logD
import org.oxycblt.auxio.util.showToast
@@ -165,6 +166,16 @@ class SettingsListFragment : PreferenceFragmentCompat() {
}
}
SettingsManager.KEY_RELOAD -> {
onPreferenceClickListener = Preference.OnPreferenceClickListener {
playbackModel.savePlaybackState(requireContext()) {
requireContext().hardRestart()
}
true
}
}
SettingsManager.KEY_EXCLUDED -> {
onPreferenceClickListener = Preference.OnPreferenceClickListener {
ExcludedDialog().show(childFragmentManager, ExcludedDialog.TAG)
@@ -291,6 +291,7 @@ class SettingsManager private constructor(context: Context) :
const val KEY_LOOP_PAUSE = "KEY_LOOP_PAUSE"
const val KEY_SAVE_STATE = "auxio_save_state"
const val KEY_RELOAD = "auxio_reload"
const val KEY_EXCLUDED = "auxio_excluded_dirs"
const val KEY_SEARCH_FILTER_MODE = "KEY_SEARCH_FILTER"
+2
View File
@@ -103,6 +103,8 @@
<string name="set_content">Content</string>
<string name="set_save">Save playback state</string>
<string name="set_save_desc">Save the current playback state now</string>
<string name="set_reload">Reload music</string>
<string name="set_reload_desc">Reload the music library (Will restart app)</string>
<string name="set_excluded">Excluded folders</string>
<string name="set_excluded_desc">The content of excluded folders is hidden from your library</string>
+6
View File
@@ -151,6 +151,12 @@
app:summary="@string/set_save_desc"
app:title="@string/set_save" />
<Preference
app:iconSpaceReserved="false"
app:key="auxio_reload"
app:summary="@string/set_reload_desc"
app:title="@string/set_reload" />
<Preference
app:iconSpaceReserved="false"
app:key="auxio_excluded_dirs"