Upgrade for Android 13

Support Dark Mode in Help Activity for Android 10+
Slightly improve contrast in Dark Mode
This commit is contained in:
woheller69 2023-06-19 21:43:38 +02:00
parent 1a05a6348d
commit 62324ecc76
9 changed files with 24 additions and 41 deletions

View file

@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
android { android {
compileSdkVersion 32 compileSdkVersion 33
defaultConfig { defaultConfig {
applicationId "org.woheller69.solxpect" applicationId "org.woheller69.solxpect"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 31 targetSdkVersion 33
versionCode 18 versionCode 19
versionName "1.8" versionName "1.9"
buildConfigField "String", "BASE_URL", "\"https://api.open-meteo.com/v1/\"" buildConfigField "String", "BASE_URL", "\"https://api.open-meteo.com/v1/\""
buildConfigField "String", "GITHUB_URL","\"https://github.com/woheller69/solxpect/\"" buildConfigField "String", "GITHUB_URL","\"https://github.com/woheller69/solxpect/\""
@ -38,4 +38,5 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.1" //needed due to duplicate class error implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.1" //needed due to duplicate class error
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" //needed due to duplicate class error implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" //needed due to duplicate class error
implementation 'com.github.woheller69:CompassView:a63c67da90' implementation 'com.github.woheller69:CompassView:a63c67da90'
implementation 'androidx.webkit:webkit:1.5.0'
} }

View file

@ -1,11 +1,14 @@
package org.woheller69.weather.activities; package org.woheller69.weather.activities;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.webkit.WebView; import android.webkit.WebView;
import org.woheller69.weather.R; import org.woheller69.weather.R;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewFeature;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
@ -19,6 +22,12 @@ public class HelpActivity extends NavigationActivity{
setContentView(R.layout.activity_help); setContentView(R.layout.activity_help);
WebView view = findViewById(R.id.help); WebView view = findViewById(R.id.help);
if(WebViewFeature.isFeatureSupported(WebViewFeature.ALGORITHMIC_DARKENING)) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
WebSettingsCompat.setAlgorithmicDarkeningAllowed(view.getSettings(), true);
}
}
String language = getResources().getConfiguration().getLocales().get(0).getLanguage(); String language = getResources().getConfiguration().getLocales().get(0).getLanguage();
String filename = "help-"+language+".html"; String filename = "help-"+language+".html";

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/middlegrey" />
<corners android:radius="6dp" />
</shape>
</item>
</selector>

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<solid android:color="@color/blue" />
<corners android:radius="6dp" />
</shape>
</item>
</selector>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#AAFFFFFF" /> <solid android:color="@color/lightgrey" />
<padding <padding
android:left="3dp" android:left="3dp"

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#AAFFFFFF" />
<stroke android:width="0dp"
android:color="#AAFFFFFF"
/>
<padding
android:bottom="-3dp"
android:top="-3dp"
android:left="5dp"
android:right="5dp" />
<corners android:radius="7dp" />
</shape>

View file

@ -2,10 +2,11 @@
<resources> <resources>
<color name="colorStatusBar">#181818</color> <color name="colorStatusBar">#181818</color>
<color name="colorPrimary">#181818</color> <color name="colorPrimary">#181818</color>
<color name="colorPrimaryDark">#666666</color> <color name="colorPrimaryDark">#777777</color>
<color name="colorAccent">#707070</color> <color name="colorAccent">#a0a0a0</color>
<color name="colorListItem">#FFFFFF</color> <color name="colorListItem">#FFFFFF</color>
<color name="middlegrey">#A0A0A0</color> <color name="middlegrey">#707070</color>
<color name="lightgrey">#BBFFFFFF</color>
<color name="backgroundHighlight">#2A2A2A</color> <color name="backgroundHighlight">#2A2A2A</color>
<color name="white">#303030</color> <color name="white">#303030</color>
<color name="red">#d01530</color> <color name="red">#d01530</color>
@ -17,7 +18,7 @@
<color name="blue">#0274b2</color> <color name="blue">#0274b2</color>
<color name="lightblue">#1382d4</color> <color name="lightblue">#1382d4</color>
<color name="midblue">#1b5cd9</color> <color name="midblue">#1b5cd9</color>
<color name="backgroundBlue">#181818</color> <color name="backgroundBlue">#080808</color>
<color name="widgetBackground">#DD181818</color> <color name="widgetBackground">#DD181818</color>
</resources> </resources>

View file

@ -7,6 +7,7 @@
<color name="colorListItem">#024265</color> <color name="colorListItem">#024265</color>
<color name="backgroundHighlight">#5fa1d2</color> <color name="backgroundHighlight">#5fa1d2</color>
<color name="middlegrey">#A8A8A8</color> <color name="middlegrey">#A8A8A8</color>
<color name="lightgrey">#AAFFFFFF</color>
<color name="white">#fafafa</color> <color name="white">#fafafa</color>
<color name="red">#d01530</color> <color name="red">#d01530</color>
<color name="lightred">#fa7972</color> <color name="lightred">#fa7972</color>

View file

@ -0,0 +1,3 @@
Upgrade for Android 13
Support Dark Mode in Help Activity for Android 10+
Slightly improve contrast in Dark Mode