Hi there! I use Kotlin properties for view-visibil...
# android
y
Hi there! I use Kotlin properties for view-visibility. For example:
Copy code
var isShowButton: Boolean
        get() = button.visibilityExt
        set(value) {
            button.visibilityExt = value
        }
visibilityExt is extension for View. I’d like to use delegate for this. How I want to do it:
Copy code
var isShowButton by ViewVisbilityDelegate(button)
But when property initialises button is null. So I found out a decision: I can send to delegate view’s id (for example R.id.button). But for this I have to call findViewById() for each item of ViewGroup. May be someone had the same or similar problem and has good solution. Thanks