From b8e2d44638b0ecb213fb0fa74c17da0060f4fd31 Mon Sep 17 00:00:00 2001 From: scria1000 <91804886+scria1000@users.noreply.github.com> Date: Tue, 9 Nov 2021 17:11:02 +0300 Subject: Initial support for gallery captions --- .../fragment_view_reddit_gallery_image_or_gif.xml | 113 ++++++++++++++------- .../main/res/layout/item_post_detail_gallery.xml | 54 ++++++++++ 2 files changed, 132 insertions(+), 35 deletions(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml index b41c5600..986b86c6 100644 --- a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml @@ -50,47 +50,90 @@ + android:layout_height="wrap_content" + android:orientation="vertical"> - - - + android:gravity="center_vertical" + android:orientation="vertical" + android:visibility="gone"> - + - + + + + android:layout_height="wrap_content"> + + + + + + + + + diff --git a/app/src/main/res/layout/item_post_detail_gallery.xml b/app/src/main/res/layout/item_post_detail_gallery.xml index 6a5d2a51..e9044418 100644 --- a/app/src/main/res/layout/item_post_detail_gallery.xml +++ b/app/src/main/res/layout/item_post_detail_gallery.xml @@ -267,6 +267,60 @@ android:src="@drawable/ic_link" android:visibility="gone" /> + + + + + + + + + + Date: Wed, 10 Nov 2021 15:37:11 +0300 Subject: Fix bottom url menu not being themed accordingly Use linkify for in-gallery caption url --- app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml index 986b86c6..23fc50b0 100644 --- a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml @@ -77,11 +77,9 @@ android:layout_width="wrap_content" android:layout_height="0dp" android:layout_weight="1" - android:autoLink="web" android:ellipsize="end" android:fontFamily="?attr/content_font_family" android:gravity="center_vertical" - android:nestedScrollingEnabled="false" android:textColor="#FFFFFF" android:textColorLink="#FFFFFF" android:textSize="?attr/content_font_default" -- cgit v1.2.3 From 90a9b1033f36087ce302e06304cbf3581921748b Mon Sep 17 00:00:00 2001 From: scria1000 <91804886+scria1000@users.noreply.github.com> Date: Sat, 27 Nov 2021 20:04:45 +0300 Subject: Make caption text copyable with long press Use native way to theme ViewRedditGalleryActivity --- app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml index 23fc50b0..54d64069 100644 --- a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml @@ -59,7 +59,8 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="vertical" - android:visibility="gone"> + android:visibility="gone" + android:paddingTop="8dp"> Date: Sun, 28 Nov 2021 19:15:47 +0300 Subject: Adjust caption layout Set caption max length Set link ellipsis --- .../fragment_view_reddit_gallery_image_or_gif.xml | 50 +++---- .../main/res/layout/item_post_detail_gallery.xml | 146 +++++++++++---------- 2 files changed, 99 insertions(+), 97 deletions(-) (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml index 54d64069..4cfdf858 100644 --- a/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml +++ b/app/src/main/res/layout/fragment_view_reddit_gallery_image_or_gif.xml @@ -1,7 +1,7 @@ + android:textColor="@android:color/white" + android:textSize="?attr/font_default" /> + android:visibility="gone"> + android:paddingTop="8dp" + android:visibility="gone"> @@ -80,7 +80,7 @@ android:layout_weight="1" android:ellipsize="end" android:fontFamily="?attr/content_font_family" - android:gravity="center_vertical" + android:maxLength="180" android:textColor="#FFFFFF" android:textColorLink="#FFFFFF" android:textSize="?attr/content_font_default" @@ -97,41 +97,41 @@ android:id="@+id/title_text_view_view_reddit_gallery_image_or_gif_fragment" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" android:layout_gravity="center_vertical" + android:layout_weight="1" + android:ellipsize="end" + android:fontFamily="?attr/font_family" android:gravity="center_vertical" + android:maxLines="1" android:paddingTop="8dp" android:paddingBottom="8dp" android:textColor="#FFFFFF" - android:textSize="?attr/font_20" - android:fontFamily="?attr/font_family" - android:maxLines="1" - android:ellipsize="end" /> + android:textSize="?attr/font_20" /> + android:src="@drawable/ic_file_download_toolbar_white_24dp" /> + android:src="@drawable/ic_share_toolbar_white_24dp" /> + android:src="@drawable/ic_wallpaper_white_24dp" /> diff --git a/app/src/main/res/layout/item_post_detail_gallery.xml b/app/src/main/res/layout/item_post_detail_gallery.xml index e9044418..0cf6a484 100644 --- a/app/src/main/res/layout/item_post_detail_gallery.xml +++ b/app/src/main/res/layout/item_post_detail_gallery.xml @@ -1,11 +1,11 @@ + android:background="?attr/cardViewBackgroundColor" + android:orientation="vertical"> + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_gallery" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toEndOf="@+id/icon_gif_image_view_item_post_detail_gallery" + app:layout_constraintTop_toBottomOf="@+id/subreddit_text_view_item_post_detail_gallery" /> + android:textSize="?attr/title_font_18" /> @@ -129,10 +129,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:text="@string/spoiler" - android:textSize="?attr/font_12" android:fontFamily="?attr/font_family" android:padding="4dp" + android:text="@string/spoiler" + android:textSize="?attr/font_12" android:visibility="gone" app:lib_setRadius="6dp" app:lib_setRoundedView="true" @@ -142,10 +142,10 @@ android:id="@+id/nsfw_text_view_item_post_detail_gallery" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" android:padding="4dp" android:text="@string/nsfw" android:textSize="?attr/font_12" - android:fontFamily="?attr/font_family" android:visibility="gone" app:lib_setRadius="6dp" app:lib_setRoundedView="true" @@ -156,9 +156,9 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + android:fontFamily="?attr/font_family" android:padding="4dp" android:textSize="?attr/font_12" - android:fontFamily="?attr/font_family" android:visibility="gone" app:lib_setRadius="6dp" app:lib_setRoundedView="true" @@ -168,8 +168,8 @@ android:id="@+id/upvote_ratio_text_view_item_post_detail_gallery" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="?attr/font_12" - android:fontFamily="?attr/font_family" /> + android:fontFamily="?attr/font_family" + android:textSize="?attr/font_12" /> @@ -223,10 +223,10 @@ android:id="@+id/video_or_gif_indicator_image_view_item_post_detail" android:layout_width="36dp" android:layout_height="36dp" - android:layout_margin="16dp" android:layout_gravity="start" - android:scaleType="center" + android:layout_margin="16dp" android:background="@drawable/play_button_round_background" + android:scaleType="center" android:src="@drawable/ic_gallery_24dp" /> @@ -247,12 +247,12 @@ android:id="@+id/load_image_error_text_view_item_post_detail_gallery" android:layout_width="match_parent" android:layout_height="wrap_content" - android:drawableTop="@drawable/ic_error_outline_black_24dp" android:layout_centerInParent="true" + android:drawableTop="@drawable/ic_error_outline_black_24dp" + android:fontFamily="?attr/font_family" android:gravity="center" android:text="@string/error_loading_image_tap_to_retry" android:textSize="?attr/font_default" - android:fontFamily="?attr/font_family" android:visibility="gone" /> @@ -279,42 +279,44 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:ellipsize="marquee" + android:focusable="true" + android:focusableInTouchMode="true" android:fontFamily="?attr/content_font_family" android:gravity="start" android:marqueeRepeatLimit="marquee_forever" - android:paddingLeft="8dp" - android:paddingRight="8dp" - android:singleLine="true" + android:paddingHorizontal="8dp" android:scrollHorizontally="true" - android:focusable="true" - android:focusableInTouchMode="true" + android:singleLine="true" android:textColor="?attr/primaryTextColor" android:textSize="?attr/content_font_default" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toStartOf="@id/guideline4" + app:layout_constraintEnd_toStartOf="@id/caption_url_text_view_item_post_detail_gallery" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -322,89 +324,89 @@ + android:layout_height="wrap_content"> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toEndOf="@id/plus_button_item_post_detail_gallery" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_gallery" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toEndOf="@id/minus_button_item_post_detail_gallery" + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> -- cgit v1.2.3