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:
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
|
mDisplayMode = settingsManager.libraryDisplayMode
|
||||||
mSortMode = settingsManager.librarySortMode
|
mSortMode = settingsManager.librarySortMode
|
||||||
|
|
||||||
|
// Handle "NONE" SortMode that was removed in 1.4.1
|
||||||
|
if (mSortMode == SortMode.NONE) {
|
||||||
|
mSortMode = SortMode.ALPHA_DOWN
|
||||||
|
}
|
||||||
|
|
||||||
updateLibraryData()
|
updateLibraryData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +51,6 @@ class LibraryViewModel : ViewModel(), SettingsManager.Callback {
|
||||||
*/
|
*/
|
||||||
fun updateSortMode(@IdRes itemId: Int) {
|
fun updateSortMode(@IdRes itemId: Int) {
|
||||||
val mode = when (itemId) {
|
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_down -> SortMode.ALPHA_DOWN
|
||||||
R.id.option_sort_alpha_up -> SortMode.ALPHA_UP
|
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.R
|
||||||
import org.oxycblt.auxio.database.BlacklistDatabase
|
import org.oxycblt.auxio.database.BlacklistDatabase
|
||||||
import org.oxycblt.auxio.logD
|
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
|
* 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")
|
logD("Albums successfully linked into ${artists.size} artists")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,11 +173,10 @@ enum class SortMode(@DrawableRes val iconRes: Int) {
|
||||||
@IdRes
|
@IdRes
|
||||||
fun toMenuId(): Int {
|
fun toMenuId(): Int {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
NONE -> R.id.option_sort_none
|
|
||||||
ALPHA_UP -> R.id.option_sort_alpha_up
|
ALPHA_UP -> R.id.option_sort_alpha_up
|
||||||
ALPHA_DOWN -> R.id.option_sort_alpha_down
|
ALPHA_DOWN -> R.id.option_sort_alpha_down
|
||||||
|
|
||||||
else -> R.id.option_sort_none
|
else -> R.id.option_sort_alpha_up
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,6 @@
|
||||||
app:showAsAction="always">
|
app:showAsAction="always">
|
||||||
<menu>
|
<menu>
|
||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="single">
|
||||||
<item
|
|
||||||
android:id="@+id/option_sort_none"
|
|
||||||
android:title="@string/label_sort_none" />
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/option_sort_alpha_down"
|
android:id="@+id/option_sort_alpha_down"
|
||||||
android:title="@string/label_sort_alpha_down" />
|
android:title="@string/label_sort_alpha_down" />
|
||||||
|
|
Loading…
Reference in a new issue