Make sure random library sort is at the bottom
(cherry picked from commit 2e2c8d36c1e23bf274c7c19f1242e14b0c7afbc1) # Conflicts: # app/src/main/java/eu/kanade/presentation/library/LibrarySettingsDialog.kt
This commit is contained in:
parent
95ae5211a7
commit
91d61a75e3
@ -200,22 +200,29 @@ private fun ColumnScope.SortPage(
|
||||
globalSortMode.type
|
||||
}
|
||||
val sortDescending = if (screenModel.grouping == LibraryGroup.BY_DEFAULT) {
|
||||
category.sort.isAscending
|
||||
!category.sort.isAscending
|
||||
} else {
|
||||
globalSortMode.isAscending
|
||||
}.not()
|
||||
!globalSortMode.isAscending
|
||||
}
|
||||
val hasSortTags by remember {
|
||||
screenModel.libraryPreferences.sortTagsForLibrary().changes()
|
||||
.map { it.isNotEmpty() }
|
||||
}.collectAsState(initial = screenModel.libraryPreferences.sortTagsForLibrary().get().isNotEmpty())
|
||||
// SY <--
|
||||
|
||||
val trackerSortOption = if (trackers.isEmpty()) {
|
||||
emptyList()
|
||||
val options = remember(trackers.isEmpty()/* SY --> */, hasSortTags/* SY <-- */) {
|
||||
val trackerMeanPair = if (trackers.isNotEmpty()) {
|
||||
MR.strings.action_sort_tracker_score to LibrarySort.Type.TrackerMean
|
||||
} else {
|
||||
listOf(MR.strings.action_sort_tracker_score to LibrarySort.Type.TrackerMean)
|
||||
null
|
||||
}
|
||||
|
||||
// SY -->
|
||||
val tagSortPair = if (hasSortTags) {
|
||||
SYMR.strings.tag_sorting to LibrarySort.Type.TagList
|
||||
} else {
|
||||
null
|
||||
}
|
||||
// SY <--
|
||||
listOfNotNull(
|
||||
MR.strings.action_sort_alpha to LibrarySort.Type.Alphabetical,
|
||||
MR.strings.action_sort_total to LibrarySort.Type.TotalChapters,
|
||||
@ -225,15 +232,15 @@ private fun ColumnScope.SortPage(
|
||||
MR.strings.action_sort_latest_chapter to LibrarySort.Type.LatestChapter,
|
||||
MR.strings.action_sort_chapter_fetch_date to LibrarySort.Type.ChapterFetchDate,
|
||||
MR.strings.action_sort_date_added to LibrarySort.Type.DateAdded,
|
||||
MR.strings.action_sort_random to LibrarySort.Type.Random,
|
||||
trackerMeanPair,
|
||||
// SY -->
|
||||
if (hasSortTags) {
|
||||
SYMR.strings.tag_sorting to LibrarySort.Type.TagList
|
||||
} else {
|
||||
null
|
||||
},
|
||||
tagSortPair,
|
||||
// SY <--
|
||||
).plus(trackerSortOption).map { (titleRes, mode) ->
|
||||
MR.strings.action_sort_random to LibrarySort.Type.Random,
|
||||
)
|
||||
}
|
||||
|
||||
options.map { (titleRes, mode) ->
|
||||
if (mode == LibrarySort.Type.Random) {
|
||||
BaseSortItem(
|
||||
label = stringResource(titleRes),
|
||||
|
@ -91,6 +91,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer
|
||||
import eu.kanade.tachiyomi.ui.webview.WebViewActivity
|
||||
import eu.kanade.tachiyomi.util.system.hasDisplayCutout
|
||||
import eu.kanade.tachiyomi.util.system.isNightMode
|
||||
import eu.kanade.tachiyomi.util.system.openInBrowser
|
||||
import eu.kanade.tachiyomi.util.system.toShareIntent
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import eu.kanade.tachiyomi.util.view.setComposeContent
|
||||
|
Loading…
x
Reference in New Issue
Block a user