Skip to content
This repository was archived by the owner on Jul 16, 2024. It is now read-only.

Conversation

@Goooler
Copy link
Owner

@Goooler Goooler commented Jul 31, 2022

No description provided.

@Goooler Goooler added the enhancement New feature or request label Jul 31, 2022
@Goooler Goooler added this to the 1.6.0 milestone Jul 31, 2022
Comment on lines +21 to +24
@BindingAdapter("binding_isEnabled")
internal fun View.bindingIsEnabled(enabled: Boolean) {
this.isEnabled = enabled
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace clickable in xml.

Comment on lines +98 to +101
@BindingAdapter("binding_tint")
fun ImageView.bindingTint(@ColorInt color: Int) {
setColorFilter(color, PorterDuff.Mode.SRC_IN)
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +45 to +55
companion object {
@Suppress("UNCHECKED_CAST")
internal fun <T : ViewBinding> Any.inflateBinding(inflater: LayoutInflater): T {
return (javaClass.genericSuperclass as ParameterizedType).actualTypeArguments
.filterIsInstance<Class<T>>()
.first()
.getDeclaredMethod("inflate", LayoutInflater::class.java)
.also { it.isAccessible = true }
.invoke(null, inflater) as T
}
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set isAccessible to true for faster access.

@Goooler Goooler merged commit 3be5d0e into trunk Jul 31, 2022
@Goooler Goooler deleted the cleanup branch July 31, 2022 12:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants