mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Adjust sort options
This commit is contained in:
parent
d37c7604d2
commit
6a1725fd3d
3 changed files with 57 additions and 11 deletions
|
|
@ -99,6 +99,45 @@ val BoxSetSortOptions =
|
||||||
ItemSortBy.RANDOM,
|
ItemSortBy.RANDOM,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val AlbumSortOptions =
|
||||||
|
listOf(
|
||||||
|
ItemSortBy.SORT_NAME,
|
||||||
|
ItemSortBy.PREMIERE_DATE,
|
||||||
|
ItemSortBy.DATE_CREATED,
|
||||||
|
ItemSortBy.DATE_PLAYED,
|
||||||
|
ItemSortBy.ALBUM_ARTIST,
|
||||||
|
ItemSortBy.COMMUNITY_RATING,
|
||||||
|
ItemSortBy.CRITIC_RATING,
|
||||||
|
ItemSortBy.RANDOM,
|
||||||
|
)
|
||||||
|
|
||||||
|
val ArtistSortOptions =
|
||||||
|
listOf(
|
||||||
|
ItemSortBy.SORT_NAME,
|
||||||
|
ItemSortBy.PREMIERE_DATE,
|
||||||
|
ItemSortBy.DATE_CREATED,
|
||||||
|
ItemSortBy.DATE_PLAYED,
|
||||||
|
ItemSortBy.COMMUNITY_RATING,
|
||||||
|
ItemSortBy.CRITIC_RATING,
|
||||||
|
ItemSortBy.RANDOM,
|
||||||
|
)
|
||||||
|
|
||||||
|
val SongSortOptions =
|
||||||
|
listOf(
|
||||||
|
ItemSortBy.SORT_NAME,
|
||||||
|
ItemSortBy.PREMIERE_DATE,
|
||||||
|
ItemSortBy.ALBUM,
|
||||||
|
ItemSortBy.ALBUM_ARTIST,
|
||||||
|
ItemSortBy.ARTIST,
|
||||||
|
ItemSortBy.DATE_CREATED,
|
||||||
|
ItemSortBy.DATE_PLAYED,
|
||||||
|
ItemSortBy.COMMUNITY_RATING,
|
||||||
|
ItemSortBy.CRITIC_RATING,
|
||||||
|
ItemSortBy.PLAY_COUNT,
|
||||||
|
ItemSortBy.RUNTIME,
|
||||||
|
ItemSortBy.RANDOM,
|
||||||
|
)
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
fun getStringRes(sort: ItemSortBy): Int =
|
fun getStringRes(sort: ItemSortBy): Int =
|
||||||
when (sort) {
|
when (sort) {
|
||||||
|
|
@ -132,5 +171,11 @@ fun getStringRes(sort: ItemSortBy): Int =
|
||||||
|
|
||||||
ItemSortBy.DEFAULT -> R.string.default_track
|
ItemSortBy.DEFAULT -> R.string.default_track
|
||||||
|
|
||||||
|
ItemSortBy.ALBUM -> R.string.album
|
||||||
|
|
||||||
|
ItemSortBy.ALBUM_ARTIST -> R.string.album_artist
|
||||||
|
|
||||||
|
ItemSortBy.ARTIST -> R.string.artist
|
||||||
|
|
||||||
else -> throw IllegalArgumentException("Unsupported sort option: $sort")
|
else -> throw IllegalArgumentException("Unsupported sort option: $sort")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
package com.github.damontecres.wholphin.ui.detail
|
package com.github.damontecres.wholphin.ui.detail
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
import androidx.compose.animation.fadeIn
|
import androidx.compose.animation.expandVertically
|
||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.shrinkVertically
|
||||||
import androidx.compose.animation.slideInVertically
|
|
||||||
import androidx.compose.animation.slideOutVertically
|
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
|
@ -32,8 +30,9 @@ import com.github.damontecres.wholphin.ui.components.GenreCardGrid
|
||||||
import com.github.damontecres.wholphin.ui.components.RecommendedMusic
|
import com.github.damontecres.wholphin.ui.components.RecommendedMusic
|
||||||
import com.github.damontecres.wholphin.ui.components.TabRow
|
import com.github.damontecres.wholphin.ui.components.TabRow
|
||||||
import com.github.damontecres.wholphin.ui.components.ViewOptionsSquare
|
import com.github.damontecres.wholphin.ui.components.ViewOptionsSquare
|
||||||
import com.github.damontecres.wholphin.ui.data.MovieSortOptions
|
import com.github.damontecres.wholphin.ui.data.AlbumSortOptions
|
||||||
import com.github.damontecres.wholphin.ui.data.VideoSortOptions
|
import com.github.damontecres.wholphin.ui.data.ArtistSortOptions
|
||||||
|
import com.github.damontecres.wholphin.ui.data.SongSortOptions
|
||||||
import com.github.damontecres.wholphin.ui.logTab
|
import com.github.damontecres.wholphin.ui.logTab
|
||||||
import com.github.damontecres.wholphin.ui.nav.Destination
|
import com.github.damontecres.wholphin.ui.nav.Destination
|
||||||
import com.github.damontecres.wholphin.ui.preferences.PreferencesViewModel
|
import com.github.damontecres.wholphin.ui.preferences.PreferencesViewModel
|
||||||
|
|
@ -77,8 +76,8 @@ fun CollectionFolderMusic(
|
||||||
) {
|
) {
|
||||||
AnimatedVisibility(
|
AnimatedVisibility(
|
||||||
showHeader,
|
showHeader,
|
||||||
enter = slideInVertically() + fadeIn(),
|
enter = expandVertically(),
|
||||||
exit = slideOutVertically() + fadeOut(),
|
exit = shrinkVertically(),
|
||||||
) {
|
) {
|
||||||
TabRow(
|
TabRow(
|
||||||
selectedTabIndex = selectedTabIndex,
|
selectedTabIndex = selectedTabIndex,
|
||||||
|
|
@ -125,7 +124,7 @@ fun CollectionFolderMusic(
|
||||||
),
|
),
|
||||||
showTitle = false,
|
showTitle = false,
|
||||||
recursive = true,
|
recursive = true,
|
||||||
sortOptions = MovieSortOptions,
|
sortOptions = AlbumSortOptions,
|
||||||
defaultViewOptions = ViewOptionsSquare,
|
defaultViewOptions = ViewOptionsSquare,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
|
@ -157,7 +156,7 @@ fun CollectionFolderMusic(
|
||||||
),
|
),
|
||||||
showTitle = false,
|
showTitle = false,
|
||||||
recursive = true,
|
recursive = true,
|
||||||
sortOptions = VideoSortOptions,
|
sortOptions = ArtistSortOptions,
|
||||||
defaultViewOptions = ViewOptionsSquare,
|
defaultViewOptions = ViewOptionsSquare,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
|
@ -201,7 +200,7 @@ fun CollectionFolderMusic(
|
||||||
),
|
),
|
||||||
showTitle = false,
|
showTitle = false,
|
||||||
recursive = true,
|
recursive = true,
|
||||||
sortOptions = MovieSortOptions,
|
sortOptions = SongSortOptions,
|
||||||
defaultViewOptions = ViewOptionsSquare,
|
defaultViewOptions = ViewOptionsSquare,
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
|
|
|
||||||
|
|
@ -724,5 +724,7 @@
|
||||||
<string name="mixer">Mixer</string>
|
<string name="mixer">Mixer</string>
|
||||||
<string name="creator">Creator</string>
|
<string name="creator">Creator</string>
|
||||||
<string name="artist">Artist</string>
|
<string name="artist">Artist</string>
|
||||||
|
<string name="album_artist">Album artist</string>
|
||||||
|
<string name="album">Album</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue