mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-11-12 21:02: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,6 +1,8 @@
|
||||
package com.topjohnwu.magisk.utils
|
||||
|
||||
import android.view.View
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.databinding.BindingAdapter
|
||||
|
||||
@@ -9,3 +11,8 @@ import androidx.databinding.BindingAdapter
|
||||
fun setOnNavigationClickedListener(view: Toolbar, listener: View.OnClickListener) {
|
||||
view.setNavigationOnClickListener(listener)
|
||||
}
|
||||
|
||||
@BindingAdapter("srcCompat")
|
||||
fun setImageResource(view: AppCompatImageView, @DrawableRes resId: Int) {
|
||||
view.setImageResource(resId)
|
||||
}
|
||||
|
||||
8
app/src/main/java/com/topjohnwu/magisk/utils/XBinding.kt
Normal file
8
app/src/main/java/com/topjohnwu/magisk/utils/XBinding.kt
Normal file
@@ -0,0 +1,8 @@
|
||||
package com.topjohnwu.magisk.utils
|
||||
|
||||
import com.skoumal.teanity.util.KObservableField
|
||||
|
||||
|
||||
fun KObservableField<Boolean>.toggle() {
|
||||
value = !value
|
||||
}
|
||||
Reference in New Issue
Block a user