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
75
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
290
Getting Started with Jetpack Compose
davidodari
0
140
Persistence
davidodari
0
64
Building Trust in a Multicultural Team
davidodari
1
28
Room ORM | Workshop 2 | GADS 2020
davidodari
0
160
Android 11 Meetups: Whats New In Android
davidodari
0
370
Journey as an Android Developer
davidodari
1
150
Improve Quality of Android Apps with BDD
davidodari
0
180
Quick Intro To Kotlin Generics
davidodari
0
200
Other Decks in Programming
See All in Programming
Flutter로 Gemini와 MCP를 활용한 Agentic App 만들기 - 박제창 2025 I/O Extended Seoul
itsmedreamwalker
0
140
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
420
[DevinMeetupTokyo2025] コード書かせないDevinの使い方
takumiyoshikawa
2
280
AIに安心して任せるためにTypeScriptで一意な型を作ろう
arfes0e2b3c
0
370
ワープロって実は計算機で
pepepper
2
1.3k
変化を楽しむエンジニアリング ~ いままでとこれから ~
murajun1978
0
730
バイブコーディング × 設計思考
nogu66
0
120
未来を拓くAI技術〜エージェント開発とAI駆動開発〜
leveragestech
2
150
tool ディレクティブを導入してみた感想
sgash708
1
120
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
3
610
AIレビュアーをスケールさせるには / Scaling AI Reviewers
technuma
2
200
兎に角、コードレビュー
mitohato14
0
130
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Mobile First: as difficult as doing things right
swwweet
223
9.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
50
5.5k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
How STYLIGHT went responsive
nonsquared
100
5.7k
Site-Speed That Sticks
csswizardry
10
770
Code Review Best Practice
trishagee
69
19k
Become a Pro
speakerdeck
PRO
29
5.5k
Making Projects Easy
brettharned
117
6.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Scaling GitHub
holman
462
140k
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