Update code

This commit is contained in:
Thomas 2020-10-29 16:35:34 +01:00
parent 81f78f2d53
commit 262839dd97
5 changed files with 17 additions and 10 deletions

View File

@ -1,3 +1,7 @@
.navbar.is-secondary, .footer{ .navbar.is-secondary, .footer{
display: none!important; display: none!important;
} }
html, body{
overflow-x: hidden;
}

View File

@ -29,6 +29,7 @@ import java.io.InputStream;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
public class Helper { public class Helper {
@SuppressWarnings({"unused", "RedundantSuppression"})
public static final String TAG = "mobilizon_app"; public static final String TAG = "mobilizon_app";
public static final String APP_PREFS = "app_prefs"; public static final String APP_PREFS = "app_prefs";
public static final String PREF_INSTANCE = "instance"; public static final String PREF_INSTANCE = "instance";
@ -56,7 +57,7 @@ public class Helper {
webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setUseWideViewPort(true); webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setSupportZoom(true); webView.getSettings().setSupportZoom(false);
webView.getSettings().setDisplayZoomControls(false); webView.getSettings().setDisplayZoomControls(false);
webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setLoadsImagesAutomatically(true); webView.getSettings().setLoadsImagesAutomatically(true);

View File

@ -46,11 +46,11 @@ public class MobilizonWebChromeClient extends WebChromeClient implements MediaPl
private ToggledFullscreenCallback toggledFullscreenCallback; private ToggledFullscreenCallback toggledFullscreenCallback;
private WebView webView; private final WebView webView;
private View activityNonVideoView; private final View activityNonVideoView;
private ViewGroup activityVideoView; private final ViewGroup activityVideoView;
private boolean isVideoFullscreen; private boolean isVideoFullscreen;
private Activity activity; private final Activity activity;
public MobilizonWebChromeClient(Activity activity, WebView webView, FrameLayout activityNonVideoView, ViewGroup activityVideoView) { public MobilizonWebChromeClient(Activity activity, WebView webView, FrameLayout activityNonVideoView, ViewGroup activityVideoView) {
@ -66,6 +66,7 @@ public class MobilizonWebChromeClient extends WebChromeClient implements MediaPl
* *
* @param callback A VideoEnabledWebChromeClient.ToggledFullscreenCallback callback * @param callback A VideoEnabledWebChromeClient.ToggledFullscreenCallback callback
*/ */
@SuppressWarnings({"unused", "RedundantSuppression"})
public void setOnToggledFullscreen(ToggledFullscreenCallback callback) { public void setOnToggledFullscreen(ToggledFullscreenCallback callback) {
this.toggledFullscreenCallback = callback; this.toggledFullscreenCallback = callback;
} }

View File

@ -42,8 +42,8 @@ import app.fedilab.mobilizon.helper.Helper;
public class MobilizonWebViewClient extends WebViewClient { public class MobilizonWebViewClient extends WebViewClient {
private Activity activity; private final Activity activity;
private CoordinatorLayout rootView; private final CoordinatorLayout rootView;
public MobilizonWebViewClient(Activity activity) { public MobilizonWebViewClient(Activity activity) {
this.activity = activity; this.activity = activity;
@ -69,12 +69,12 @@ public class MobilizonWebViewClient extends WebViewClient {
if (pair.getValue().startsWith("Bearer")) { if (pair.getValue().startsWith("Bearer")) {
if (!MainActivity.isAuthenticated) { if (!MainActivity.isAuthenticated) {
MainActivity.isAuthenticated = true; MainActivity.isAuthenticated = true;
activity.runOnUiThread(() -> ((MainActivity) activity).drawMenu()); activity.runOnUiThread(((MainActivity) activity)::drawMenu);
} }
} else { } else {
if (MainActivity.isAuthenticated) { if (MainActivity.isAuthenticated) {
MainActivity.isAuthenticated = false; MainActivity.isAuthenticated = false;
activity.runOnUiThread(() -> ((MainActivity) activity).drawMenu()); activity.runOnUiThread(((MainActivity) activity)::drawMenu);
} }
} }
} }

View File

@ -95,7 +95,8 @@
app:layout_constraintTop_toBottomOf="@+id/about" app:layout_constraintTop_toBottomOf="@+id/about"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/about_the_app" android:text="@string/about_the_app"
/> />