mirror of https://github.com/M66B/FairEmail.git
Cleanup
This commit is contained in:
parent
83931fabec
commit
be6a725713
|
@ -21,11 +21,9 @@ package eu.faircode.email;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.util.Base64;
|
import android.util.Base64;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -80,18 +78,11 @@ public class FragmentWebView extends FragmentBase {
|
||||||
settings.setDisplayZoomControls(false);
|
settings.setDisplayZoomControls(false);
|
||||||
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||||
|
|
||||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
|
||||||
|
|
||||||
webview.setWebViewClient(new WebViewClient() {
|
webview.setWebViewClient(new WebViewClient() {
|
||||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||||
if (prefs.getBoolean("webview", false)) {
|
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
|
||||||
view.loadUrl(url);
|
Helper.view(getContext(), getViewLifecycleOwner(), Uri.parse(url), true);
|
||||||
setSubtitle(url);
|
return true;
|
||||||
} else {
|
|
||||||
if (getViewLifecycleOwner().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
|
|
||||||
Helper.view(getContext(), getViewLifecycleOwner(), Uri.parse(url), true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue