Mark
01/21/2023, 2:21 AMprivate fun <V: ViewBinding> inflateOrNull(inflateLambda: (LayoutInflater) -> V): V? {
try {
return inflateLambda(layoutInflater)
} catch (e: Exception) {
// some dodgy device that cannot find a resource
return null
}
}ephemient
01/21/2023, 3:00 AMFooBinding needs to have a companion object for you to be able to write an extension that can be called like FooBinding.inflateOrNull(). since it's a Java class, it doesn't have a companion