From f426a639d356b95f86a4b1c25d5d32d7edfe6328 Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Fri, 9 Sep 2022 14:16:01 +0530 Subject: [PATCH 1/2] Change app icon to our custom icon --- res/drawable/ic_launcher_background.xml | 66 +++++++-------- res/drawable/ic_launcher_foreground.xml | 106 +++++++++++++----------- res/mipmap-anydpi/ic_launcher.xml | 25 ++++-- 3 files changed, 105 insertions(+), 92 deletions(-) diff --git a/res/drawable/ic_launcher_background.xml b/res/drawable/ic_launcher_background.xml index 4b7005db..b16b69a1 100644 --- a/res/drawable/ic_launcher_background.xml +++ b/res/drawable/ic_launcher_background.xml @@ -1,47 +1,37 @@ + ~ Copyright ECORP SAS 2022 + ~ This program is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation, either version 3 of the License, or + ~ (at your option) any later version. + ~ + ~ This program is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with this program. If not, see . + --> - - - - - - - - - - - + android:pathData="M0,0h108v108h-108z"> + + + + + + + diff --git a/res/drawable/ic_launcher_foreground.xml b/res/drawable/ic_launcher_foreground.xml index e2f10e21..da55a6b1 100644 --- a/res/drawable/ic_launcher_foreground.xml +++ b/res/drawable/ic_launcher_foreground.xml @@ -1,57 +1,67 @@ + ~ Copyright ECORP SAS 2022 + ~ This program is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation, either version 3 of the License, or + ~ (at your option) any later version. + ~ + ~ This program is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with this program. If not, see . + --> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/res/mipmap-anydpi/ic_launcher.xml b/res/mipmap-anydpi/ic_launcher.xml index 3d90bc5c..18e000c2 100644 --- a/res/mipmap-anydpi/ic_launcher.xml +++ b/res/mipmap-anydpi/ic_launcher.xml @@ -1,9 +1,22 @@ + ~ Copyright ECORP SAS 2022 + ~ This program is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation, either version 3 of the License, or + ~ (at your option) any later version. + ~ + ~ This program is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with this program. If not, see . + --> - - - + + + + + \ No newline at end of file -- GitLab From 7481ec5e70be758b4b2323f1a10bd41035c3da9f Mon Sep 17 00:00:00 2001 From: Nishith Khanna Date: Mon, 10 Oct 2022 15:26:51 +0530 Subject: [PATCH 2/2] Theme app according to our palette --- Android.bp | 2 + assets/licenses.html | 2 +- res/drawable/ic_advanced_bar.xml | 25 ++ res/drawable/ic_del.xml | 2 +- res/layout-land/pad_advanced_3x5.xml | 208 ++++++++++ res/layout/activity_calculator_land.xml | 5 + res/layout/activity_calculator_port.xml | 5 + .../activity_calculator_tablet_port.xml | 5 + res/layout/fragment_history.xml | 1 - res/layout/history_item.xml | 2 +- res/layout/pad_advanced_3x5.xml | 392 +++++++++--------- res/values-night/lineage_colors.xml | 42 -- res/values-night/lineage_styles.xml | 3 + res/values/color.xml | 33 +- res/values/lineage_colors.xml | 4 +- res/values/themes.xml | 9 +- src/com/android/calculator2/Calculator.java | 1 - src/com/android/calculator2/Licenses.java | 17 + 18 files changed, 501 insertions(+), 257 deletions(-) create mode 100644 res/drawable/ic_advanced_bar.xml create mode 100644 res/layout-land/pad_advanced_3x5.xml delete mode 100644 res/values-night/lineage_colors.xml diff --git a/Android.bp b/Android.bp index 0b867ed5..8f7f7705 100644 --- a/Android.bp +++ b/Android.bp @@ -36,5 +36,7 @@ android_app { "androidx.legacy_legacy-support-v4", "androidx.gridlayout_gridlayout", "androidx.recyclerview_recyclerview", + "androidx.webkit_webkit", + "elib", ], } diff --git a/assets/licenses.html b/assets/licenses.html index 4583bf74..480c3246 100644 --- a/assets/licenses.html +++ b/assets/licenses.html @@ -1,7 +1,7 @@ - +

Notices for files:

diff --git a/res/drawable/ic_advanced_bar.xml b/res/drawable/ic_advanced_bar.xml new file mode 100644 index 00000000..89623f80 --- /dev/null +++ b/res/drawable/ic_advanced_bar.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/res/drawable/ic_del.xml b/res/drawable/ic_del.xml index f26eac24..14691140 100644 --- a/res/drawable/ic_del.xml +++ b/res/drawable/ic_del.xml @@ -21,7 +21,7 @@ android:viewportHeight="24" android:viewportWidth="24"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/layout/activity_calculator_land.xml b/res/layout/activity_calculator_land.xml index a19cd861..5a487e32 100644 --- a/res/layout/activity_calculator_land.xml +++ b/res/layout/activity_calculator_land.xml @@ -26,6 +26,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" /> + + + + + + diff --git a/res/layout/history_item.xml b/res/layout/history_item.xml index cf8b6c06..4b319df8 100644 --- a/res/layout/history_item.xml +++ b/res/layout/history_item.xml @@ -42,7 +42,7 @@ android:paddingStart="@dimen/result_padding_start" android:paddingEnd="@dimen/result_padding_end" android:text="@string/title_current_expression" - android:textColor="?android:attr/colorAccent" + android:textColor="?android:attr/textColorPrimary" android:textSize="14dp" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:orientation="horizontal" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@color/pad_advanced_background_color" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/values-night/lineage_colors.xml b/res/values-night/lineage_colors.xml deleted file mode 100644 index bfda51b6..00000000 --- a/res/values-night/lineage_colors.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - #212121 - - - #000000 - - - #1E1E1E - - - @android:color/white - - - #6CFFFFFF - - - #40FFFFFF - - - @android:color/white - - - #33FFFFFF - diff --git a/res/values-night/lineage_styles.xml b/res/values-night/lineage_styles.xml index 9d9eb6b9..90016c79 100644 --- a/res/values-night/lineage_styles.xml +++ b/res/values-night/lineage_styles.xml @@ -20,7 +20,10 @@ @color/calculator_primary_color @color/calculator_accent_color @color/calculator_statusbar_color + @color/navigationBar_color stateAlwaysHidden + false + false - + + diff --git a/src/com/android/calculator2/Calculator.java b/src/com/android/calculator2/Calculator.java index 81ab1f65..d765e055 100644 --- a/src/com/android/calculator2/Calculator.java +++ b/src/com/android/calculator2/Calculator.java @@ -520,7 +520,6 @@ public class Calculator extends Activity ContextCompat.getColor(this, R.color.calculator_error_color); mFormulaText.setTextColor(errorColor); mResultText.setTextColor(errorColor); - getWindow().setStatusBarColor(errorColor); } else if (mCurrentState != CalculatorState.RESULT) { mFormulaText.setTextColor( ContextCompat.getColor(this, R.color.display_formula_text_color)); diff --git a/src/com/android/calculator2/Licenses.java b/src/com/android/calculator2/Licenses.java index 4af1ea6d..81bf117e 100644 --- a/src/com/android/calculator2/Licenses.java +++ b/src/com/android/calculator2/Licenses.java @@ -4,6 +4,10 @@ import android.app.Activity; import android.os.Bundle; import android.view.MenuItem; import android.webkit.WebView; +import android.content.res.Configuration; +import androidx.webkit.WebViewFeature; +import androidx.webkit.WebSettingsCompat; + public class Licenses extends Activity { @@ -17,6 +21,19 @@ public class Licenses extends Activity { webView.loadUrl(LICENSE_URL); setContentView(webView); + + if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) { + switch (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) { + case Configuration.UI_MODE_NIGHT_YES: + WebSettingsCompat.setForceDark(webView.getSettings(), WebSettingsCompat.FORCE_DARK_ON); + break; + case Configuration.UI_MODE_NIGHT_NO: + case Configuration.UI_MODE_NIGHT_UNDEFINED: + WebSettingsCompat.setForceDark(webView.getSettings(), WebSettingsCompat.FORCE_DARK_OFF); + break; + } +} + } @Override -- GitLab