Compare commits

..

2 Commits

Author SHA1 Message Date
Mend Renovate
48166b9b52
Update dependency com.android.tools.build:gradle to v8.7.1 (#1326) 2024-10-15 05:02:45 +06:00
AntsyLich
2e2c8d36c1
Make sure random library sort is at the bottom 2024-10-15 05:00:56 +06:00
2 changed files with 20 additions and 16 deletions

View File

@ -166,23 +166,27 @@ private fun ColumnScope.SortPage(
val sortingMode = category.sort.type val sortingMode = category.sort.type
val sortDescending = !category.sort.isAscending val sortDescending = !category.sort.isAscending
val trackerSortOption = if (trackers.isEmpty()) { val options = remember(trackers.isEmpty()) {
emptyList() val trackerMeanPair = if (trackers.isNotEmpty()) {
} else { MR.strings.action_sort_tracker_score to LibrarySort.Type.TrackerMean
listOf(MR.strings.action_sort_tracker_score to LibrarySort.Type.TrackerMean) } else {
null
}
listOfNotNull(
MR.strings.action_sort_alpha to LibrarySort.Type.Alphabetical,
MR.strings.action_sort_total to LibrarySort.Type.TotalChapters,
MR.strings.action_sort_last_read to LibrarySort.Type.LastRead,
MR.strings.action_sort_last_manga_update to LibrarySort.Type.LastUpdate,
MR.strings.action_sort_unread_count to LibrarySort.Type.UnreadCount,
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,
trackerMeanPair,
MR.strings.action_sort_random to LibrarySort.Type.Random,
)
} }
listOf( options.map { (titleRes, mode) ->
MR.strings.action_sort_alpha to LibrarySort.Type.Alphabetical,
MR.strings.action_sort_total to LibrarySort.Type.TotalChapters,
MR.strings.action_sort_last_read to LibrarySort.Type.LastRead,
MR.strings.action_sort_last_manga_update to LibrarySort.Type.LastUpdate,
MR.strings.action_sort_unread_count to LibrarySort.Type.UnreadCount,
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,
).plus(trackerSortOption).map { (titleRes, mode) ->
if (mode == LibrarySort.Type.Random) { if (mode == LibrarySort.Type.Random) {
BaseSortItem( BaseSortItem(
label = stringResource(titleRes), label = stringResource(titleRes),

View File

@ -1,5 +1,5 @@
[versions] [versions]
agp_version = "8.7.0" agp_version = "8.7.1"
lifecycle_version = "2.8.6" lifecycle_version = "2.8.6"
paging_version = "3.3.2" paging_version = "3.3.2"
interpolator_version = "1.0.0" interpolator_version = "1.0.0"