You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
Updated Magisk fragment to Kotlin
Exported old update card to special xml include where binding takes care of everything that had to be done in code beforehand. Added several easing functions and enums. Backported some classes and functions from the old fork Expect major breakage. Literally nothing works as the functionality needs to be implemented
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
package com.topjohnwu.magisk.ui.base
|
||||
|
||||
import androidx.core.net.toUri
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import com.skoumal.teanity.view.TeanityActivity
|
||||
import com.topjohnwu.magisk.utils.Utils
|
||||
|
||||
|
||||
abstract class MagiskActivity<ViewModel : MagiskViewModel, Binding : ViewDataBinding> :
|
||||
TeanityActivity<ViewModel, Binding>()
|
||||
TeanityActivity<ViewModel, Binding>() {
|
||||
|
||||
fun openUrl(url: String) = Utils.openLink(this, url.toUri())
|
||||
|
||||
}
|
||||
|
||||
@@ -5,4 +5,12 @@ import com.skoumal.teanity.view.TeanityFragment
|
||||
|
||||
|
||||
abstract class MagiskFragment<ViewModel : MagiskViewModel, Binding : ViewDataBinding> :
|
||||
TeanityFragment<ViewModel, Binding>()
|
||||
TeanityFragment<ViewModel, Binding>() {
|
||||
|
||||
protected val magiskActivity get() = activity as MagiskActivity<*, *>
|
||||
|
||||
fun openLink(url: String) {
|
||||
magiskActivity.openUrl(url)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.topjohnwu.magisk.ui.base
|
||||
|
||||
import com.skoumal.teanity.viewmodel.TeanityViewModel
|
||||
import com.skoumal.teanity.viewmodel.LoadingViewModel
|
||||
|
||||
|
||||
abstract class MagiskViewModel : TeanityViewModel()
|
||||
abstract class MagiskViewModel : LoadingViewModel()
|
||||
|
||||
Reference in New Issue
Block a user