Chris Banes

I work as an engineer in the Android Developer Relations team. This is my personal blog and any views expressed here are mine, and mine alone.

Room

Room + Date / 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.
Chris Banes
Nested Scrolling, AppBarLayout, Animations

Carry on Scrolling

A look at how we added fling support to nested scrolling in Android, to AppBarLayout work in all scenarios.
Chris Banes
Website, Jekyll, Firebase

Jekyll + Firebase Hosting

A look at how this site is built using Jekyll, and automatically deployed to Firebase Hosting.
Chris Banes
Animations

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.
Chris Banes
Dark Theme, AppCompat

DayNight — Adding a dark theme to your app

This post has been updated multiple time since first publishing. The content is correct as-of March 13th 2019. The DayNight functionality in AppCompat allows your app to easily switch between a dark ⚫ and light ⚪ theme. This has many benefits for your users, especially if you have a content-heavy app (such as a Reddit client). How do I use it? You need to change your theme to extend from one of the DayNight variants, and then call one method to enable the feature. Here’s an example theme decla
Chris Banes
AppCompat, Vector Drawable

AppCompat v23.2 — Age of the vectors

As you may have seen on the Support Lib 23.2.0 blog post, we now have compatible vector drawable implementations in the support libraries: VectorDrawableCompat and Animated VectorDrawableCompat. Those are implemented as standalone pieces of functionality. As we know that developers want to use them from resources, we’ve added support for vector drawables directly into AppCompat. There are various reasons for this integration, including: * Allows developers to easily use <vector> drawables on
Chris Banes
AppCompat

Support Libraries v22.1.0

It’s been a while since my last post so here we are. You may have seen that the 22.1.0 support libraries were released yesterday, which is probably the biggest non-platform release we’ve done with the support library. Before we go any further, have a read of Ian’s official release blog post [http://android-developers.blogspot.co.uk/2015/04/android-support-library-221.html] . It outlines all of the new features in this release, for all of the libraries. In this post I will concentrate more on t
Chris Banes
Android Themes, View styles

Theme vs Style

Android 5.0 Lollipop brings with it new functionality which allows you to specify an override theme for a View (and any descendents). Let’s have a look at how and why you would use it. Why? You’ve probably already been using this functionality for a while without knowing: Theme.Holo.Light.DarkActionBar. Think about the Light.DarkActionBar theme for a second. It’s a light theme for your content (background is light and the foreground is dark), but the action bar use a dark theme (dark backgroun
Chris Banes
Palette, Color extraction

Palette v21

Tried the Android Lollipop SDK? You may have noticed that Palette’s API has been updated. As before, Palette allows you to extract colors from images for use in your UI. Generating a palette The first step is to generate a Palette instance from a Bitmap. We have four related ways to do this: // Synchronous methods. // -------------------------------- // These should be used when you have access to the underlying image loading thread. // Picasso allows this through a Transformation. For other l
Chris Banes