Embed trailing tag view in a horizontal scrollview

This commit is contained in:
Tak! 2024-11-15 19:41:15 +01:00
parent 59a6bd1f7a
commit 9a98a6b926
3 changed files with 42 additions and 21 deletions

View File

@ -184,7 +184,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
translationStatusView = itemView.findViewById(R.id.status_translation_status);
untranslateButton = itemView.findViewById(R.id.status_button_untranslate);
trailingHashtagView = itemView.findViewById(R.id.status_trailing_hashtags);
trailingHashtagView = itemView.findViewById(R.id.status_trailing_hashtags_content);
this.avatarRadius48dp = itemView.getContext().getResources().getDimensionPixelSize(R.dimen.avatar_radius_48dp);
this.avatarRadius36dp = itemView.getContext().getResources().getDimensionPixelSize(R.dimen.avatar_radius_36dp);

View File

@ -338,25 +338,35 @@
app:layout_constraintTop_toBottomOf="@id/status_poll_button"
tools:text="7 votes • 7 hours remaining" />
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/status_trailing_hashtags"
<HorizontalScrollView
android:id="@+id/status_trailing_hashtags_scroll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="14dp"
android:scrollbars="none"
app:layout_constraintStart_toStartOf="@id/status_display_name"
app:layout_constraintTop_toBottomOf="@id/status_poll_description"
app:layout_constraintEnd_toEndOf="parent"
>
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/status_trailing_hashtags_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hyphenationFrequency="full"
android:importantForAccessibility="no"
android:textColor="?android:textColorPrimary"
android:textIsSelectable="true"
android:textSize="?attr/status_text_medium"
android:singleLine="true"
android:scrollHorizontally="true"
android:ellipsize="none"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/status_display_name"
app:layout_constraintTop_toBottomOf="@id/status_poll_description"
app:layout_constraintStart_toStartOf="parent"
tools:text="#one #two #three #four #five #six #seven #eight #nine #ten" />
</HorizontalScrollView>
<ImageButton
android:id="@+id/status_reply"
style="@style/TuskyImageButton"
@ -369,7 +379,7 @@
app:layout_constraintEnd_toStartOf="@id/status_inset"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="@id/status_display_name"
app:layout_constraintTop_toBottomOf="@id/status_trailing_hashtags"
app:layout_constraintTop_toBottomOf="@id/status_trailing_hashtags_scroll"
app:srcCompat="@drawable/ic_reply_24dp"
tools:ignore="NegativeMargin" />

View File

@ -295,24 +295,35 @@
app:layout_constraintTop_toBottomOf="@id/status_poll_button"
tools:text="7 votes • 7 hours remaining" />
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/status_trailing_hashtags"
<HorizontalScrollView
android:id="@+id/status_trailing_hashtags_scroll"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="14dp"
android:hyphenationFrequency="full"
android:importantForAccessibility="no"
android:textColor="?android:textColorPrimary"
android:textIsSelectable="true"
android:textSize="?attr/status_text_medium"
android:singleLine="true"
android:scrollHorizontally="true"
app:layout_constraintEnd_toEndOf="parent"
android:scrollbars="none"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/status_poll_description"
tools:text="#one #two #three #four #five #six #seven #eight #nine #ten" />
app:layout_constraintEnd_toEndOf="parent"
>
<com.keylesspalace.tusky.view.ClickableSpanTextView
android:id="@+id/status_trailing_hashtags_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hyphenationFrequency="full"
android:importantForAccessibility="no"
android:textColor="?android:textColorPrimary"
android:textIsSelectable="true"
android:textSize="?attr/status_text_medium"
android:singleLine="true"
android:ellipsize="none"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="#one #two #three #four #five #six #seven #eight #nine #ten" />
</HorizontalScrollView>
<TextView
android:id="@+id/status_meta_info"
@ -328,7 +339,7 @@
android:textSize="?attr/status_text_medium"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/status_trailing_hashtags"
app:layout_constraintTop_toBottomOf="@id/status_trailing_hashtags_scroll"
tools:text="21 Dec 2018 18:45" />
<View