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
89
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Nairobi IO Extended Dark Theme
A brief overview of Androids Dark theme from Google IO 2019.
David Odari
June 15, 2019
More Decks by David Odari
See All by David Odari
Ship Faster With Feature Flags
davidodari
0
310
Getting Started with Jetpack Compose
davidodari
0
150
Persistence
davidodari
0
77
Building Trust in a Multicultural Team
davidodari
1
37
Room ORM | Workshop 2 | GADS 2020
davidodari
0
160
Android 11 Meetups: Whats New In Android
davidodari
0
440
Journey as an Android Developer
davidodari
1
170
Improve Quality of Android Apps with BDD
davidodari
0
190
Quick Intro To Kotlin Generics
davidodari
0
220
Other Decks in Programming
See All in Programming
Vite+ Unified Toolchain for the Web
naokihaba
0
280
RTSPクライアントを自作してみた話
simotin13
0
580
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
240
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
7
2.3k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
350
Oxlintのカスタムルールの現況
syumai
6
1.1k
3Dシーンの圧縮
fadis
1
740
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
260
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.6k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
210
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
780
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
960
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
430
Building the Perfect Custom Keyboard
takai
2
790
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Scaling GitHub
holman
464
140k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Navigating Team Friction
lara
192
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
140
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
250
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