mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 21:01:50 +01:00
Make tapping available extension row prompt install
This commit is contained in:
parent
4a5bceb4e4
commit
a63cecbfcb
@ -104,6 +104,8 @@ open class ExtensionController :
|
|||||||
override fun onButtonClick(position: Int) {
|
override fun onButtonClick(position: Int) {
|
||||||
val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return
|
val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return
|
||||||
when (extension) {
|
when (extension) {
|
||||||
|
is Extension.Available -> presenter.installExtension(extension)
|
||||||
|
is Extension.Untrusted -> openTrustDialog(extension)
|
||||||
is Extension.Installed -> {
|
is Extension.Installed -> {
|
||||||
if (!extension.hasUpdate) {
|
if (!extension.hasUpdate) {
|
||||||
openDetails(extension)
|
openDetails(extension)
|
||||||
@ -111,12 +113,6 @@ open class ExtensionController :
|
|||||||
presenter.updateExtension(extension)
|
presenter.updateExtension(extension)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is Extension.Available -> {
|
|
||||||
presenter.installExtension(extension)
|
|
||||||
}
|
|
||||||
is Extension.Untrusted -> {
|
|
||||||
openTrustDialog(extension)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,12 +143,11 @@ open class ExtensionController :
|
|||||||
|
|
||||||
override fun onItemClick(view: View, position: Int): Boolean {
|
override fun onItemClick(view: View, position: Int): Boolean {
|
||||||
val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return false
|
val extension = (adapter?.getItem(position) as? ExtensionItem)?.extension ?: return false
|
||||||
if (extension is Extension.Installed) {
|
when (extension) {
|
||||||
openDetails(extension)
|
is Extension.Available -> presenter.installExtension(extension)
|
||||||
} else if (extension is Extension.Untrusted) {
|
is Extension.Untrusted -> openTrustDialog(extension)
|
||||||
openTrustDialog(extension)
|
is Extension.Installed -> openDetails(extension)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user