Apr 21, 2021Member-onlyJetpack Compose: building a generic grid canvasAs promised in my last article, here I am back again with the grid canvas we used to replicate IntelliJ IDEA’s splash screen. This time I will be explaining how to implement some additional features. Content alignment We want our composable to have the ability to set where the cells will be…Android4 min readAndroid4 min read
Apr 14, 2021Member-onlyMimicking IntelliJ IDEA’s splash screen with Jetpack ComposeThe latest version of IntelliJ IDEA (2021.1 at the time of this publication) has a cool splash screen based on a grid containing different coloured shapes like this below: The goal of this post is to implement a Jetpack Compose composable that mimics this pattern. As we can see the…Android4 min readAndroid4 min read
Mar 8, 2021Member-onlyRemembering the State in Jetpack ComposeWhen starting to work with Jetpack Compose (now that it is in beta 🎉) and stateful components, we easily get used to define values based on a mutable state which are also remembered. But there are two independent concepts when we write a line of code like below: var clicks…Android3 min readAndroid3 min read
May 20, 2020Member-onlyRoad to Android UI testsWriting stable and reliable UI tests is neither easy nor trivial. There are multiple factors applications depend on that UI developers can’t control. Network is a very common external dependency that can produce test instability. …Android6 min readAndroid6 min read
Published inITNEXT·Apr 26, 2020Member-onlySealed classes + RecyclerView with headers = ❤️If you have been in the Android ecosystem for a while, there is a chance that at some point you needed to show a list of items on the screen grouped by a given criteria in the form of a header. Something like:Android3 min readAndroid3 min read
Apr 12, 2020Member-onlyAnnouncing poetimizely library 📢After spending the last weeks working on a library, today, I am happy to announce the first beta release of poetimizely. (Thanks to Ralph who is contributing to the project 🙂). What is poetimizely? poetimizely is a library to generate type safe accessors for Optimizely experiments and features. Type safe means that referencing…Kotlin2 min readKotlin2 min read
Mar 1, 2020Member-onlyKotlin expressivenessOne of the things that feels much different in Kotlin compared to Java is the type system. The void keyword for example is not present in Kotlin, so Unit type is used instead: fun functionReturningNoValue(): Unit { println(“Hello”) } I would say that this approach is more consistent than using…Kotlin3 min readKotlin3 min read
Published inITNEXT·Jan 18, 2020Member-onlyAny, Unit, Nothing and all their friendsAny This is an easy one, Any is just the “root” type, so every other type extends from it. It is like Object in Java, in fact, the compiled code for a value of type Any is an Object. // Kotlin val greeting: Any = "Hi there!" // Java private final…Kotlin3 min readKotlin3 min read
Dec 12, 2019Member-onlyYou may not need a sealed classWhen it comes to decide between using an enum or a sealed class in Kotlin, I’ve seen several situations where developers where using them indistinctly. Generally speaking, sealed classes are more powerful than enums. …Kotlin2 min readKotlin2 min read
Nov 15, 2019Member-onlyTo class, or to data class, that is the questionWhenever we write a new class in Kotlin, we may feel tempted about defining as a data class. But should every class which is a data holder be a data class? I don’t think so. …Kotlin2 min readKotlin2 min read