mirror of
https://github.com/lubosz/overte.git
synced 2025-04-07 04:42:49 +02:00
Bug fix
This commit is contained in:
parent
11e47b8fe6
commit
21b089fa39
5 changed files with 19 additions and 11 deletions
|
@ -11,7 +11,6 @@
|
|||
|
||||
package io.highfidelity.hifiinterface;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
|
@ -273,7 +272,9 @@ public class InterfaceActivity extends QtActivity implements WebViewFragment.OnW
|
|||
case "WebView":
|
||||
runOnUiThread(() -> {
|
||||
webSlidingDrawer.setVisibility(View.VISIBLE);
|
||||
webSlidingDrawer.animateOpen();
|
||||
if (!webSlidingDrawer.isOpened()) {
|
||||
webSlidingDrawer.animateOpen();
|
||||
}
|
||||
if (args != null && args.containsKey(WebViewActivity.WEB_VIEW_ACTIVITY_EXTRA_URL)) {
|
||||
WebViewFragment webViewFragment = (WebViewFragment) getFragmentManager().findFragmentByTag("webViewFragment");
|
||||
webViewFragment.loadUrl((String) args.get(WebViewActivity.WEB_VIEW_ACTIVITY_EXTRA_URL));
|
||||
|
|
|
@ -56,9 +56,14 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
|
||||
public void loadUrl(String url) {
|
||||
mUrl = url;
|
||||
myWebView.getSettings().setLoadWithOverviewMode(true);
|
||||
myWebView.getSettings().setUseWideViewPort(true);
|
||||
myWebView.loadUrl(mUrl);
|
||||
loadUrl(myWebView, url);
|
||||
}
|
||||
|
||||
private void loadUrl(WebView webView, String url) {
|
||||
webView.setVisibility(View.GONE);
|
||||
webView.getSettings().setLoadWithOverviewMode(true);
|
||||
webView.getSettings().setUseWideViewPort(true);
|
||||
webView.loadUrl(url);
|
||||
}
|
||||
|
||||
public void setToolbarVisible(boolean visible) {
|
||||
|
@ -165,7 +170,6 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
webSettings.setBuiltInZoomControls(true);
|
||||
webSettings.setDisplayZoomControls(false);
|
||||
|
||||
// TODO: add a toolbar (close, ...)
|
||||
mToolbar = rootView.findViewById(R.id.toolbar);
|
||||
mToolbar.findViewById(R.id.viewFullScreen).setOnClickListener(view -> {
|
||||
openInFullScreen();
|
||||
|
@ -175,11 +179,9 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
mCloseAction.run();
|
||||
}
|
||||
});
|
||||
|
||||
mToolbar.setVisibility(mToolbarVisible ? View.VISIBLE : View.GONE);
|
||||
if (mUrl != null) {
|
||||
myWebView.getSettings().setLoadWithOverviewMode(true);
|
||||
myWebView.getSettings().setUseWideViewPort(true);
|
||||
myWebView.loadUrl(mUrl);
|
||||
loadUrl(myWebView, mUrl);
|
||||
}
|
||||
return rootView;
|
||||
}
|
||||
|
@ -227,6 +229,7 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
}
|
||||
}
|
||||
if (mListener != null) {
|
||||
myWebView.setVisibility(View.VISIBLE);
|
||||
mListener.onWebLoaded(url, safenessLevel);
|
||||
}
|
||||
}
|
||||
|
@ -238,6 +241,7 @@ public class WebViewFragment extends Fragment implements GestureDetector.OnGestu
|
|||
mProgressBar.setVisibility(View.VISIBLE);
|
||||
mProgressBar.setProgress(0);
|
||||
if (mListener != null) {
|
||||
myWebView.setVisibility(View.VISIBLE);
|
||||
mListener.onWebLoaded(url, safenessLevel);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,11 +10,13 @@
|
|||
android:name="path"
|
||||
android:pathData="M 86.5 173 C 134.273 173 173 134.273 173 86.5 C 173 38.727 134.273 0 86.5 0 C 38.727 0 0 38.727 0 86.5 C 0 134.273 38.727 173 86.5 173 Z"
|
||||
android:fillColor="#181818"
|
||||
android:fillAlpha="0.6"
|
||||
android:strokeWidth="1"/>
|
||||
<path
|
||||
android:name="path_1"
|
||||
android:pathData="M 53.3 53.3 L 119.7 119.7 M 53.3 119.7 L 119.7 53.3"
|
||||
android:fillColor="#000"
|
||||
android:fillAlpha="0.6"
|
||||
android:strokeColor="#ffffff"
|
||||
android:strokeWidth="13.5424"
|
||||
android:strokeLineCap="round"/>
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
android:name="path"
|
||||
android:pathData="M 86.5 173 C 134.273 173 173 134.273 173 86.5 C 173 38.727 134.273 0 86.5 0 C 38.727 0 0 38.727 0 86.5 C 0 134.273 38.727 173 86.5 173 Z"
|
||||
android:fillColor="#181818"
|
||||
android:fillAlpha="0.6"
|
||||
android:strokeWidth="1"/>
|
||||
<path
|
||||
android:name="path_2"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:visibility="visible">
|
||||
android:visibility="gone">
|
||||
<ImageView
|
||||
android:id="@+id/viewFullScreen"
|
||||
android:layout_width="25dp"
|
||||
|
|
Loading…
Reference in a new issue