Added Last Read to drag & drop

This commit is contained in:
Jay 2020-01-27 20:03:29 -08:00
parent 17b862df4a
commit ea281be29e
3 changed files with 10 additions and 0 deletions

View File

@ -224,6 +224,7 @@ class LibraryController(
'c' -> subMenu.findItem(R.id.action_update_asc)?.isChecked = true
'd' -> subMenu.findItem(R.id.action_update_dsc)?.isChecked = true
'e' -> subMenu.findItem(R.id.action_unread)?.isChecked = true
'f' -> subMenu.findItem(R.id.action_last_read)?.isChecked = true
}
}
else {
@ -483,6 +484,7 @@ class LibraryController(
R.id.action_update_asc -> reOrder(3)
R.id.action_update_dsc -> reOrder(4)
R.id.action_unread -> reOrder(5)
R.id.action_last_read -> reOrder(6)
else -> return super.onOptionsItemSelected(item)
}

View File

@ -242,6 +242,11 @@ class LibraryPresenter(
'c' -> i2.manga.last_update.compareTo(i1.manga.last_update)
'd' -> i1.manga.last_update.compareTo(i2.manga.last_update)
'e' -> i2.manga.unread.compareTo(i1.manga.unread)
'f' -> {
val manga1LastRead = lastReadManga[i1.manga.id!!] ?: lastReadManga.size
val manga2LastRead = lastReadManga[i2.manga.id!!] ?: lastReadManga.size
manga1LastRead.compareTo(manga2LastRead)
}
else -> sortAlphabetical(i1, i2)
}
}

View File

@ -54,6 +54,9 @@
<item
android:id="@+id/action_unread"
android:title="@string/action_filter_unread"/>
<item
android:id="@+id/action_last_read"
android:title="@string/action_sort_last_read"/>
</group>
</menu>