bottom action buttons with scroll view when too long

This commit is contained in:
Thomas 2023-09-22 11:42:26 +02:00
parent 83c6a438f3
commit 090d22f6a8
2 changed files with 211 additions and 213 deletions

View file

@ -457,7 +457,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (compactButtons) { if (compactButtons) {
ConstraintSet set = new ConstraintSet(); ConstraintSet set = new ConstraintSet();
set.clone(holder.binding.actionButtons); set.clone(holder.binding.actionButtons);
set.clear(R.id.status_emoji, ConstraintSet.END); set.clear(R.id.action_button_extra_container, ConstraintSet.END);
set.applyTo(holder.binding.actionButtons); set.applyTo(holder.binding.actionButtons);
} }

View file

@ -629,9 +629,18 @@
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginStart="48dp" android:layout_marginStart="48dp"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:orientation="horizontal"
android:clipChildren="false" android:clipChildren="false"
android:clipToPadding="false"> android:clipToPadding="false">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/action_button_reply_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_reply" android:id="@+id/action_button_reply"
@ -642,9 +651,6 @@
app:activeImage="@drawable/ic_round_reply_24" app:activeImage="@drawable/ic_round_reply_24"
app:iconSize="28dp" app:iconSize="28dp"
app:inactiveImage="@drawable/ic_round_reply_24" app:inactiveImage="@drawable/ic_round_reply_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/boost_icon" app:primaryColor="@color/boost_icon"
app:secondaryColor="@color/boost_icon" /> app:secondaryColor="@color/boost_icon" />
@ -656,38 +662,49 @@
android:text="+" android:text="+"
android:textColor="?colorControlNormal" android:textColor="?colorControlNormal"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/action_button_reply"
tools:ignore="HardcodedText" tools:ignore="HardcodedText"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<HorizontalScrollView <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/action_button_extra_container" android:id="@+id/action_button_extra_container"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fillViewport="true" android:fillViewport="true"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_more" app:layout_constraintEnd_toStartOf="@+id/action_button_more"
app:layout_constraintStart_toEndOf="@+id/action_button_reply_count" android:layout_width="0dp"
app:layout_constraintStart_toEndOf="@+id/action_button_reply_container"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout <HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:scrollbars="none">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="match_parent"
android:orientation="horizontal">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/action_button_boost_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_boost" android:id="@+id/action_button_boost"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginStart="10dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/reblog_add" android:contentDescription="@string/reblog_add"
app:activeImage="@drawable/ic_round_repeat_active_24" app:activeImage="@drawable/ic_round_repeat_active_24"
app:iconSize="28dp" app:iconSize="28dp"
app:inactiveImage="@drawable/ic_round_repeat_24" app:inactiveImage="@drawable/ic_round_repeat_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_favorite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/boost_icon" app:primaryColor="@color/boost_icon"
app:secondaryColor="@color/boost_icon" /> app:secondaryColor="@color/boost_icon" />
@ -699,10 +716,17 @@
android:text="0" android:text="0"
android:textColor="?colorControlNormal" android:textColor="?colorControlNormal"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/action_button_boost"
tools:ignore="HardcodedText" tools:ignore="HardcodedText"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/action_button_favorite_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_favorite" android:id="@+id/action_button_favorite"
@ -715,10 +739,6 @@
app:activeImage="@drawable/ic_round_star_24" app:activeImage="@drawable/ic_round_star_24"
app:animationSpeed="1.5" app:animationSpeed="1.5"
app:inactiveImage="@drawable/ic_round_star_border_24" app:inactiveImage="@drawable/ic_round_star_border_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_bookmark"
app:layout_constraintStart_toEndOf="@+id/action_button_boost_count"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/marked_icon" app:primaryColor="@color/marked_icon"
app:secondaryColor="@color/marked_icon" app:secondaryColor="@color/marked_icon"
sparkbutton:iconSize="28dp" /> sparkbutton:iconSize="28dp" />
@ -731,11 +751,9 @@
android:text="0" android:text="0"
android:textColor="?colorControlNormal" android:textColor="?colorControlNormal"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/action_button_favorite"
tools:ignore="HardcodedText" tools:ignore="HardcodedText"
tools:visibility="visible" /> tools:visibility="visible" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_bookmark" android:id="@+id/action_button_bookmark"
@ -743,29 +761,23 @@
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/bookmark_add" android:contentDescription="@string/bookmark_add"
app:activeImage="@drawable/ic_round_bookmark_24" app:activeImage="@drawable/ic_round_bookmark_24"
app:animationSpeed="1.5" app:animationSpeed="1.5"
app:inactiveImage="@drawable/ic_round_bookmark_border_24" app:inactiveImage="@drawable/ic_round_bookmark_border_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_quote"
app:layout_constraintStart_toEndOf="@+id/action_button_favorite"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/marked_icon" app:primaryColor="@color/marked_icon"
app:secondaryColor="@color/marked_icon" app:secondaryColor="@color/marked_icon"
sparkbutton:iconSize="28dp" /> sparkbutton:iconSize="28dp" />
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_quote" android:id="@+id/action_button_quote"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_translate"
app:layout_constraintStart_toEndOf="@+id/action_button_bookmark"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/quote" android:contentDescription="@string/quote"
app:activeImage="@drawable/ic_baseline_format_quote_24" app:activeImage="@drawable/ic_baseline_format_quote_24"
@ -775,14 +787,11 @@
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_translate" android:id="@+id/action_button_translate"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_maths"
app:layout_constraintStart_toEndOf="@+id/action_button_quote"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/translate" android:contentDescription="@string/translate"
app:activeImage="@drawable/ic_baseline_translate_24" app:activeImage="@drawable/ic_baseline_translate_24"
@ -792,14 +801,11 @@
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_maths" android:id="@+id/action_button_maths"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/action_button_markdown"
app:layout_constraintStart_toEndOf="@+id/action_button_translate"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/formula" android:contentDescription="@string/formula"
app:activeImage="@drawable/ic_baseline_functions_24" app:activeImage="@drawable/ic_baseline_functions_24"
@ -809,14 +815,11 @@
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_markdown" android:id="@+id/action_button_markdown"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/status_add_custom_emoji"
app:layout_constraintStart_toEndOf="@+id/action_button_maths"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/markdown" android:contentDescription="@string/markdown"
app:activeImage="@drawable/baseline_code_24" app:activeImage="@drawable/baseline_code_24"
@ -826,14 +829,11 @@
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/status_add_custom_emoji" android:id="@+id/status_add_custom_emoji"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/status_emoji"
app:layout_constraintStart_toEndOf="@+id/action_button_markdown"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/add_reaction" android:contentDescription="@string/add_reaction"
app:activeImage="@drawable/ic_baseline_emoji_emotions_24" app:activeImage="@drawable/ic_baseline_emoji_emotions_24"
@ -843,14 +843,11 @@
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/status_emoji" android:id="@+id/status_emoji"
android:layout_marginStart="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/status_add_custom_emoji"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:contentDescription="@string/add_reaction" android:contentDescription="@string/add_reaction"
app:activeImage="@drawable/ic_baseline_add_reaction_24" app:activeImage="@drawable/ic_baseline_add_reaction_24"
@ -858,13 +855,17 @@
app:inactiveImage="@drawable/ic_baseline_add_reaction_24" app:inactiveImage="@drawable/ic_baseline_add_reaction_24"
sparkbutton:iconSize="28dp" /> sparkbutton:iconSize="28dp" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.appcompat.widget.LinearLayoutCompat>
</HorizontalScrollView> </HorizontalScrollView>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_more" android:id="@+id/action_button_more"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
@ -873,9 +874,6 @@
android:contentDescription="@string/display_options" android:contentDescription="@string/display_options"
app:activeImage="@drawable/ic_round_more_horiz_24" app:activeImage="@drawable/ic_round_more_horiz_24"
app:inactiveImage="@drawable/ic_round_more_horiz_24" app:inactiveImage="@drawable/ic_round_more_horiz_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
sparkbutton:iconSize="28dp" /> sparkbutton:iconSize="28dp" />