migrating to ViewBinding part 2: Activities (#2093)
This commit is contained in:
parent
5167b8578e
commit
ff69a2ad0d
37 changed files with 741 additions and 729 deletions
|
|
@ -0,0 +1,15 @@
|
|||
package com.keylesspalace.tusky.util
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.viewbinding.ViewBinding
|
||||
|
||||
/**
|
||||
* https://medium.com/@Zhuinden/simple-one-liner-viewbinding-in-fragments-and-activities-with-kotlin-961430c6c07c
|
||||
*/
|
||||
|
||||
inline fun <T : ViewBinding> AppCompatActivity.viewBinding(
|
||||
crossinline bindingInflater: (LayoutInflater) -> T
|
||||
) = lazy(LazyThreadSafetyMode.NONE) {
|
||||
bindingInflater(layoutInflater)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue