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:
Viktor De Pasquale
2019-04-13 00:14:37 +02:00
parent f309522268
commit bd00ae8ede
17 changed files with 1083 additions and 750 deletions

View File

@@ -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)
}

View File

@@ -0,0 +1,8 @@
package com.topjohnwu.magisk.utils
import com.skoumal.teanity.util.KObservableField
fun KObservableField<Boolean>.toggle() {
value = !value
}