Commit e4503659 authored by Joey's avatar Joey

ExactCalculator: support dark mode

Works with StylesAPI

Change-Id: I8b2fa37e84baaae2fe390e897c494a1aa90e590f
Signed-off-by: default avatarJoey <joey@lineageos.org>
parent 64ba4338
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS 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.
-->
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:width="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="@color/pad_button_text_color"
android:pathData="M19,15.59L17.59,17L14,13.41L10.41,17L9,15.59L12.59,12L9,8.41
L10.41,7L14,10.59L17.59,7L19,8.41L15.41,12L19,15.59M22,3A2,2 0 0,1 24,5V19A2,2 0 0,1 22,21
H7C6.31,21 5.77,20.64 5.41,20.11L0,12L5.41,3.88C5.77,3.35 6.31,3 7,3H22M22,5
H7L2.28,12L7,19H22V5Z" />
</vector>
......@@ -32,7 +32,7 @@
android:navigationContentDescription="@string/desc_navigate_up"
android:navigationIcon="?android:attr/homeAsUpIndicator"
android:popupTheme="@android:style/ThemeOverlay.Material.Light"
android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar"
android:theme="@style/Theme.Toolbar"
android:title="@string/title_history" />
<androidx.recyclerview.widget.RecyclerView
......
......@@ -24,11 +24,11 @@
app:rowCount="5"
app:columnCount="1">
<Button
<ImageButton
android:id="@+id/del"
style="@style/PadButtonStyle.Operator.Text"
style="@style/PadButtonStyle.Operator"
android:contentDescription="@string/desc_del"
android:text="@string/del"
android:src="@drawable/ic_del"
app:layout_row="0"
app:layout_column="0" />
......
......@@ -32,11 +32,11 @@
app:layout_row="0"
app:layout_column="0" />
<Button
<ImageButton
android:id="@+id/del"
style="@style/PadButtonStyle.Operator.Text"
style="@style/PadButtonStyle.Operator"
android:contentDescription="@string/desc_del"
android:text="@string/del"
android:src="@drawable/ic_del"
app:layout_row="0"
app:layout_column="1" />
......
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS 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.
-->
<resources>
<!-- Primary color (Color for the toolbars). -->
<color name="calculator_primary_color">#212121</color>
<!-- Status bar color. -->
<color name="calculator_statusbar_color">#000000</color>
<!-- Background color for the operator pad. -->
<color name="pad_operator_background_color">#1E1E1E</color>
<!-- Text color for the formula in the calculator display. -->
<color name="display_formula_text_color">@android:color/white</color>
<!-- Text color for the result in the calculator display. -->
<color name="display_result_text_color">#6CFFFFFF</color>
<!-- Lighter color for exponent while scrolling. -->
<color name="display_result_exponent_text_color">#40FFFFFF</color>
<!-- Text color for a button in a pad. -->
<color name="pad_button_text_color">@android:color/white</color>
<!-- Ripple color when a button is pressed in a pad. -->
<color name="pad_button_ripple_color">#33FFFFFF</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS 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.
-->
<resources>
<style name="Theme" parent="@android:style/Theme.Material">
<item name="android:colorPrimary">@color/calculator_primary_color</item>
<item name="android:colorAccent">@color/calculator_accent_color</item>
<item name="android:statusBarColor">@color/calculator_statusbar_color</item>
<item name="android:windowSoftInputMode">stateAlwaysHidden</item>
</style>
<style name="Theme.Toolbar" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar" />
</resources>
......@@ -18,19 +18,19 @@
<resources>
<!-- Default accent color. -->
<color name="calculator_accent_color">#0097A7</color>
<color name="calculator_accent_color">#167c80</color>
<!-- Primary color (Color for the toolbars). -->
<color name="calculator_primary_color">#00BCD4</color>
<color name="calculator_primary_color">#fafafa</color>
<!-- Status bar color. -->
<color name="calculator_statusbar_color">#0096A9</color>
<color name="calculator_statusbar_color">#f0f0f0</color>
<!-- Color to indicate an error has occured. -->
<color name="calculator_error_color">#C2185B</color>
<color name="calculator_error_color">#d0422d</color>
<!-- Background color of the calculator display. -->
<color name="display_background_color">#FFF</color>
<color name="display_background_color">@color/calculator_primary_color</color>
<!-- Text color for the formula in the calculator display. -->
<color name="display_formula_text_color">#000000</color>
......@@ -42,27 +42,27 @@
<color name="display_result_exponent_text_color">#40000000</color>
<!-- Background color for the numeric pad. -->
<color name="pad_numeric_background_color">#434343</color>
<color name="pad_numeric_background_color">@color/calculator_primary_color</color>
<!-- Background color for the operator pad. -->
<color name="pad_operator_background_color">#636363</color>
<color name="pad_operator_background_color">@color/calculator_statusbar_color</color>
<!-- Background color for the advanced pad. -->
<color name="pad_advanced_background_color">#1DE9B6</color>
<color name="pad_advanced_background_color">@color/calculator_accent_color</color>
<!-- Text color for a button in a pad. -->
<color name="pad_button_text_color">#FFF</color>
<color name="pad_button_text_color">#333</color>
<!-- Text color for a button in the advanced pad. -->
<color name="pad_button_advanced_text_color">#99000000</color>
<color name="pad_button_advanced_text_color">@android:color/white</color>
<!-- Ripple color when a button is pressed in a pad. -->
<color name="pad_button_ripple_color">#33FFFFFF</color>
<color name="pad_button_ripple_color">#33000000</color>
<!-- Ripple color when a button is pressed in a pad. -->
<color name="pad_button_advanced_ripple_color">#1A000000</color>
<!-- Background color for empty history view. -->
<color name="empty_history_color">#EEEEEE</color>
<color name="empty_history_color">@color/calculator_primary_color</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS 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.
-->
<resources>
<color name="navigationBar_color">@android:color/white</color>
<color name="navigationBar_divider">#1f000000</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2018 The LineageOS 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.
-->
<resources>
<style name="Theme.Toolbar" parent="@android:style/ThemeOverlay.Material.ActionBar" />
</resources>
......@@ -17,11 +17,15 @@
<resources>
<style name="Theme" parent="@android:style/Theme.Material.Light.DarkActionBar">
<style name="Theme" parent="@android:style/Theme.Material.Light">
<item name="android:colorPrimary">@color/calculator_primary_color</item>
<item name="android:colorAccent">@color/calculator_accent_color</item>
<item name="android:statusBarColor">@color/calculator_accent_color</item>
<item name="android:statusBarColor">@color/calculator_statusbar_color</item>
<item name="android:windowSoftInputMode">stateAlwaysHidden</item>
<item name="android:navigationBarColor">@color/navigationBar_color</item>
<item name="android:navigationBarDividerColor">@color/navigationBar_divider</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar">true</item>
</style>
<style name="Theme.Calculator">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment