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

Commit

Permalink
Hardcode text color to always match AOSP
Browse files Browse the repository at this point in the history
  • Loading branch information
amirzaidi committed Apr 7, 2018
1 parent 8134fd1 commit f2e3e96
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 4 deletions.
21 changes: 21 additions & 0 deletions res/color/primary_text_material_dark.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:alpha="@dimen/disabled_alpha_material_dark"
android:color="@color/textColorPrimary"/>
<item android:color="@color/textColorPrimary"/>
</selector>
21 changes: 21 additions & 0 deletions res/color/primary_text_material_light.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:alpha="@dimen/disabled_alpha_material_light"
android:color="@color/textColorPrimaryInverse"/>
<item android:color="@color/textColorPrimaryInverse"/>
</selector>
21 changes: 21 additions & 0 deletions res/color/secondary_text_material_dark.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:alpha="@dimen/disabled_alpha_material_dark"
android:color="@color/textColorSecondary"/>
<item android:color="@color/textColorSecondary"/>
</selector>
21 changes: 21 additions & 0 deletions res/color/secondary_text_material_light.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:alpha="@dimen/disabled_alpha_material_light"
android:color="@color/textColorSecondaryInverse"/>
<item android:color="@color/textColorSecondaryInverse"/>
</selector>
2 changes: 2 additions & 0 deletions res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<color name="all_apps_bg_hand_fill_dark">#9AA0A6</color>

<!-- Backports -->
<color name="textColorPrimary">#ffffffff</color>
<color name="textColorSecondary">#ffffffff</color>
<color name="textColorPrimaryInverse">#de000000</color>
<color name="textColorSecondaryInverse">#8a000000</color>

Expand Down
4 changes: 4 additions & 0 deletions res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@
<!-- Approximates the system status bar height. Not guaranteed to be always be correct. -->
<dimen name="status_bar_height">24dp</dimen>

<!-- Backports -->
<item name="disabled_alpha_material_dark" format="float" type="dimen">0.30</item>
<item name="disabled_alpha_material_light" format="float" type="dimen">0.26</item>

<!-- Pixel -->
<dimen name="smartspace_title_size">24dp</dimen>
<dimen name="smartspace_horizontal_padding">56dp</dimen>
Expand Down
20 changes: 16 additions & 4 deletions res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
<item name="workspaceKeyShadowColor">#44000000</item>
<item name="workspaceStatusBarScrim">@drawable/workspace_bg</item>
<item name="widgetsTheme">@style/WidgetContainerTheme</item>

<!-- Backports -->
<item name="android:textColorPrimary">@color/primary_text_material_light</item>
<item name="android:textColorSecondary">@color/secondary_text_material_light</item>
<item name="android:textColorPrimaryInverse">?android:attr/textColorPrimary</item>
<item name="android:textColorSecondaryInverse">?android:attr/textColorSecondary</item>

<item name="android:colorPrimary">@color/colorPrimary</item>
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:colorAccent">@color/colorAccent</item>
</style>

Expand All @@ -57,8 +66,6 @@
</style>

<style name="LauncherThemeDark" parent="@style/LauncherTheme">
<item name="android:textColorPrimary">#FFFFFFFF</item>
<item name="android:textColorSecondary">#FFFFFFFF</item>
<item name="android:textColorTertiary">#CCFFFFFF</item>
<item name="android:textColorHint">#A0FFFFFF</item>
<item name="android:colorControlHighlight">#A0FFFFFF</item>
Expand All @@ -70,6 +77,10 @@
<item name="popupColorTertiary">#757575</item> <!-- Gray 600 -->
<item name="widgetsTheme">@style/WidgetContainerTheme.Dark</item>
<item name="isMainColorDark">true</item>

<!-- Backports -->
<item name="android:textColorPrimary">@color/primary_text_material_dark</item>
<item name="android:textColorSecondary">@color/secondary_text_material_dark</item>
</style>

<!--
Expand All @@ -91,8 +102,9 @@
<item name="bottomSheetNavBarColor">@color/all_apps_navbar_color</item>

<!-- Backports -->
<item name="android:textColorPrimaryInverse">@color/textColorPrimaryInverse</item>
<item name="android:textColorSecondaryInverse">@color/textColorSecondaryInverse</item>
<item name="android:textColorPrimaryInverse">@color/primary_text_material_light</item>
<item name="android:textColorSecondaryInverse">@color/secondary_text_material_light</item>

<item name="android:colorPrimary">@color/colorPrimary</item>
<item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="android:colorAccent">@color/colorAccent</item>
Expand Down

0 comments on commit f2e3e96

Please sign in to comment.