diff --git a/Android.mk b/Android.mk
index e4796b9fef19f6f3ccecfe9441ac8d6f3227558f..607068252210347e36db7f7e5cb404762cf140cd 100644
--- a/Android.mk
+++ b/Android.mk
@@ -34,5 +34,6 @@ LOCAL_STATIC_JAVA_LIBRARIES := cr
LOCAL_STATIC_ANDROID_LIBRARIES += androidx.legacy_legacy-support-v4
LOCAL_STATIC_ANDROID_LIBRARIES += androidx.gridlayout_gridlayout
LOCAL_STATIC_ANDROID_LIBRARIES += androidx.recyclerview_recyclerview
+LOCAL_STATIC_ANDROID_LIBRARIES += androidx.webkit_webkit
include $(BUILD_PACKAGE)
diff --git a/res/layout/fragment_history.xml b/res/layout/fragment_history.xml
index 0559c8719192495cabd8169915bc086236952baf..236c94c03c2793fcd2716a7e417bbc66fd18312f 100644
--- a/res/layout/fragment_history.xml
+++ b/res/layout/fragment_history.xml
@@ -31,7 +31,7 @@
android:minHeight="?android:attr/actionBarSize"
android:navigationContentDescription="@string/desc_navigate_up"
android:navigationIcon="?android:attr/homeAsUpIndicator"
- android:popupTheme="@android:style/ThemeOverlay.Material.Light"
+ android:popupTheme="@style/Theme.Toolbar.Popup"
android:theme="@style/Theme.Toolbar"
android:title="@string/title_history" />
diff --git a/res/values-night/lineage_colors.xml b/res/values-night/lineage_colors.xml
index bfda51b606d6b67a69d49d37e5f79b83e12ff573..2222e36f82841a6bbc02896f47d8484398105be0 100644
--- a/res/values-night/lineage_colors.xml
+++ b/res/values-night/lineage_colors.xml
@@ -39,4 +39,13 @@
#33FFFFFF
+
+
+ #131313
+
+
+ #CCFFFFFF
+
+
+ #1AFFFFFF
diff --git a/res/values-night/lineage_styles.xml b/res/values-night/lineage_styles.xml
index 9d9eb6b9151f28db482cbe2e481e3c1ba23c2568..a85465434255ea4cc125541f8934ea628ff23089 100644
--- a/res/values-night/lineage_styles.xml
+++ b/res/values-night/lineage_styles.xml
@@ -24,4 +24,5 @@
+
diff --git a/res/values/color.xml b/res/values/color.xml
index f4b19e613c02252901b7aa8950b569a15e78985e..82a90125abb222cc136897126233adc134b297d7 100644
--- a/res/values/color.xml
+++ b/res/values/color.xml
@@ -48,7 +48,7 @@
@color/calculator_statusbar_color
- #ececec
+ @lineageos.platform:color/color_default_deep_grey
#333
diff --git a/res/values/lineage_styles.xml b/res/values/lineage_styles.xml
index 1054f936e2a10bc2c1b7080de78d1bd77d36327b..494c808d611308e7f2d675ed6c646d01dad01622 100644
--- a/res/values/lineage_styles.xml
+++ b/res/values/lineage_styles.xml
@@ -17,4 +17,5 @@
+
diff --git a/src/com/android/calculator2/Licenses.java b/src/com/android/calculator2/Licenses.java
index 4af1ea6d09bb8f45364033c19a1d9f34298289c2..9fa6ca4eda09ddfd1a91de15d747262a1790b97f 100644
--- a/src/com/android/calculator2/Licenses.java
+++ b/src/com/android/calculator2/Licenses.java
@@ -1,10 +1,15 @@
package com.android.calculator2;
import android.app.Activity;
+import android.content.res.Configuration;
+import android.os.Build;
import android.os.Bundle;
import android.view.MenuItem;
import android.webkit.WebView;
+import androidx.webkit.WebViewFeature;
+import androidx.webkit.WebSettingsCompat;
+
public class Licenses extends Activity {
private static final String LICENSE_URL = "file:///android_asset/licenses.html";
@@ -17,6 +22,18 @@ public class Licenses extends Activity {
webView.loadUrl(LICENSE_URL);
setContentView(webView);
+
+ handleDayNightMode(webView);
+ }
+
+ private void handleDayNightMode(WebView webView) {
+ if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
+ if (isInDarkMode()) {
+ WebSettingsCompat.setForceDark(webView.getSettings(), WebSettingsCompat.FORCE_DARK_ON);
+ } else {
+ WebSettingsCompat.setForceDark(webView.getSettings(), WebSettingsCompat.FORCE_DARK_AUTO);
+ }
+ }
}
@Override
@@ -27,4 +44,12 @@ public class Licenses extends Activity {
}
return super.onOptionsItemSelected(item);
}
+
+ private boolean isInDarkMode() {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
+ int nightModeFlags = getApplication().getApplicationContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
+ return nightModeFlags == Configuration.UI_MODE_NIGHT_YES;
+ }
+ return false;
+ }
}