You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Reorganize classes
- Move base classes to its own package - Move most logic out of MagiskActivity to MainActivity
This commit is contained in:
@@ -15,4 +15,11 @@ internal interface EventHandler {
|
||||
* the way how you handle them.
|
||||
*/
|
||||
fun onSimpleEventDispatched(event: Int) {}
|
||||
|
||||
val viewEventObserver get() = ViewEventObserver {
|
||||
onEventDispatched(it)
|
||||
if (it is SimpleViewEvent) {
|
||||
onSimpleEventDispatched(it.event)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.topjohnwu.magisk.model.events
|
||||
|
||||
import com.topjohnwu.magisk.utils.RxBus
|
||||
import com.topjohnwu.magisk.model.entity.MagiskPolicy
|
||||
import com.topjohnwu.magisk.model.entity.recycler.HideProcessRvItem
|
||||
import com.topjohnwu.magisk.model.entity.recycler.ModuleRvItem
|
||||
import com.topjohnwu.magisk.model.entity.recycler.PolicyRvItem
|
||||
import com.topjohnwu.magisk.utils.RxBus
|
||||
|
||||
class HideProcessEvent(val item: HideProcessRvItem) : RxBus.Event
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.topjohnwu.magisk.model.events
|
||||
|
||||
import com.topjohnwu.magisk.model.events.ViewEvent
|
||||
|
||||
class SimpleViewEvent(
|
||||
val event: Int
|
||||
) : ViewEvent()
|
||||
@@ -3,7 +3,6 @@ package com.topjohnwu.magisk.model.events
|
||||
import android.content.Context
|
||||
import androidx.annotation.StringRes
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.topjohnwu.magisk.model.events.ViewEvent
|
||||
|
||||
class SnackbarEvent private constructor(
|
||||
@StringRes private val messageRes: Int,
|
||||
|
||||
Reference in New Issue
Block a user