mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Clean web resources before closing web PiP
This commit is contained in:
parent
9675328f1e
commit
6e3d3d457f
2 changed files with 18 additions and 5 deletions
|
@ -131,7 +131,10 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
|||
webSlidingDrawer = (SlidingDrawer) inflater.inflate(R.layout.web_drawer, mainLayout, false);
|
||||
QtLayout qtLayout = (QtLayout) mainLayout.getChildAt(0);
|
||||
QtLayout.LayoutParams layoutParams = new QtLayout.LayoutParams(webSlidingDrawer.getLayoutParams());
|
||||
|
||||
webSlidingDrawer.setOnDrawerCloseListener(() -> {
|
||||
WebViewFragment webViewFragment = (WebViewFragment) getFragmentManager().findFragmentByTag("webViewFragment");
|
||||
webViewFragment.close();
|
||||
});
|
||||
int widthPx = Math.max(size.x, size.y);
|
||||
int heightPx = Math.min(size.x, size.y);
|
||||
|
||||
|
@ -299,7 +302,12 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
|||
WebViewFragment webViewFragment = (WebViewFragment) getFragmentManager().findFragmentByTag("webViewFragment");
|
||||
webViewFragment.loadUrl((String) args.get(WebViewActivity.WEB_VIEW_ACTIVITY_EXTRA_URL), true);
|
||||
webViewFragment.setToolbarVisible(true);
|
||||
webViewFragment.setCloseAction(() -> { webSlidingDrawer.animateClose(); webSlidingDrawer.setVisibility(View.GONE);} );
|
||||
webViewFragment.setCloseAction(() -> {
|
||||
if (webSlidingDrawer.isOpened()) {
|
||||
webSlidingDrawer.animateClose();
|
||||
}
|
||||
webSlidingDrawer.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
|
|
@ -133,6 +133,13 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
return false;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
myWebView.loadUrl("about:blank");
|
||||
if (mCloseAction != null) {
|
||||
mCloseAction.run();
|
||||
}
|
||||
}
|
||||
|
||||
public enum SafenessLevel {
|
||||
NOT_ANALYZED_YET(""),
|
||||
NOT_SECURE(""),
|
||||
|
@ -205,9 +212,7 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
expand();
|
||||
});
|
||||
mToolbar.findViewById(R.id.close).setOnClickListener(view -> {
|
||||
if (mCloseAction != null) {
|
||||
mCloseAction.run();
|
||||
}
|
||||
close();
|
||||
});
|
||||
if (mUrl != null) {
|
||||
loadUrl(myWebView, mUrl);
|
||||
|
|
Loading…
Reference in a new issue