Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Fix theming
Browse files Browse the repository at this point in the history
  • Loading branch information
vase4kin committed Mar 19, 2020
1 parent 8c0a650 commit 31b36e3
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
android:theme="@style/Theme.MyApp" />
<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
android:theme="@style/Theme.MaterialComponents.DayNight.DarkActionBar"/>
android:theme="@style/OssTheme.MyApp" />
<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
android:theme="@style/Theme.MaterialComponents.DayNight.DarkActionBar"/>
android:theme="@style/OssTheme.MyApp" />

<provider
android:name="androidx.core.content.FileProvider"
Expand Down
37 changes: 37 additions & 0 deletions libraries/theme/src/main/res/values-night/themes-oss-licenses.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2020 Andrey Tolpeev
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<style name="OssTheme.MyApp" parent="Base.OssTheme">
<!--Material color attributes (dark theme) -->
<item name="colorPrimary">@color/indigo_200</item>
<item name="colorPrimaryVariant">@color/indigo_600</item>
<item name="colorSecondary">@color/cyan_200</item>
<item name="colorSecondaryVariant">@color/cyan_500</item>
<item name="android:colorBackground">@color/black_900</item>
<item name="colorSurface">@color/black_800</item>
<item name="colorError">@color/red_200</item>
<item name="colorOnPrimary">@color/white_50</item>
<item name="colorOnSecondary">@color/black_900</item>
<item name="colorOnBackground">@color/white_50</item>
<item name="colorOnSurface">@color/white_50</item>
<item name="colorOnError">@color/black_900</item>
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">false</item>
</style>

</resources>
56 changes: 56 additions & 0 deletions libraries/theme/src/main/res/values/themes-oss-licenses.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright 2020 Andrey Tolpeev
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<resources xmlns:tools="http://schemas.android.com/tools">

<style name="OssTheme.MyApp" parent="Base.OssTheme">
<!--Material color attributes (light theme) -->
<!--colorPrimary colors map to components and elements, such as app bars and buttons. -->
<!--colorSecondary colors are most often used as accents on components, such as FABs and -->
<!--selection controls.-->
<item name="colorPrimary">@color/blue_500</item>
<item name="colorPrimaryVariant">@color/blue_700</item>
<item name="colorSecondary">@color/green_200</item>
<item name="colorSecondaryVariant">@color/green_500</item>
<!--colorBackground appears behind scrollable content and is used for the default window-->
<!--background. colorSurface is mapped to the surface of components such as cards, sheets-->
<!--and menus. colorError is used to indicate an error state for components such as-->
<!--text fields.-->
<item name="android:colorBackground">@color/white_50</item>
<item name="colorSurface">@color/white_50</item>
<item name="colorError">@color/red_600</item>
<!--"On" colors define how text, icons and strokes are colored in relation to the surface-->
<!--on which they appear.-->
<item name="colorOnPrimary">@color/white_50</item>
<item name="colorOnSecondary">@color/white_50</item>
<item name="colorOnBackground">@color/black_900</item>
<item name="colorOnSurface">@color/black_900</item>
<item name="colorOnError">@color/white_50</item>
</style>

<style name="Base.OssTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<item name="android:statusBarColor" tools:ignore="NewApi">?attr/colorPrimarySurface</item>
<item name="android:windowLightStatusBar" tools:ignore="NewApi">true</item>
<item name="android:navigationBarColor" tools:ignore="NewApi">
?android:attr/colorBackground
</item>
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item>
<item name="android:navigationBarDividerColor" tools:ignore="NewApi">
?attr/colorControlHighlight
</item>
</style>

</resources>

0 comments on commit 31b36e3

Please sign in to comment.