Fix webview resetting dark theme
This commit is contained in:
3 files changed
+11
No files matched your search
@@ -18,6 +18,7 @@ import com.hippo.ehviewer.EhApplication;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.client.EhCookieStore;
|
||||
import com.hippo.ehviewer.client.EhUrl;
|
||||
import com.hippo.ehviewer.ui.SettingsActivity;
|
||||
import com.hippo.ehviewer.widget.DialogWebChromeClient;
|
||||
import com.hippo.widget.ProgressView;
|
||||
|
||||
@@ -35,6 +36,7 @@ public class MyTagsFragment extends BaseFragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.activity_webview, container, false);
|
||||
((SettingsActivity) requireActivity()).getDelegate().applyDayNight();
|
||||
webView = view.findViewById(R.id.webview);
|
||||
webView.setBackgroundColor(AttrResources.getAttrColor(requireActivity(), android.R.attr.colorBackground));
|
||||
webView.getSettings().setBuiltInZoomControls(true);
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.hippo.ehviewer.EhApplication;
|
||||
import com.hippo.ehviewer.R;
|
||||
import com.hippo.ehviewer.client.EhCookieStore;
|
||||
import com.hippo.ehviewer.client.EhUrl;
|
||||
import com.hippo.ehviewer.ui.SettingsActivity;
|
||||
import com.hippo.ehviewer.ui.scene.BaseScene;
|
||||
import com.hippo.ehviewer.widget.DialogWebChromeClient;
|
||||
import com.hippo.widget.ProgressView;
|
||||
@@ -40,6 +41,7 @@ public class UConfigFragment extends BaseFragment {
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.activity_webview, container, false);
|
||||
((SettingsActivity) requireActivity()).getDelegate().applyDayNight();
|
||||
webView = view.findViewById(R.id.webview);
|
||||
webView.setBackgroundColor(AttrResources.getAttrColor(requireActivity(), android.R.attr.colorBackground));
|
||||
webView.getSettings().setBuiltInZoomControls(true);
|
||||
@@ -167,6 +169,11 @@ public class UConfigFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFragmentTitle() {
|
||||
return R.string.u_config;
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.hippo.ehviewer.EhApplication;
|
||||
import com.hippo.ehviewer.client.EhCookieStore;
|
||||
import com.hippo.ehviewer.client.EhUrl;
|
||||
import com.hippo.ehviewer.client.EhUtils;
|
||||
import com.hippo.ehviewer.ui.MainActivity;
|
||||
import com.hippo.ehviewer.widget.DialogWebChromeClient;
|
||||
import com.hippo.yorozuya.AssertUtils;
|
||||
|
||||
@@ -74,6 +75,7 @@ public class WebViewSignInScene extends SolidScene {
|
||||
cookieManager.removeSessionCookies(null);
|
||||
|
||||
mWebView = new WebView(context);
|
||||
((MainActivity) context).getDelegate().applyDayNight();
|
||||
mWebView.setBackgroundColor(AttrResources.getAttrColor(requireActivity(), android.R.attr.colorBackground));
|
||||
mWebView.getSettings().setBuiltInZoomControls(true);
|
||||
mWebView.getSettings().setDisplayZoomControls(false);
|
||||
|
||||
Reference in new issue
Block a user