From f37bf1df53e83f29a85f9472d877c8153df0f544 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 30 Jul 2023 18:16:16 +0200 Subject: [PATCH] Scrollable media description --- .../fedilab/android/mastodon/activities/MediaActivity.java | 5 +++++ .../res/layouts/mastodon/layout/activity_media_pager.xml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java index 5e9b2e1e6..c5313a297 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java +++ b/app/src/main/java/app/fedilab/android/mastodon/activities/MediaActivity.java @@ -26,6 +26,7 @@ import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.text.method.ScrollingMovementMethod; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; @@ -150,6 +151,10 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload startActivity(intentContext); }); } + + binding.mediaDescription.setMovementMethod(new ScrollingMovementMethod()); + binding.mediaDescriptionTranslated.setMovementMethod(new ScrollingMovementMethod()); + if (description != null && description.trim().length() > 0 && description.trim().compareTo("null") != 0) { binding.mediaDescription.setText(description); binding.translate.setOnClickListener(v -> { diff --git a/app/src/main/res/layouts/mastodon/layout/activity_media_pager.xml b/app/src/main/res/layouts/mastodon/layout/activity_media_pager.xml index 497fe1397..d82c2896a 100644 --- a/app/src/main/res/layouts/mastodon/layout/activity_media_pager.xml +++ b/app/src/main/res/layouts/mastodon/layout/activity_media_pager.xml @@ -35,6 +35,8 @@ android:id="@+id/media_description" android:layout_width="0dp" android:layout_height="wrap_content" + android:maxHeight="300dp" + android:scrollbars="vertical" android:layout_gravity="center_horizontal|bottom" android:background="#AA000000" android:gravity="center" @@ -50,6 +52,8 @@