library: remove default sort option

Remove the default [a.k.a SortMode.NONE] option from the library view.
It was effectively useless in every single library mode and was
functionally equivelent to SortMode.ALPHA_DOWN. Other SortModes might
come to take it's place, but likely only for albums.
This commit is contained in:
OxygenCobalt
2021-06-19 10:10:28 -06:00
parent 5131db5383
commit e25c91b49c
4 changed files with 6 additions and 10 deletions
@@ -38,6 +38,11 @@ class LibraryViewModel : ViewModel(), SettingsManager.Callback {
mDisplayMode = settingsManager.libraryDisplayMode
mSortMode = settingsManager.librarySortMode
// Handle "NONE" SortMode that was removed in 1.4.1
if (mSortMode == SortMode.NONE) {
mSortMode = SortMode.ALPHA_DOWN
}
updateLibraryData()
}
@@ -46,7 +51,6 @@ class LibraryViewModel : ViewModel(), SettingsManager.Callback {
*/
fun updateSortMode(@IdRes itemId: Int) {
val mode = when (itemId) {
R.id.option_sort_none -> SortMode.NONE
R.id.option_sort_alpha_down -> SortMode.ALPHA_DOWN
R.id.option_sort_alpha_up -> SortMode.ALPHA_UP
@@ -11,7 +11,6 @@ import androidx.core.database.getStringOrNull
import org.oxycblt.auxio.R
import org.oxycblt.auxio.database.BlacklistDatabase
import org.oxycblt.auxio.logD
import org.oxycblt.auxio.recycler.SortMode
/**
* Class that loads/constructs [Genre]s, [Artist]s, [Album]s, and [Song] objects from the filesystem
@@ -228,9 +227,6 @@ class MusicLoader(private val context: Context) {
)
}
// Make the artist view line up with the rest of the lists by sorting it.
artists = SortMode.ALPHA_DOWN.getSortedArtistList(artists).toMutableList()
logD("Albums successfully linked into ${artists.size} artists")
}
@@ -173,11 +173,10 @@ enum class SortMode(@DrawableRes val iconRes: Int) {
@IdRes
fun toMenuId(): Int {
return when (this) {
NONE -> R.id.option_sort_none
ALPHA_UP -> R.id.option_sort_alpha_up
ALPHA_DOWN -> R.id.option_sort_alpha_down
else -> R.id.option_sort_none
else -> R.id.option_sort_alpha_up
}
}