mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 23:01:51 +01:00
add sort by chapter number in download queue (#4337)
* add sort by chapter number in download queue * Bigest, smallest chapter download * grouped
This commit is contained in:
parent
86b9d7e843
commit
a083e1f71a
@ -157,6 +157,17 @@ class DownloadController :
|
|||||||
val downloads = items.mapNotNull { it.download }
|
val downloads = items.mapNotNull { it.download }
|
||||||
presenter.reorder(downloads)
|
presenter.reorder(downloads)
|
||||||
}
|
}
|
||||||
|
R.id.bigest, R.id.smallest -> {
|
||||||
|
val adapter = adapter ?: return false
|
||||||
|
val items = adapter.currentItems.sortedBy { it.download.chapter.chapter_number }
|
||||||
|
.toMutableList()
|
||||||
|
if (item.itemId == R.id.bigest) {
|
||||||
|
items.reverse()
|
||||||
|
}
|
||||||
|
adapter.updateDataSet(items)
|
||||||
|
val downloads = items.mapNotNull { it.download }
|
||||||
|
presenter.reorder(downloads)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,31 @@
|
|||||||
app:showAsAction="never">
|
app:showAsAction="never">
|
||||||
<menu>
|
<menu>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/newest"
|
android:id="@+id/action_sort_date"
|
||||||
android:title="@string/action_newest" />
|
android:title="@string/action_order_by_upload_date"
|
||||||
|
app:showAsAction="never">
|
||||||
|
<menu>
|
||||||
|
<item
|
||||||
|
android:id="@+id/newest"
|
||||||
|
android:title="@string/action_newest" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/oldest"
|
||||||
|
android:title="@string/action_oldest" />
|
||||||
|
</menu>
|
||||||
|
</item>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/oldest"
|
android:id="@+id/action_sort_chapter"
|
||||||
android:title="@string/action_oldest" />
|
android:title="@string/action_order_by_chapter_number"
|
||||||
|
app:showAsAction="never">
|
||||||
|
<menu>
|
||||||
|
<item
|
||||||
|
android:id="@+id/bigest"
|
||||||
|
android:title="@string/action_bigest" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/smallest"
|
||||||
|
android:title="@string/action_smallest" />
|
||||||
|
</menu>
|
||||||
|
</item>
|
||||||
</menu>
|
</menu>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@ -103,8 +103,12 @@
|
|||||||
<string name="action_sort">Sort</string>
|
<string name="action_sort">Sort</string>
|
||||||
<string name="action_sort_descending">Descending</string>
|
<string name="action_sort_descending">Descending</string>
|
||||||
<string name="action_reorganize_by">Reorder</string>
|
<string name="action_reorganize_by">Reorder</string>
|
||||||
|
<string name="action_order_by_upload_date">By upload date</string>
|
||||||
|
<string name="action_order_by_chapter_number">By chapter number</string>
|
||||||
<string name="action_newest">Newest</string>
|
<string name="action_newest">Newest</string>
|
||||||
<string name="action_oldest">Oldest</string>
|
<string name="action_oldest">Oldest</string>
|
||||||
|
<string name="action_bigest">Bigest</string>
|
||||||
|
<string name="action_smallest">Smallest</string>
|
||||||
<string name="action_move_to_top">Move to top</string>
|
<string name="action_move_to_top">Move to top</string>
|
||||||
<string name="action_move_to_bottom">Move to bottom</string>
|
<string name="action_move_to_bottom">Move to bottom</string>
|
||||||
<string name="action_install">Install</string>
|
<string name="action_install">Install</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user