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

@ -1,11 +1,14 @@
package org.woheller69.weather.activities;
import android.content.res.AssetManager;
import android.os.Build;
import android.os.Bundle;
import android.webkit.WebView;
import org.woheller69.weather.R;
import androidx.appcompat.app.ActionBar;
import androidx.webkit.WebSettingsCompat;
import androidx.webkit.WebViewFeature;
import java.io.IOException;
import java.util.Arrays;
@ -19,6 +22,12 @@ public class HelpActivity extends NavigationActivity{
setContentView(R.layout.activity_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 filename = "help-"+language+".html";