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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
David Odari
June 15, 2019
Programming
0
79
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
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
Package Management Learnings from Homebrew
mikemcquaid
0
230
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
390
今から始めるClaude Code超入門
448jp
8
8.8k
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
240
Fluid Templating in TYPO3 14
s2b
0
130
AI時代の認知負荷との向き合い方
optfit
0
160
CSC307 Lecture 06
javiergs
PRO
0
690
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
190
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
We Have a Design System, Now What?
morganepeng
54
8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
New Earth Scene 8
popppiees
1
1.5k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
360
Tell your own story through comics
letsgokoyo
1
810
GitHub's CSS Performance
jonrohan
1032
470k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
290
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