Merge pull request #1626 from kiwix/feature/macgills/1625-dark-mode-webview

#1625 Night mode does not always apply properly on pictures - update …
This commit is contained in:
Seán Mac Gillicuddy 2019-12-09 11:29:37 +00:00 committed by GitHub
commit b160b4ff71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -1242,6 +1242,7 @@ public abstract class CoreMainActivity extends BaseActivity
}
}
updateWidgets(this);
updateNightMode();
}
private void updateBottomToolbarVisibility() {
@ -1505,8 +1506,10 @@ public abstract class CoreMainActivity extends BaseActivity
if (isInFullScreenMode()) {
openFullScreen();
}
updateNightMode();
}
// Night mode status
private void updateNightMode() {
if (nightModeConfig.isNightModeActive()) {
getCurrentWebView().activateNightMode();
} else {

View File

@ -107,7 +107,7 @@ public class KiwixWebView extends VideoEnabledWebView {
}
public void activateNightMode() {
if (getUrl().equals(HOME_URL)) {
if (getUrl() != null && getUrl().equals(HOME_URL)) {
return;
}
Paint paint = new Paint();