Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Nairobi IO Extended Dark Theme
Search
David Odari
June 15, 2019
Programming
0
80
Nairobi IO Extended Dark Theme
A brief overview of Androids Dark theme from Google IO 2019.
David Odari
June 15, 2019
Tweet
Share
More Decks by David Odari
See All by David Odari
Ship Faster With Feature Flags
davidodari
0
300
Getting Started with Jetpack Compose
davidodari
0
140
Persistence
davidodari
0
67
Building Trust in a Multicultural Team
davidodari
1
31
Room ORM | Workshop 2 | GADS 2020
davidodari
0
160
Android 11 Meetups: Whats New In Android
davidodari
0
420
Journey as an Android Developer
davidodari
1
160
Improve Quality of Android Apps with BDD
davidodari
0
180
Quick Intro To Kotlin Generics
davidodari
0
210
Other Decks in Programming
See All in Programming
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
250
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
160
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
3
1.2k
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
120
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
180
最初からAWS CDKで技術検証してもいいんじゃない?
akihisaikeda
4
160
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
120
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1.1k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
670
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
240
コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions
handlename
0
220
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
331
21k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
A Soul's Torment
seathinner
5
2.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Designing Experiences People Love
moore
143
24k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Building the Perfect Custom Keyboard
takai
2
710
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
180
Designing for Timeless Needs
cassininazir
0
170
Transcript
| Dark Theme
David Odari IT Student at Jkuat, Android Developer
| Dark Theme
A contrast of material theme with dark background colors and
light foreground colors.
System wide dark mode. Android Q
• Save On Battery • Accessibility • Low Light Environment
Why DarkTheme ?
Force Dark Rapid Adoption Of Dark Theme on API 29+,
Q. NEW IN Q
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:forceDarkAllowed">true</item> </style> <ImageView …. android:forceDarkAllowed =
“false” />
None
Custom Dark Theme
DayNight AppCompat and MDC
<style name="AppTheme" parent="Theme.AppCompat.DayNight"> Or <style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
AppCompat Material Components
Theme Attributes Avoid Hard Coding Values
values/themes.xml <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar"> values-night/themes.xml <style name="AppTheme" parent="Theme.MaterialComponents.DarkActionBar">
Modes
Tell Appcompat what mode to use with; AppCompatDelegate.setDefaultNightMode() getDelegate().setLocalNightMode()
Available Modes //Always Dark Themed MODE_NIGHT_YES //Always Light Themed MODE_NIGHT_NO
//Uses Current System Setting ( For Q and Above) MODE_NIGHT_FOLLOW_SYSTEM //Switches to dark theme when battery saver is activated MODE_NIGHT_AUTO_BATTERY
//Changes between day/night based on the time of day. MODE_NIGHT_AUTO_TIME
DEPRECATED
Theme Settings
Android P and Below Light Dark Set By Battery Saver
Android Q and Above Light Dark System Default
Elevation
Elevation will not work on Dark Theme. Elevation overlays solve
this by applying the concept of surfaces becoming lighter with higher elevation. Overlays surface of components with colorSurface attribute.
• Material Shape Drawable • ElevationOverlayProvider Custom Views
Configuration
Triggers the uiMode configuration change Activity declares it can handle
<activity ... android:configChanges="uiMode" /> onConfigurationChanged() method will be called
fun checkDarkThemeMode(context: Context) : String { val mode = context.resources.configuration.uiMode.and(
Configuration.UI_MODE_NIGHT_MASK) return when(mode){ Configuration.UI_MODE_NIGHT_NO -> “Light Theme” Configuration.UI_MODE_NIGHT_YES -> “Dark Theme” Configuration.UI_MODE_NIGHT_UNDEFINED -> “Unknown Mode” } }
Illustrations Use theme attributes or provide a variant for each
theme for vector assets.
Notifications Work Out the Box with system provided templates
Demo /Davidodari/NightKing @_davidodari