Sid Patil

code
search
dark_mode
person_outline

Droidcon Berlin: A ride through AOSP's new colors

calendar_today favorite_border 120 views hourglass_empty 4 min read mic_none Talks
link Watch it on droidcon.com
Use wallpaper generated system colors from Android 12 and Material You to repaint your apps to the users taste by using the material design 3 library and Jetpack compose

At Droidcon Berlin 2022


Dynamic colors on Android are a mystery unsolved! In this talk we go through aspects of Material 3’s color science and color extraction algorithms via Monet, the theme engine on Android.

We examine various parts of the Android framework and understand the operating system and it’s internals. Android’s dynamic theme system builds on custom color models, multi-step image quantization algorithms and much more!


Use wallpaper generated system colors from Android 12 and Material You to repaint your apps to the users taste by using the material design 3 library and Jetpack compose

At Droidcon Berlin 2022

About the talk

Title: A ride through AOSP’s new colors

Date: 7th July 2022

Conference: Droidcon Berlin 2022

Location: CityCube, Berlin, Hall 2 (Hamilton)

More details on Droidcon.com

Abstract

Dynamic theming on the Pixel is an amazing feature, but we as Android engineers always care about how it works under the hood!

In this talk, we will understand “Monet”, the wallpaper-based dynamic theming system.

We will see:

  1. What is Monet?
  2. Dynamic behavior of system-wide theming
  3. Wallpaper color extraction
  4. K-means and Celebi quantizers
  5. Color extraction strategy
  6. Runtime dynamic color updation
  7. Dynamic themes with M3 components for Jetpack Compose

In this session, we will aim to understand how the Android operating system works to enable dynamic theming (basics fundamentals of Material You). We will deep dive into AOSP to examine parts of the framework that form Monet and ultimately understand how dynamic system colors work.

Join me on the colourful ride!


Slides

Fun fact: The colors used in the slides are built with the M3 theme system with the help of the Material theme builder.

Fonts used: Gilroy, Roboto, Jetbrains Mono

Image attributions: Material.io and Material design blog under creative commons.


Questions

  1. Can you use dynamic colors in light mode if system is toggeled in dark states?

Yes it’s possible, you can build apps with Material 3 and Compose to specify light or dark color schemes and give the user an option to use light mode strictly, even if the OS is in dark mode. A good practice with accessibility is to let the user choose from auto, dark or light theme in your app preferences.

Use wallpaper generated system colors from Android 12 and Material You to repaint your apps to the users taste by using the material design 3 library and Jetpack compose

Droidcon Berlin 2022

  1. Is there a possible usage of dynamic colors from the OS in Android for cars? For example on dashboard UIs of the car?

It is possible with custom hardware triggering light or dark system modes and the custom colors from a given launcher background wallpaper setting up the dynamic colors on the apps. It’s a possible valid use case to match the ambiance of the car with music that is playing, day / night time drives.


My experience

With the possible new use cases for device-specific hardware and feature sets, there are exciting possibilities ahead of us.

It was amazing to see the growing interest in system development since we stepped into the Android framework, a subject bit different than the usual traditional talks that focus on the application layer. Going ahead, I hope we find more conversations focusing on Android for system development and embedded Android.

We explored the narrative of what went into building the dynamic theme feature of the Android OS. We examined the internals of Material 3 for Jetpack Compose and its usage.

As a speaker, this was my first talk in person on a stage, and it was amazing! Before the presentation, Manuel Vivo spoke about app architecture and faced technical issues. (The remote was not working and the slides kept skipping in the middle of the presentation). I faced the same challenges and it affected the pace of the talk.

Looking at the brighter side, expect more conversations and talks from me, and hope I get the chance to interact with everyone who attended the session again in the future!

Till then, feel free to reach out and share your experience, in case you use the dynamic colors or Material 3 with compose.


References, attributions & acknowledgments


Video

Watch it on Droidcon.com


About the author

Siddhesh Patil is an Android Engineer at DeliveryHero. Building core ordering experiences at Foodpanda and Foodora. He is the organzier of Kotlin Mumbai, a developer community in Mumbai, India. Find talks, articles and latest developments in Android and Kotlin on this website siddroid.com

Sid Patil is an Android Engineer and Kotlin Advocate based in Berlin, Germany. He works at Delivery Hero, building ordering experiences for food delivery and Q-commerce brands like Foodpanda and Foodora.

Share on

book

More articles to read