mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 07:31:50 +01:00
Migration now opens manga on long click
This commit is contained in:
parent
233dbec4b3
commit
b499b87f8c
@ -22,6 +22,7 @@ class CatalogueSearchCardAdapter(controller: CatalogueSearchController) :
|
|||||||
*/
|
*/
|
||||||
interface OnMangaClickListener {
|
interface OnMangaClickListener {
|
||||||
fun onMangaClick(manga: Manga)
|
fun onMangaClick(manga: Manga)
|
||||||
|
fun onMangaLongClick(manga: Manga)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -19,6 +19,13 @@ class CatalogueSearchCardHolder(view: View, adapter: CatalogueSearchCardAdapter)
|
|||||||
adapter.mangaClickListener.onMangaClick(item.manga)
|
adapter.mangaClickListener.onMangaClick(item.manga)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
itemView.setOnLongClickListener {
|
||||||
|
val item = adapter.getItem(adapterPosition)
|
||||||
|
if (item != null) {
|
||||||
|
adapter.mangaClickListener.onMangaLongClick(item.manga)
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bind(manga: Manga) {
|
fun bind(manga: Manga) {
|
||||||
|
@ -25,7 +25,7 @@ open class CatalogueSearchController(protected val initialQuery: String? = null)
|
|||||||
/**
|
/**
|
||||||
* Adapter containing search results grouped by lang.
|
* Adapter containing search results grouped by lang.
|
||||||
*/
|
*/
|
||||||
private var adapter: CatalogueSearchAdapter? = null
|
protected var adapter: CatalogueSearchAdapter? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when controller is initialized.
|
* Called when controller is initialized.
|
||||||
@ -73,6 +73,16 @@ open class CatalogueSearchController(protected val initialQuery: String? = null)
|
|||||||
router.pushController(MangaController(manga, true).withFadeTransaction())
|
router.pushController(MangaController(manga, true).withFadeTransaction())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when manga in global search is long clicked.
|
||||||
|
*
|
||||||
|
* @param manga clicked item containing manga information.
|
||||||
|
*/
|
||||||
|
override fun onMangaLongClick(manga: Manga) {
|
||||||
|
// Delegate to single click by default.
|
||||||
|
onMangaClick(manga)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds items to the options menu.
|
* Adds items to the options menu.
|
||||||
*
|
*
|
||||||
|
@ -59,6 +59,11 @@ class SearchController(
|
|||||||
dialog.showDialog(router)
|
dialog.showDialog(router)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onMangaLongClick(manga: Manga) {
|
||||||
|
// Call parent's default click listener
|
||||||
|
super.onMangaClick(manga)
|
||||||
|
}
|
||||||
|
|
||||||
class MigrationDialog : DialogController() {
|
class MigrationDialog : DialogController() {
|
||||||
|
|
||||||
private val preferences: PreferencesHelper by injectLazy()
|
private val preferences: PreferencesHelper by injectLazy()
|
||||||
|
Loading…
Reference in New Issue
Block a user