Skip to content
Permalink
Browse files

Styling fixes for Dark Mode

It's not perfect yet, but this CL makes it a whole lot
more usable.

Change-Id: I431ea21da4d2fbafcea2b894983fcdffc7f31c1c
  • Loading branch information...
chrisbanes authored and thagikura committed Feb 11, 2019
1 parent c635ca7 commit 317e0f98020ce10507cb3c6594c2133e139c4277
@@ -21,7 +21,7 @@
android:height="100dp"
android:viewportWidth="70"
android:viewportHeight="50"
android:tint="#e1e1e1">
android:tint="?attr/colorControlLight">
<path
android:fillColor="#fff"
android:pathData="M30.85,0l-11,49.3l2.76,0.62l11,-49.3z M0,42.09l17.76,0l0,-35.36l-17.76,0z M50.88,5.26C40.34,5.26 31.8,13.81 31.8,24.36C31.8,34.91 40.34,43.46 50.88,43.46C61.42,43.46 69.96,34.91 69.96,24.36C69.96,13.81 61.42,5.26 50.88,5.26" />
@@ -17,7 +17,7 @@

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@color/white" />
<item android:drawable="?attr/colorSurface" />

<item
android:drawable="@drawable/io_logo"
@@ -15,8 +15,7 @@
~ limitations under the License.
-->

<shape
xmlns:android="http://schemas.android.com/apk/res/android"
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/light_grey" />
<solid android:color="@color/color_control_light" />
</shape>
@@ -17,5 +17,5 @@
<size
android:width="1dp"
android:height="1dp" />
<solid android:color="@color/light_grey" />
<solid android:color="@color/color_control_light" />
</shape>
@@ -38,8 +38,6 @@
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/navigation_header"
app:itemIconTint="@color/nav_item"
app:itemTextColor="@color/nav_item"
app:menu="@menu/navigation" />

<com.google.samples.apps.iosched.widget.FadingSnackbar
@@ -39,7 +39,7 @@
style="@style/Widget.AppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white_90">
android:background="?attr/colorSurface">

<TextView
android:id="@+id/title"
@@ -80,6 +80,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="60dp"
android:background="@drawable/filters_sheet_background"
android:backgroundTint="?attr/colorSurface"
android:elevation="@dimen/bottom_sheet_elevation"
app:layout_behavior="com.google.samples.apps.iosched.widget.BottomSheetBehavior"
app:behavior_hideable="true"
@@ -61,7 +61,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:indeterminate="true"
android:indeterminateTint="@color/light_grey"
android:indeterminateTint="?attr/colorControlLight"
app:goneUnless="@{viewModel.isLoading}" />

<!-- A custom snackbar implementation for more control over positioning i.e. above the
@@ -82,7 +82,6 @@
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/margin_normal"
android:contentDescription="@string/filters"
app:fabSize="auto"
app:hoveredFocusedTranslationZ="0dp"
app:pressedTranslationZ="0dp"
app:srcCompat="@drawable/ic_filter" />
@@ -122,7 +122,7 @@
android:contentDescription="@string/a11y_clear_tag_filters"
android:onClick="@{(v) -> viewModel.clearFilters()}"
android:scaleType="center"
android:tint="@color/dark_gray"
android:tint="?attr/colorControlNormal"
app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -187,7 +187,7 @@
android:clickable="@{headerAlpha > 0f}"
android:contentDescription="@string/a11y_collapse_filters_sheet"
android:scaleType="center"
android:tint="@color/dark_gray"
android:tint="?attr/colorControlNormal"
app:layout_constraintBottom_toTopOf="@id/guide_peek_height"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
@@ -75,12 +75,13 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_anchor="@id/session_detail_bottom_app_bar"
app:backgroundTint="@color/white"
app:backgroundTint="?attr/colorSurface"
app:eventListener="@{viewModel}"
app:isRegistered="@{viewModel.observeRegisteredUser}"
app:isReservable="@{viewModel.session.isReservable}"
app:isReservationDisabled="@{viewModel.isReservationDisabled}"
app:isSignedIn="@{viewModel.observeSignedInUser}"
app:tint="?attr/colorOnSurface"
app:userEvent="@{viewModel.userEvent}" />

<!-- A custom snackbar implementation for more control over positioning i.e. above the FAB,
@@ -37,6 +37,7 @@
android:background="?selectableItemBackground"
android:paddingEnd="@dimen/margin_normal"
android:paddingVertical="@dimen/spacing_micro"
android:theme="@style/ThemeOverlay.AppCompat.Light"
tools:ignore="RtlSymmetry,UnusedAttribute">

<include
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 Google LLC
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
~ limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?android:textColorPrimary" android:state_checked="true" />
<item android:color="?android:textColorSecondary" />
</selector>
<resources>
<!-- Same value as textColorPrimary disabled -->
<color name="color_control_light">#4DFFFFFF</color>
</resources>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 Google LLC
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 Google LLC
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -15,7 +15,6 @@
~ limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?android:textColorPrimary" android:state_selected="true" />
<item android:color="?android:textColorSecondary" />
</selector>
<resources>
<bool name="use_light_status">true</bool>
</resources>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 Google LLC
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -34,6 +34,9 @@

<attr name="eventFilterViewStyle" format="reference" />


<attr name="colorControlLight" format="reference" />

<declare-styleable name="TimeHeader">
<attr name="android:width" />
<attr name="android:paddingTop" />
@@ -17,13 +17,11 @@

<resources>
<color name="status_bar">#202124</color>
<color name="text_color_tertiary">#dadce0</color>
<color name="light_grey">#e6e6e6</color>
<color name="default_tag_color">#999</color>
<color name="highlight_light">#33ffffff</color> <!-- 20% white -->
<color name="scrim">#33000000</color> <!-- 20% black -->
<color name="indigo_transparent">#e54768fd</color> <!-- 90% indigo -->
<color name="dark_gray">#ff808080</color>
<!-- Same value as textColorPrimary disabled -->
<color name="color_control_light">#39000000</color>

<integer-array name="swipe_refresh">
<item>@color/indigo</item>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 2018 Google LLC
~ Copyright 2019 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
@@ -15,11 +15,6 @@
~ limitations under the License.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item
android:color="?android:textColorPrimary"
android:state_checked="true" />
<item android:color="?android:textColorSecondary" />

</selector>
<resources>
<bool name="use_light_status">false</bool>
</resources>
@@ -22,14 +22,15 @@
<item name="colorPrimary">@color/indigo</item>
<item name="colorAccent">@color/indigo</item>
<item name="colorControlActivated">?colorPrimary</item>
<item name="colorControlLight">@color/color_control_light</item>

<item name="toolbarStyle">@style/Widget.Toolbar</item>
<item name="tabStyle">@style/Widget.IOSched.Tabs</item>

<item name="android:textViewStyle">@style/Widget.IOSched.TextView</item>
<item name="android:statusBarColor">@color/status_bar</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">true</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">@bool/use_light_status</item>
<item name="android:navigationBarColor">@color/indigo_dark</item>
<item name="android:textColorTertiary">@color/text_color_tertiary</item>

<item name="sessionListKeyline">@dimen/session_keyline</item>
<item name="eventFilterViewStyle">@style/Widget.IOSched.EventFilters</item>
@@ -151,21 +152,10 @@

<style name="TextAppearance.IOSched.Tab" parent="@style/TextAppearance.Design.Tab">
<item name="android:fontFamily">@font/google_sans</item>
<item name="android:textColor">@color/tab_text</item>
<item name="android:textStyle">bold</item>
<item name="textAllCaps">false</item>
</style>

<style name="TextAppearance.IOSched.BottomNavigationView" parent="@style/TextAppearance.AppCompat.Caption">
<item name="android:fontFamily">@font/google_sans</item>
<item name="android:textColor">@color/bottom_nav_item</item>
</style>

<style name="TextAppearance.IOSched.BottomNavigationView.Active">
<item name="android:textStyle">bold</item>
<item name="android:textSize">14sp</item>
</style>

<style name="TextAppearance.IOSched.H1" parent="@style/TextAppearance.AppCompat.Headline">
<item name="android:fontFamily">@font/google_sans</item>
<item name="android:textColor">?android:textColorPrimary</item>
@@ -218,14 +208,6 @@

<style name="Widget.IOSched" parent="@android:style/Widget" />

<style name="Widget.IOSched.BottomNav" parent="@style/Widget.MaterialComponents.BottomNavigationView.Colored">
<item name="itemIconTint">@color/bottom_nav_item</item>
<item name="itemTextAppearanceActive">@style/TextAppearance.IOSched.BottomNavigationView.Active</item>
<item name="itemTextAppearanceInactive">@style/TextAppearance.IOSched.BottomNavigationView</item>
<item name="labelVisibilityMode">selected</item>
<item name="android:theme">@style/ThemeOverlay.MaterialComponents.Dark</item>
</style>

<style name="Widget.IOSched.Tabs" parent="@style/Widget.MaterialComponents.TabLayout">
<item name="tabTextAppearance">@style/TextAppearance.IOSched.Tab</item>
<item name="tabIndicator">@drawable/tab_indicator</item>
@@ -308,7 +290,7 @@
</style>

<style name="Widget.IOSched.HeaderGrid">
<item name="android:color">@color/light_grey</item>
<item name="android:color">?attr/colorControlLight</item>
<item name="gridSize">8dp</item>
<item name="gridStrokeWidth">1dp</item>
</style>
@@ -336,12 +318,11 @@
<style name="TextAppearance.IOSched.InfoEventTitle" parent="@style/TextAppearance.AppCompat.Title">
<item name="android:textSize">24sp</item>
<item name="android:fontFamily">@font/google_sans</item>
<item name="android:textColor">@color/grey_800</item>
</style>

<style name="TextAppearance.IOSched.InfoEventDescription" parent="@style/TextAppearance.AppCompat.Body1">
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/grey_800</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:lineSpacingExtra">8sp</item>
</style>

@@ -353,7 +334,7 @@
<item name="android:background">?selectableItemBackground</item>
<item name="android:padding">@dimen/margin_normal</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">@color/grey_800</item>
<item name="android:textColor">?android:attr/textColorSecondary</item>
</style>

<style name="TextAppearance.IOSched.AboutButtons" parent="@style/TextAppearance.MaterialComponents.Button">
@@ -23,9 +23,5 @@
<color name="light_blue">#27e5fd</color>
<color name="yellow">#fcd230</color>
<color name="orange">#ff6c00</color>
<color name="white">#fff</color>
<color name="grey_800">#424242</color>
<color name="grey_600">#747474</color>
<color name="spacer_grey">#e0e0e0</color>
<color name="white_90">#e6ffffff</color>
<color name="white">#fff</color>or>
</resources>

0 comments on commit 317e0f9

Please sign in to comment.
You can’t perform that action at this time.