AsyncLayoutInflater

You never get a second chance to make a good first impression. This old adage is particularly true for apps. A bad first impression can often drive users to abandon an app before they have properly tried it. Slow app startup can certainly contribute to a poor first experience. But the Jetpack Startup library can…

MotionLayout: Visibility

MotionLayout is a wonderful tool for creating complex layout animations. However it does have some foibles which are easy enough to work around, but can initially be baffling. In this post we’ll look at some oddities concerning the visibility of views within the layout.

ConstraintLayout: Sized Align

ConstraintLayout is an extremely powerful thing, but is also somewhat complex because it has a number of different ways of working. For a while I struggled with one specific use-case which I felt must be possible, but could never quite get working as I wanted, and often had to go with a solution which felt…

View Binding: Merge

View Binding was introduced in 2019 and is really nice. I have written about it before. However I recently discovered a small gotcha that is easy to work around, but it did me a frighten when I first encountered it, and is not, at the time of writing, mentioned in the official documentation. In this…

Motion Vectors

Regular readers of Styling Android will not be surprised to hear that I rather like animations. A couple of really useful tools for creating nice animations are AnimatedVectorDrawable (AVD), and MotionLayout and it should come as no surprise that I am a big fan of both. But using them together is not easy. In this…

MotionLayout: Dynamic Toolbar

Regular readers of Styling Android may have guessed that I rather enjoy animating things. MotionLayout offers amazing scope for animations and it’s possible to create some really interesting animations using it. We’ve looked at how to implement a Collapsing Toolbar previously on Styling Android, but we’re not limited to just mimicking existing behaviours which can…

MotionLayout – Collapsing Toolbar – Part 2

At Google IO 2018 ConstraintLayout 2.0 was announced and the biggest new addition was MotionLayout which gives us an amazing new tool for layout animations. Nicolas Roard has already published an excellent introduction to MotionLayout and I would highly recommend giving that a read to understand the basics and components of MotionLayout. In this short…

MotionLayout – Collapsing Toolbar – Part 1

At Google IO 2018 ConstraintLayout 2.0 was announced and the biggest new addition was MotionLayout which gives us an amazing new tool for layout animations. Nicolas Roard has already published an excellent introduction to MotionLayout and I would highly recommend giving that a read to understand the basics and components of MotionLayout. In this short…

Dynamic VectorDrawable Sizing

A few weeks ago I was chatting with Kaushik Gopal (half of the excellent Fragmented Podcast team) and he raised an interesting yet quite tricky question: Is there a recommended way of resizing VectorDrawables programmatically. I must confess that I did not know the answer to this but it struck me as a useful thing…

Tool Time – Part 2

A common use-case when we’re designing a layout containing a RecyclerView (or, if you’re a glutton for punishment: ListView) is that we may have to display data that is either generated or obtained at runtime. For example, we retrieve the data for the list items from a cloud API. This can make it difficult to…