2019-04-11 19:17:54 +00:00
|
|
|
package com.topjohnwu.magisk.utils
|
|
|
|
|
|
|
|
import android.view.View
|
2019-04-12 22:14:37 +00:00
|
|
|
import androidx.annotation.DrawableRes
|
|
|
|
import androidx.appcompat.widget.AppCompatImageView
|
2019-04-11 19:17:54 +00:00
|
|
|
import androidx.appcompat.widget.Toolbar
|
|
|
|
import androidx.databinding.BindingAdapter
|
|
|
|
|
|
|
|
|
|
|
|
@BindingAdapter("onNavigationClick")
|
|
|
|
fun setOnNavigationClickedListener(view: Toolbar, listener: View.OnClickListener) {
|
|
|
|
view.setNavigationOnClickListener(listener)
|
|
|
|
}
|
2019-04-12 22:14:37 +00:00
|
|
|
|
|
|
|
@BindingAdapter("srcCompat")
|
|
|
|
fun setImageResource(view: AppCompatImageView, @DrawableRes resId: Int) {
|
|
|
|
view.setImageResource(resId)
|
|
|
|
}
|