Renamed keep history to pause history

This commit is contained in:
Omar 2022-03-08 18:05:06 +02:00
parent 9b59c5299a
commit ebe90262cb
6 changed files with 15 additions and 15 deletions

View file

@ -164,4 +164,4 @@ const val WALLPAPER_ACCENT = "wallpaper_accent"
const val SCREEN_ON_LYRICS = "screen_on_lyrics"
const val CIRCLE_PLAY_BUTTON = "circle_play_button"
const val SWIPE_ANYWHERE_NOW_PLAYING = "swipe_anywhere_now_playing"
const val KEEP_HISTORY = "keep_history"
const val PAUSE_HISTORY = "pause_history"

View file

@ -124,8 +124,8 @@ abstract class AbsMusicServiceActivity : AbsBaseActivity(), IMusicServiceEventLi
if (entity != null) {
repository.updateHistorySong(MusicPlayerRemote.currentSong)
} else {
// Check whether keep history option is ON or OFF
if (PreferenceUtil.homeHistory) {
// Check whether pause history option is ON or OFF
if (!PreferenceUtil.pauseHistory) {
repository.addSongToHistory(MusicPlayerRemote.currentSong)
}
}

View file

@ -164,7 +164,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de
adapter = songAdapter
layoutManager = linearLayoutManager()
}
if (PreferenceUtil.homeHistory) { // Observe only if keep history is enabled
if (!PreferenceUtil.pauseHistory) { // Observe only if keep history is not paused
libraryViewModel.observableHistorySongs().observe(viewLifecycleOwner) {
songAdapter.swapDataSet(it)
binding.empty.isVisible = it.isEmpty()
@ -255,7 +255,7 @@ class DetailListFragment : AbsMainActivityFragment(R.layout.fragment_playlist_de
private fun historyDisabled() {
binding.empty.isVisible = true
binding.emptyText.text = getString(R.string.history_disabled)
binding.emptyText.text = getString(R.string.history_paused)
binding.emptyButton.isVisible = true
}

View file

@ -637,10 +637,10 @@ object PreferenceUtil {
true
)
val homeHistory: Boolean
val pauseHistory: Boolean
get() = sharedPreferences.getBoolean(
KEEP_HISTORY,
true
PAUSE_HISTORY,
false
)
var audioFadeDuration