Chris Banes

Latest articles

Suspending over Views

Kotlin Coroutines allow us to model asynchronous problems like synchronous code. That’s great, but most usage seems to concentrate on I/O tasks and concurrent operations. Coroutines are great at modelling problems which work across threads, but can also model asynchronous problems on the same thread. There’s one place which I think really benefits from...

Suspending over Views — Example

This blog post is the second of two which explores how coroutines enables you to write complex asynchronous UI operations in a much simpler way. The first post goes through the theory, while this post demonstrates how they fix a problem. If you want to recap the first post, you can find it here: Suspending over Views Let’s take what we learnt in the...

WindowInsets — Listeners to layouts

If you’ve watched my Becoming a Master Window Fitter talk, you’ll know that handling window insets can be complex. Recently I’ve been improving system bar handling in a few apps, enabling them to draw behind the status and navigation bars. I think I’ve come up with some methods which make handling insets easier (hopefully). Drawing behind the navigation...

Fragment Transitions

This is the first post in a small post series where I explore how to get transitions working nicely with fragments. This post is all about getting them running. A couple of months ago I showed a grid to grid transition from an app I’m building called Tivi. This fragment transition has taken 2+ days of my life, but I think it the result is worth it 🕺🤸 #AndroidDevCode:...

Room + Time

If you’ve started using Room (and you should if you haven’t), there’s a high probability that you will need to store + retrieve some kind of date/time. Room does not provide any support for that outof the box, instead it provides the extensible TypeConverterannotation, which allows you to provide mappings from arbitrary objects to types Room understands,...

Carry on Scrolling

If you’ve used the Material Design Components library (formerly known as the design support library), and specifically its scrolling components such as AppBarLayout, you probably noticed that flinging can sometimes stop quite abruptly. You can see a quick animation comparing the issue and new fixed version above. As you can see, the scrolling gesture...

Nested scrolling strikes back

If you’ve used the Material Design Components library (formerly known as the design support library), and specifically it’s scrolling components such as AppBarLayout, you probably noticed that flinging can sometimes stop quite abruptly. You can see a quick animation comparing the issue and new fixed version above. As you can see, the scrolling gesture...

Jekyll + Firebase Hosting

This site is built with Jekyll and was hosted on GitHub Pages until recently, with all of the commit-to-deploy goodness that it gives you for free. I found that hosting on GitHub does have some downsides though: SSL does not work with custom domains (CNAME) unless you use a proxy (such as CloudFlare). You need a paid account to have private repositories....

Why isn’t my animation running?

Let me tell you a story about something I spent a fair amount of time debugging last year. I had totally forgot about it until the other day when someone mentioned something they were seeing with Snackbar, and it turned out to be the same thing. So what is the issue? Well it’s easier if I show you: You’ll see notice that I’m just opening an...

AppCompat v23.2 — DayNight

Please note, this post has been updated to reflect changes in AppCompat since first 23.2.0. As you may have seen in the Support Lib 23.2.0 blog post, AppCompat now has a new theme family: Theme.AppCompat.DayNight. What these themes do is switch between Theme.AppCompat (dark) and Theme.AppCompat.Light (light) based on the time of day. This has...

Discover, share and read the best on the web

Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters! Get unfiltered news feeds or filter them to your liking.

Get Inoreader
Inoreader - Subscribe to RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters!