Hello, i have an Android related question, so i ha...
# random
l
Hello, i have an Android related question, so i have a gridlayout which i subclassed to make a custom version of. I have connected an Adapter to it so i can populate it with data, however each child view needs to know about the parent width in order to size properly. What i did is to post a runnable to the UI thread to ensure that my adapter gets set only when the view is laid out, my question is:
Is this a good way of doing it? or is this just bad / hacky coding?
k
Try #C0B8M7BUY or the android IRC on freenode.
l
Will do
k
#C0B8M7BUY should really be more for questions about Android and Kotlin, honestly
in #C0B8M7BUY, this is just going to get tagged with stackoverflow emoji reactions
l
That is what i thought as well
k
Which would be funny since it doesn't fit there either ☺️.
l
oh well 🙂
d
ViewTreeObserver#addOnGlobalLayoutListener is I think the typical way of waiting for UI resizing calculations.