This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
private val prefsListener = SharedPreferences.OnSharedPreferenceChangeListener { _, key -> | |
when (key) { | |
PrefsRepo.KEY_SKIP_SILENCE, PrefsRepo.KEY_PLAYBACK_SPEED -> { | |
invalidatePlaybackParams() | |
} | |
PrefsRepo.KEY_PAUSE_ON_FOCUS_LOST -> { | |
updateAudioAttrs(exoPlayer) | |
} | |
// \/ \/ Add below \/ \/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private var _jumpForwardsIcon = MutableLiveData(makeJumpForwardsIcon()) | |
val jumpForwardsIcon: LiveData<Int> | |
get() = _jumpForwardsIcon | |
private var _jumpBackwardsIcon = MutableLiveData(makeJumpBackwardsIcon()) | |
val jumpBackwardsIcon: LiveData<Int> | |
get() = _jumpBackwardsIcon | |
// this listener already exists, just add the KEY_JUMP lines | |
private val prefsChangeListener = SharedPreferences.OnSharedPreferenceChangeListener { _, key -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.mattpvaughn.chronicle.features.library | |
// src/main/java/io/github/mattpvaughn/chronicle/features/library/TitleSortComparator.kt | |
/** Compares Book titles using numerical ordering */ | |
class TitleSortComparator { | |
fun compare(bookTitle1: String, bookTitle2: String): Int { | |
fun titleToArray(bookTitle: String): List<String> { | |
return bookTitle.split(Regex("(?<=\\D)(?=\\d)|(?<=\\d)(?=\\D)")) |