viewbinding-delegate is Library to simplify ViewBinding's delegation class and function using Kotlin Delegate feature
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencyResolutionManagement {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
...
implementation 'com.github.pengdst:viewbinding-delegate:v2.0'
}
...
import io.github.pengdst.libs.ui.activity.viewbinding.ActivityViewBindingDelegate.Companion.viewBindings
class LoginActivity : AppCompatActivity() {
private val binding: ActivityLoginBinding by viewBindings()
...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
...
}
}