From 6f74315b7fea2435cffbad0db055acf313a6e542 Mon Sep 17 00:00:00 2001 From: Grishka Date: Thu, 17 Feb 2022 00:58:12 +0300 Subject: [PATCH] Fix volume buttons in photo viewer --- mastodon/.gitignore | 2 ++ .../joinmastodon/android/ui/photoviewer/PhotoViewer.java | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mastodon/.gitignore b/mastodon/.gitignore index 327034ee5..819f71816 100644 --- a/mastodon/.gitignore +++ b/mastodon/.gitignore @@ -1,3 +1,5 @@ /build /release /debug +*.apk +output-metadata.json diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java index 41a3b507f..e5a3cb004 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/photoviewer/PhotoViewer.java @@ -62,10 +62,13 @@ public class PhotoViewer implements ZoomPanView.Listener{ windowView=new FrameLayout(activity){ @Override public boolean dispatchKeyEvent(KeyEvent event){ - if(event.getAction()==KeyEvent.ACTION_DOWN && event.getKeyCode()==KeyEvent.KEYCODE_BACK){ - onStartSwipeToDismissTransition(0f); + if(event.getKeyCode()==KeyEvent.KEYCODE_BACK){ + if(event.getAction()==KeyEvent.ACTION_DOWN){ + onStartSwipeToDismissTransition(0f); + } + return true; } - return true; + return false; } @Override