Fixed same events not being able to propagate consecutively

This commit is contained in:
Viktor De Pasquale 2019-04-14 12:21:04 +02:00
parent 861ad9881c
commit 796c16237d
3 changed files with 11 additions and 11 deletions

View File

@ -5,10 +5,10 @@ import com.skoumal.teanity.viewevents.ViewEvent
data class OpenLinkEvent(val url: String) : ViewEvent()
object ManagerInstallEvent : ViewEvent()
object MagiskInstallEvent : ViewEvent()
class ManagerInstallEvent : ViewEvent()
class MagiskInstallEvent : ViewEvent()
object ManagerChangelogEvent : ViewEvent()
object MagiskChangelogEvent : ViewEvent()
class ManagerChangelogEvent : ViewEvent()
class MagiskChangelogEvent : ViewEvent()
object UninstallEvent : ViewEvent()
class UninstallEvent : ViewEvent()

View File

@ -80,18 +80,18 @@ class HomeViewModel(
fun twitterPressed() = OpenLinkEvent(Const.Url.TWITTER_URL).publish()
fun githubPressed() = OpenLinkEvent(Const.Url.REPO_URL).publish()
fun xdaPressed() = OpenLinkEvent(Const.Url.XDA_THREAD).publish()
fun uninstallPressed() = UninstallEvent.publish()
fun uninstallPressed() = UninstallEvent().publish()
fun advancedPressed() = isAdvancedExpanded.toggle()
fun installPressed(item: MagiskItem) = when (item) {
MagiskItem.MANAGER -> ManagerInstallEvent.publish()
MagiskItem.MAGISK -> MagiskInstallEvent.publish()
MagiskItem.MANAGER -> ManagerInstallEvent().publish()
MagiskItem.MAGISK -> MagiskInstallEvent().publish()
}
fun cardPressed(item: MagiskItem) = when (item) {
MagiskItem.MANAGER -> ManagerChangelogEvent.publish()
MagiskItem.MAGISK -> MagiskChangelogEvent.publish()
MagiskItem.MANAGER -> ManagerChangelogEvent().publish()
MagiskItem.MAGISK -> MagiskChangelogEvent().publish()
}
fun refresh() {

View File

@ -67,7 +67,7 @@ class MagiskFragment : NewMagiskFragment<HomeViewModel, com.topjohnwu.magisk.dat
private fun installMagisk() {
// Show Manager update first
if (Config.remoteManagerVersionCode > BuildConfig.VERSION_CODE) {
ManagerInstallDialog(requireActivity()).show()
installManager()
return
}
//FIXME dialog requires old base