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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user