From 95a69b4dac4d42ac3700e72913db65d36a403712 Mon Sep 17 00:00:00 2001 From: nuclearfog Date: Tue, 12 Oct 2021 15:17:44 +0200 Subject: [PATCH] mediaviewer layout fix Signed-off-by: nuclearfog --- .../twidda/activity/MediaViewer.java | 29 ++++++++++--------- app/src/main/res/layout/page_media.xml | 21 +++++++++----- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/app/src/main/java/org/nuclearfog/twidda/activity/MediaViewer.java b/app/src/main/java/org/nuclearfog/twidda/activity/MediaViewer.java index 8142d85f..a5d596e8 100644 --- a/app/src/main/java/org/nuclearfog/twidda/activity/MediaViewer.java +++ b/app/src/main/java/org/nuclearfog/twidda/activity/MediaViewer.java @@ -1,5 +1,18 @@ package org.nuclearfog.twidda.activity; +import static android.media.MediaPlayer.MEDIA_ERROR_UNKNOWN; +import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_END; +import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START; +import static android.media.MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START; +import static android.os.AsyncTask.Status.RUNNING; +import static android.view.MotionEvent.ACTION_DOWN; +import static android.view.MotionEvent.ACTION_UP; +import static android.view.View.GONE; +import static android.view.View.INVISIBLE; +import static android.view.View.VISIBLE; +import static android.widget.Toast.LENGTH_SHORT; +import static androidx.recyclerview.widget.LinearLayoutManager.HORIZONTAL; + import android.content.ActivityNotFoundException; import android.content.Intent; import android.graphics.Bitmap; @@ -46,19 +59,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import static android.media.MediaPlayer.MEDIA_ERROR_UNKNOWN; -import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_END; -import static android.media.MediaPlayer.MEDIA_INFO_BUFFERING_START; -import static android.media.MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START; -import static android.os.AsyncTask.Status.RUNNING; -import static android.view.MotionEvent.ACTION_DOWN; -import static android.view.MotionEvent.ACTION_UP; -import static android.view.View.GONE; -import static android.view.View.INVISIBLE; -import static android.view.View.VISIBLE; -import static android.widget.Toast.LENGTH_SHORT; -import static androidx.recyclerview.widget.LinearLayoutManager.HORIZONTAL; - /** * Media viewer activity for images and videos * @@ -139,6 +139,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener, super.onCreate(b); setContentView(R.layout.page_media); RecyclerView imageList = findViewById(R.id.image_list); + View imageListContainer = findViewById(R.id.image_preview_list); controlPanel = findViewById(R.id.media_controlpanel); loadingCircle = findViewById(R.id.media_progress); zoomImage = findViewById(R.id.image_full); @@ -171,7 +172,7 @@ public class MediaViewer extends MediaActivity implements OnImageClickListener, switch (type) { case MEDIAVIEWER_IMAGE: zoomImage.setVisibility(VISIBLE); - imageList.setVisibility(VISIBLE); + imageListContainer.setVisibility(VISIBLE); if (!mediaLinks[0].startsWith("http")) adapter.disableSaveButton(); imageList.setLayoutManager(new LinearLayoutManager(this, HORIZONTAL, false)); diff --git a/app/src/main/res/layout/page_media.xml b/app/src/main/res/layout/page_media.xml index b9eb9254..85d11f6c 100644 --- a/app/src/main/res/layout/page_media.xml +++ b/app/src/main/res/layout/page_media.xml @@ -18,18 +18,25 @@ app:max_zoom_in="10.0" app:max_zoom_out="0.7" /> - + app:layout_constraintHeight_percent="0.2"> + + + +