From 80f6fb238260f18237b684000241e8dbad3ff4c8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 15 Jan 2023 12:30:33 +0100 Subject: [PATCH] Fix a crash --- .../fedilab/android/activities/MediaActivity.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java index 2e85c2b1..c0a35a93 100644 --- a/app/src/main/java/app/fedilab/android/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MediaActivity.java @@ -28,6 +28,7 @@ import android.os.Bundle; import android.os.Handler; import android.view.Menu; import android.view.MenuItem; +import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.Window; @@ -115,10 +116,7 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload if (attachments == null || attachments.size() == 0) finish(); - if (getSupportActionBar() != null) { - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - getSupportActionBar().setDisplayShowHomeEnabled(true); - } + setTitle(""); ScreenSlidePagerAdapter mPagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager()); @@ -208,6 +206,15 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload setFullscreen(true); } + @Override + public boolean dispatchTouchEvent(MotionEvent event) { + try { + return super.dispatchTouchEvent(event); + } catch (IllegalArgumentException ex) { + ex.printStackTrace(); + } + return false; + } public void toogleFullScreen() { fullscreen = !fullscreen;