collapse long posts

This commit is contained in:
sk
2023-02-03 23:40:20 +01:00
parent 847d966daa
commit ec9d41fbbd
8 changed files with 136 additions and 19 deletions

View File

@@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:pathData="M7.75 12c0 0.966-0.784 1.75-1.75 1.75S4.25 12.966 4.25 12 5.034 10.25 6 10.25 7.75 11.034 7.75 12zm6 0c0 0.966-0.784 1.75-1.75 1.75s-1.75-0.784-1.75-1.75 0.784-1.75 1.75-1.75 1.75 0.784 1.75 1.75zM18 13.75c0.966 0 1.75-0.784 1.75-1.75s-0.784-1.75-1.75-1.75-1.75 0.784-1.75 1.75 0.784 1.75 1.75 1.75z" android:fillColor="@color/fluent_default_icon_tint"/>
</vector>

View File

@@ -44,19 +44,47 @@
android:background="?attr/colorPollVoted"/>
</LinearLayout>
<org.joinmastodon.android.ui.views.LinkedTextView
android:id="@+id/text"
<org.joinmastodon.android.ui.views.UntouchableScrollView
android:id="@+id/text_scroll_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:textSize="16sp"
android:textAppearance="@style/m3_body_large"/>
android:requiresFadingEdge="vertical"
android:scrollbars="none"
android:fadingEdgeLength="36dp">
<org.joinmastodon.android.ui.views.LinkedTextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textAppearance="@style/m3_body_large"/>
</org.joinmastodon.android.ui.views.UntouchableScrollView>
<Space
android:id="@+id/space_below_text"
android:layout_width="match_parent"
android:layout_height="8dp"
android:visibility="gone" />
<Button
android:id="@+id/read_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_text_button"
android:textColor="?android:textColorSecondary"
android:layout_marginHorizontal="16dp"
android:paddingHorizontal="8dp"
android:textAppearance="@style/m3_label_medium"
android:textAllCaps="true"
android:text="@string/sk_expand"
android:visibility="gone" />
<org.joinmastodon.android.ui.views.AutoOrientationLinearLayout
android:id="@+id/translate_wrap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:visibility="gone">
@@ -68,8 +96,7 @@
android:clipToPadding="false">
<org.joinmastodon.android.ui.views.ProgressBarButton
android:id="@+id/translate_btn"
style="?secondaryButtonStyle"
android:background="?android:selectableItemBackground"
android:background="@drawable/bg_text_button"
android:textColor="?android:textColorSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -88,13 +115,16 @@
android:visibility="gone"/>
</FrameLayout>
<Space
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/translate_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="4dp"
android:layout_weight="1"
android:textColor="?android:textColorSecondary"
android:textAlignment="textEnd"
tools:text="Translated using TranslateEngine" />
@@ -129,4 +159,4 @@
</LinearLayout>
</FrameLayout>
</FrameLayout>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="text_max_height">300dp</dimen>
<dimen name="text_collapsed_height">150dp</dimen>
</resources>

View File

@@ -253,4 +253,7 @@
<string name="sk_notify_poll_results">Poll results</string>
<string name="sk_settings_prefix_reply_cw_with_re">Prefix reply CW with “re:”</string>
<string name="sk_filtered">Filtered: %s</string>
<string name="sk_expand">Expand</string>
<string name="sk_collapse">Collapse</string>
<string name="sk_settings_collapse_long_posts">Collapse long posts</string>
</resources>