ViewBindingKTX icon indicating copy to clipboard operation
ViewBindingKTX copied to clipboard

The most comprehensive utils of ViewBinding. (最全面的 ViewBinding 工具,支持 Kotlin 和 Java 用法,支持 BRVAH,支持封装到基类,支持 DataBinding,支持选择是否使用反射)

Results 13 ViewBindingKTX issues
Sort by recently updated
recently updated
newest added

自定义 View 里有个 MaterialTextView,id 是 tv。 主界面 Activity 布局中使用了上述自定义 View,且布局里本身有个 RTextView,id 也是 tv。 然后报错如下: Caused by: java.lang.ClassCastException: com.google.android.material.textview.MaterialTextView cannot be cast to com.ruffian.library.widget.RTextView 猜测是 inflate 的过程中因为 id 一样 binding 错了。...

不建议这么使用 thisRef.viewLifecycleOwner.lifecycle.addObserver(object : LifecycleObserver { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) fun onDestroyView() { Log.e("taggg", "onDestroyView viewLifecycleOwner$this") _binding = null } }) 因为这会导致比fragment更快的执行onDestroyView方法

请教一下, genericOwner 如果有多个 ViewBinding 泛型的时候, 有什么推荐的使用方法吗 ` class BaseBindingClass () val obj = BaseBindingClass `