From b5dbdd17748501f65b315e91abfdef9b91545fd9 Mon Sep 17 00:00:00 2001 From: len Date: Thu, 26 May 2016 14:46:31 +0200 Subject: [PATCH] Change default sorting method --- .../tachiyomi/data/database/models/Manga.java | 4 ++-- .../tachiyomi/ui/manga/chapter/ChaptersFragment.kt | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.java b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.java index 0ac6eaa2d6..f9afa3bba7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.java +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/models/Manga.java @@ -83,8 +83,8 @@ public class Manga implements Serializable { public static final int SHOW_NOT_DOWNLOADED = 0x00000010; public static final int DOWNLOADED_MASK = 0x00000018; - public static final int SORTING_NUMBER = 0x00000000; - public static final int SORTING_SOURCE = 0x00000100; + public static final int SORTING_SOURCE = 0x00000000; + public static final int SORTING_NUMBER = 0x00000100; public static final int SORTING_MASK = 0x00000100; public static final int DISPLAY_NAME = 0x00000000; diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt index 605c2b8d96..027d45d61c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersFragment.kt @@ -214,16 +214,16 @@ class ChaptersFragment : BaseRxFragment(), ActionMode.Callbac private fun showSortingDialog() { // Get available modes, ids and the selected mode - val modes = intArrayOf(R.string.sort_by_number, R.string.sort_by_source) - val ids = intArrayOf(Manga.SORTING_NUMBER, Manga.SORTING_SOURCE) - val selectedIndex = if (presenter.manga.sorting == Manga.SORTING_NUMBER) 0 else 1 + val modes = intArrayOf(R.string.sort_by_source, R.string.sort_by_number) + val ids = intArrayOf(Manga.SORTING_SOURCE, Manga.SORTING_NUMBER) + val selectedIndex = if (presenter.manga.sorting == Manga.SORTING_SOURCE) 0 else 1 MaterialDialog.Builder(activity) .title(R.string.sorting_mode) .items(modes.map { getString(it) }) .itemsIds(ids) .itemsCallbackSingleChoice(selectedIndex) { dialog, itemView, which, text -> - // Save the new display mode + // Save the new sorting mode presenter.setSorting(itemView.id) true } @@ -232,13 +232,13 @@ class ChaptersFragment : BaseRxFragment(), ActionMode.Callbac private fun showDownloadDialog() { // Get available modes - val modes = listOf(getString(R.string.download_1), getString(R.string.download_5), getString(R.string.download_10), - getString(R.string.download_unread), getString(R.string.download_all)) + val modes = intArrayOf(R.string.download_1, R.string.download_5, R.string.download_10, + R.string.download_unread, R.string.download_all) MaterialDialog.Builder(activity) .title(R.string.manga_download) .negativeText(android.R.string.cancel) - .items(modes) + .items(modes.map { getString(it) }) .itemsCallback { dialog, view, i, charSequence -> var chapters: MutableList = arrayListOf()