enable dark mode for help and about webviews
This commit is contained in:
parent
8b5263db63
commit
81fd1f3ebb
|
@ -30,7 +30,6 @@ dependencies {
|
|||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
implementation 'androidx.navigation:navigation-fragment:2.3.0'
|
||||
implementation 'androidx.navigation:navigation-ui:2.3.0'
|
||||
|
||||
|
@ -40,6 +39,8 @@ dependencies {
|
|||
implementation 'com.squareup.picasso:picasso:2.71828'
|
||||
implementation 'androidx.preference:preference:1.1.1'
|
||||
|
||||
implementation "androidx.webkit:webkit:1.3.0"
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
package com.akdev.nofbeventscraper;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.ImageView;
|
||||
import androidx.webkit.WebSettingsCompat;
|
||||
import androidx.webkit.WebViewFeature;
|
||||
|
||||
public class AboutActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -24,6 +22,13 @@ public class AboutActivity extends AppCompatActivity {
|
|||
|
||||
WebView webview_about = findViewById(R.id.webview_about);
|
||||
|
||||
int night_mode_flags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
if (night_mode_flags == Configuration.UI_MODE_NIGHT_YES) {
|
||||
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
|
||||
WebSettingsCompat.setForceDark(webview_about.getSettings(),
|
||||
WebSettingsCompat.FORCE_DARK_ON);
|
||||
}
|
||||
}
|
||||
webview_about.loadUrl("file:///android_res/raw/about.html");
|
||||
}
|
||||
|
||||
|
|
|
@ -129,10 +129,6 @@ public class FbScraper extends AsyncTask<Void, Void, Void> {
|
|||
protected Date parseToDate(String time_in) {
|
||||
|
||||
try {
|
||||
// time in is missing a : in the timezone offset
|
||||
//Editable editable = new SpannableStringBuilder(time_in);
|
||||
//String time_str = editable.insert(22, ":").toString();
|
||||
|
||||
// parse e.g. 2011-12-03T10:15:30+0100
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault());
|
||||
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
package com.akdev.nofbeventscraper;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.webkit.WebView;
|
||||
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.webkit.WebSettingsCompat;
|
||||
import androidx.webkit.WebViewFeature;
|
||||
|
||||
public class HelpActivity extends AppCompatActivity {
|
||||
|
||||
|
@ -19,7 +22,17 @@ public class HelpActivity extends AppCompatActivity {
|
|||
|
||||
WebView webview_help = findViewById(R.id.webview_help);
|
||||
|
||||
int night_mode_flags = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
|
||||
if (night_mode_flags == Configuration.UI_MODE_NIGHT_YES) {
|
||||
if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
|
||||
WebSettingsCompat.setForceDark(webview_help.getSettings(),
|
||||
WebSettingsCompat.FORCE_DARK_ON);
|
||||
}
|
||||
}
|
||||
|
||||
webview_help.loadUrl("file:////android_res/raw/help.html");
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".AboutActivity">
|
||||
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview_about"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</RelativeLayout>
|
|
@ -1,15 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".HelpActivity">
|
||||
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webview_help"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</RelativeLayout>
|
|
@ -10,5 +10,5 @@
|
|||
<h3>Warum funktioniert die Veranstaltung X nicht?</h3>
|
||||
<p>Diese Anwendung greift auf öffentlich zugängliche Ereignisinformationen zu. Wenn die Veranstaltung z.B. den Ort ohne Login nicht anbietet, ist dies in dieser Anwendung nicht verfügbar. Auch bieten einige Veranstaltungen die Informationen einfach nicht in einem maschinenlesbaren Format an. Veranstaltungen mit mehreren Instanzen sind problematisch, da sie beim Scraping von m.facebook.com nicht das korrekte Start- und Enddatum angeben.</p>
|
||||
<p>Wenn Sie Probleme mit einem bestimmten Ereignis haben, lassen Sie es mich bitte über den <a href="https://gitreports.com/issue/akaessens/NoFbEventScraper">anonymen Bugtracker</a> oder auf der <a href="https://github.com/akaessens/NoFbEventScraper/issues/">GitHub Problemseite</a>.</p>
|
||||
<h3>Is this compatible with my calendar app?</h3>
|
||||
<h3>Ist diese App kompatibel mit meinem Kalender?</h3>
|
||||
<p>Ja. Diese Anwendung verwendet anwendungsunabhängige Kalenderfunktionen, wodurch sie mit jeder Kalenderanwendung kompatibel ist. Ich empfehle jedoch den <a href="https://play.google.com/store/apps/details?id=ws.xsoh.etar">Etar Kalender</a>, da er Open Source ist. </p>
|
Loading…
Reference in New Issue