These kind of things shouln't go overboard, but ex...
# android
These kind of things shouln't go overboard, but extensions are such a good way to make the android api a bit more readable (especially the 'old' classes like many things in
ferranis: Yea. I usually find myself writing a number of extension functions on top of those good 'ol classes. Context, View and co. Makes life a lot easier
View in particular... why is there no method? setVisibility(View.VISIBLE) is so obscure and long
💯 1
ferranis: A good example is something like this:
Copy code
var View.isVisible: Boolean
    get () = visibility == View.VISIBLE
    set(value) { 
        visibility = if (value) View.VISIBLE else View.GONE 
...Given INVISIBLE isn't a state I use so often
Thats just the methods (directly on the view) that make things very readable. Also one i found useful in my project:
fun View.isTranslucent() = alpha < 1.0f
Extensions are just a great way to add domain specific things without cluttering the android api
I have a couple of them actually. Extension functions/properties just makes Android dev great again
I find it difficult getting much productivity out of a no-kotlin project these days
Kotlin in particular makes android dev great again!. Its just so much things you don't need to write or things you can express in much less code. Java has just too much boilerplate code.
Haha. *Kotlin. Yes ☺️
Also a very, very important plus for kolin: It makes tests more readable and expressive