okaymak
07/04/2018, 2:14 PMDataBindingComponente: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
    class <redacted>.CustomComponent, unresolved supertypes: android.databinding.DataBindingComponentokaymak
07/04/2018, 2:26 PMgildor
07/04/2018, 4:27 PMokaymak
07/04/2018, 9:22 PMbuild.gradle:apply plugin: 'kotlin-kapt'
...
dataBinding {
   enabled = true
}class LifeCycleBindings(private val lifecycle: LifeCycle): LifecycleObserver {
    val disposables = CompositeDisposable()
    init {
        lifecycle.addObserver(this)
    }
    @BindingAdapter("test")
    fun TextView.test(test: String) {
	// just for demoing
        disposables.add(....)
    }
    @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
    fun dispose() {
        disposables.dispose()
    }
}package android.databinding;
public interface DataBindingComponent {
    LifeCycleBindings getLifeCycleBindings();
}class LifecycleBindingComponent(private val lifecycle: Lifecycle) : DataBindingComponent {
    override fun getLifeCycleBindings(): LifeCycleBindings {
        return LifeCycleBindings(lifecycle)
    }
}LifecycleBindingComponentokaymak
07/05/2018, 7:03 AMyan
07/14/2018, 12:30 AM