Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Nairobi IO Extended Dark Theme
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
David Odari
June 15, 2019
Programming
95
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
Transcript
31 slides
| 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
More Decks by David Odari
See All by David Odari
Ship Faster With Feature Flags
davidodari
0
340
Getting Started with Jetpack Compose
davidodari
0
170
Persistence
davidodari
0
88
Building Trust in a Multicultural Team
davidodari
1
46
Room ORM | Workshop 2 | GADS 2020
davidodari
0
180
Android 11 Meetups: Whats New In Android
davidodari
0
460
Journey as an Android Developer
davidodari
1
200
Improve Quality of Android Apps with BDD
davidodari
0
210
Quick Intro To Kotlin Generics
davidodari
0
230
Other Decks in Programming
See All in Programming
祈るテストから、探索するテストへ 〜Lincheckではじめる並行処理テスト〜
yyh_gl
0
430
Getting Started with Vibe Coding
miccheng
0
250
特急いなほ as a Workflow / 20261107jaws-festa-2026-akita-lt
kasacchiful
PRO
0
110
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
420
SODA - FACT BOOK(JP)
sodainc
1
40k
Agentic AI with the Power of Jakarta EE
ivargrimstad
0
200
joyful-journey-spring-boot.pdf
hollycummins
0
100
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
120
Spec-driven Development with AI
simas
PRO
0
2.3k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
手の動かし方がわからなかった私が個人開発者になるまで
usagi0920_pochi
0
340
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.6k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
990
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
340
Navigating Team Friction
lara
192
16k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
440
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
590
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
540
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.7k