summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2023-09-18 09:22:59 +0200
committerThomas <tschneider.ac@gmail.com>2023-09-18 09:22:59 +0200
commitff128ed7d1cf9dc5f0163f3cebf669835dd5b3f0 (patch)
tree0923377195751578e19c5160642574c23a487f3d
parentcf37e16ce53d463a3ab349c91ed73408c650013c (diff)
Dedicate icon
-rw-r--r--app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java18
-rw-r--r--app/src/main/res/layouts/mastodon/drawable/baseline_more_actions.xml10
-rw-r--r--app/src/main/res/layouts/mastodon/layout/drawer_status.xml213
-rw-r--r--app/src/main/res/values/strings.xml1
4 files changed, 125 insertions, 117 deletions
diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java
index f05f5a203..90a13ccde 100644
--- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java
+++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java
@@ -1315,7 +1315,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
holder.binding.editTime.setVisibility(View.GONE);
holder.binding.visibilitySmall.setImageResource(ressource);
if (displayCounters && canBeFederated) {
- holder.binding.replyCount.setText(String.valueOf(statusToDeal.replies_count));
+ holder.binding.actionButtonReplyCount.setText(String.valueOf(statusToDeal.replies_count));
holder.binding.statusInfo.setVisibility(View.VISIBLE);
holder.binding.dateShort.setVisibility(View.GONE);
holder.binding.visibilitySmall.setVisibility(View.GONE);
@@ -2415,9 +2415,9 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
popup.show();
});
if (statusToDeal.replies_count > 0 && !(context instanceof ContextActivity)) {
- holder.binding.replyCount.setVisibility(View.VISIBLE);
+ holder.binding.actionButtonReplyCount.setVisibility(View.VISIBLE);
} else {
- holder.binding.replyCount.setVisibility(View.GONE);
+ holder.binding.actionButtonReplyCount.setVisibility(View.GONE);
}
holder.binding.actionButtonReply.setOnLongClickListener(v -> {
CrossActionHelper.doCrossAction(context, CrossActionHelper.TypeOfCrossAction.REPLY_ACTION, null, statusToDeal);
@@ -2823,10 +2823,10 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}
if (theme_icons_color != -1) {
- Helper.changeDrawableColor(context, holder.binding.actionButtonReply, theme_icons_color);
- Helper.changeDrawableColor(context, holder.binding.statusAddCustomEmoji, theme_icons_color);
- Helper.changeDrawableColor(context, holder.binding.actionButtonQuote, theme_icons_color);
- Helper.changeDrawableColor(context, holder.binding.statusEmoji, theme_icons_color);
+ Helper.changeDrawableColor(context, R.drawable.ic_round_reply_24, theme_icons_color);
+ // Helper.changeDrawableColor(context, holder.binding.statusAddCustomEmoji, theme_icons_color);
+ // Helper.changeDrawableColor(context, holder.binding.actionButtonQuote, theme_icons_color);
+ // Helper.changeDrawableColor(context, holder.binding.statusEmoji, theme_icons_color);
Helper.changeDrawableColor(context, holder.binding.actionButtonMore, theme_icons_color);
Helper.changeDrawableColor(context, R.drawable.ic_round_star_24, theme_icons_color);
Helper.changeDrawableColor(context, R.drawable.ic_round_repeat_24, theme_icons_color);
@@ -2835,11 +2835,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
Helper.changeDrawableColor(context, R.drawable.ic_person, theme_icons_color);
Helper.changeDrawableColor(context, R.drawable.ic_bot, theme_icons_color);
Helper.changeDrawableColor(context, R.drawable.ic_round_reply_24, theme_icons_color);
- Helper.changeDrawableColor(context, holder.binding.actionButtonTranslate, theme_icons_color);
+ // Helper.changeDrawableColor(context, holder.binding.actionButtonTranslate, theme_icons_color);
holder.binding.actionButtonBoost.setInActiveImageTintColor(theme_icons_color);
holder.binding.actionButtonFavorite.setInActiveImageTintColor(theme_icons_color);
holder.binding.actionButtonBookmark.setInActiveImageTintColor(theme_icons_color);
- holder.binding.replyCount.setTextColor(theme_icons_color);
+ holder.binding.actionButtonReplyCount.setTextColor(theme_icons_color);
}
if (theme_statuses_color != -1) {
holder.binding.cardviewContainer.setBackgroundColor(theme_statuses_color);
diff --git a/app/src/main/res/layouts/mastodon/drawable/baseline_more_actions.xml b/app/src/main/res/layouts/mastodon/drawable/baseline_more_actions.xml
new file mode 100644
index 000000000..bf6f2f2f3
--- /dev/null
+++ b/app/src/main/res/layouts/mastodon/drawable/baseline_more_actions.xml
@@ -0,0 +1,10 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:tint="?attr/colorControlNormal"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="?attr/colorControlNormal"
+ android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />
+</vector>
diff --git a/app/src/main/res/layouts/mastodon/layout/drawer_status.xml b/app/src/main/res/layouts/mastodon/layout/drawer_status.xml
index 66ac2f484..4b471a228 100644
--- a/app/src/main/res/layouts/mastodon/layout/drawer_status.xml
+++ b/app/src/main/res/layouts/mastodon/layout/drawer_status.xml
@@ -632,40 +632,34 @@
android:clipChildren="false"
android:clipToPadding="false">
- <androidx.appcompat.widget.LinearLayoutCompat
- android:id="@+id/action_button_reply_container"
- android:layout_width="wrap_content"
+ <com.varunest.sparkbutton.SparkButton
+ android:id="@+id/action_button_reply"
+ android:layout_width="48dp"
android:layout_height="48dp"
- android:orientation="horizontal"
+ android:adjustViewBounds="true"
+ android:contentDescription="@string/reply"
+ app:activeImage="@drawable/ic_round_reply_24"
+ app:iconSize="28dp"
+ app:inactiveImage="@drawable/ic_round_reply_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toStartOf="@+id/action_button_boost"
app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_bias="0.0">
-
- <androidx.appcompat.widget.AppCompatImageView
- android:id="@+id/action_button_reply"
- android:layout_width="28dp"
- android:layout_height="28dp"
- android:layout_gravity="center"
- android:adjustViewBounds="true"
- android:background="@color/transparent"
- android:clickable="true"
- android:contentDescription="@string/reply"
- android:focusable="true"
- app:srcCompat="@drawable/ic_round_reply_24" />
+ app:primaryColor="@color/boost_icon"
+ app:secondaryColor="@color/boost_icon" />
- <androidx.appcompat.widget.AppCompatTextView
- android:id="@+id/reply_count"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:text="+"
- android:textColor="?colorControlNormal"
- android:textSize="12sp"
- android:visibility="gone"
- tools:ignore="HardcodedText"
- tools:visibility="visible" />
- </androidx.appcompat.widget.LinearLayoutCompat>
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/action_button_reply_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:text="+"
+ android:textColor="?colorControlNormal"
+ android:visibility="gone"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/action_button_reply"
+ tools:ignore="HardcodedText"
+ tools:visibility="visible" />
<com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_boost"
@@ -677,28 +671,23 @@
app:iconSize="28dp"
app:inactiveImage="@drawable/ic_round_repeat_24"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/action_button_quote"
- app:layout_constraintStart_toEndOf="@+id/action_button_reply_container"
+ app:layout_constraintEnd_toStartOf="@+id/action_button_favorite"
+ app:layout_constraintStart_toEndOf="@+id/action_button_reply_count"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/boost_icon"
app:secondaryColor="@color/boost_icon" />
- <androidx.appcompat.widget.AppCompatImageView
- android:id="@+id/action_button_quote"
- android:layout_width="28dp"
- android:layout_height="28dp"
- android:layout_gravity="center"
- android:adjustViewBounds="true"
- android:background="@color/transparent"
- android:clickable="true"
- android:contentDescription="@string/translate"
- android:focusable="true"
- android:src="@drawable/ic_baseline_format_quote_24"
- android:visibility="gone"
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/action_button_boost_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:text="0"
+ android:textColor="?colorControlNormal"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/action_button_favorite"
app:layout_constraintStart_toEndOf="@+id/action_button_boost"
- app:layout_constraintTop_toTopOf="parent"
+ android:visibility="gone"
+ tools:ignore="HardcodedText"
tools:visibility="visible" />
<com.varunest.sparkbutton.SparkButton
@@ -713,12 +702,26 @@
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_quote"
+ app:layout_constraintStart_toEndOf="@+id/action_button_boost_count"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/marked_icon"
app:secondaryColor="@color/marked_icon"
sparkbutton:iconSize="28dp" />
+ <androidx.appcompat.widget.AppCompatTextView
+ android:id="@+id/action_button_favorite_count"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:text="0"
+ android:textColor="?colorControlNormal"
+ android:visibility="gone"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/action_button_favorite"
+ tools:ignore="HardcodedText"
+ tools:visibility="visible" />
+
+
<com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_bookmark"
android:layout_width="48dp"
@@ -730,86 +733,80 @@
app:animationSpeed="1.5"
app:inactiveImage="@drawable/ic_round_bookmark_border_24"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/action_button_translate"
+ app:layout_constraintEnd_toStartOf="@+id/action_button_extra"
app:layout_constraintStart_toEndOf="@+id/action_button_favorite"
app:layout_constraintTop_toTopOf="parent"
app:primaryColor="@color/marked_icon"
app:secondaryColor="@color/marked_icon"
sparkbutton:iconSize="28dp" />
-
- <androidx.appcompat.widget.AppCompatImageView
- android:id="@+id/action_button_translate"
- android:layout_width="28dp"
- android:layout_height="28dp"
+ <com.varunest.sparkbutton.SparkButton
+ android:id="@+id/action_button_extra"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
android:layout_gravity="center"
android:adjustViewBounds="true"
- android:background="@color/transparent"
- android:clickable="true"
- android:contentDescription="@string/translate"
- android:focusable="true"
- android:src="@drawable/ic_baseline_translate_24"
- android:visibility="gone"
+ android:contentDescription="@string/set_extand_extra_features_title"
+ app:activeImage="@drawable/baseline_more_actions"
+ app:inactiveImage="@drawable/baseline_more_actions"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/action_button_maths"
+ app:layout_constraintEnd_toStartOf="@+id/action_button_more"
app:layout_constraintStart_toEndOf="@+id/action_button_bookmark"
app:layout_constraintTop_toTopOf="parent"
- tools:visibility="visible" />
+ sparkbutton:iconSize="28dp" />
- <androidx.appcompat.widget.AppCompatImageView
- android:id="@+id/action_button_maths"
- android:layout_width="28dp"
- android:layout_height="28dp"
- android:layout_gravity="center"
- android:adjustViewBounds="true"
- android:background="@color/transparent"
- android:clickable="true"
- android:contentDescription="@string/formula"
- android:focusable="true"
- android:src="@drawable/ic_baseline_functions_24"
+ <androidx.constraintlayout.helper.widget.Flow
+ android:id="@+id/extra_features_panel"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@drawable/bg_compose_panels"
+ android:padding="6dp"
android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/status_add_custom_emoji"
- app:layout_constraintStart_toEndOf="@+id/action_button_translate"
- app:layout_constraintTop_toTopOf="parent"
- tools:visibility="visible" />
+ app:constraint_referenced_ids="action_button_quote, action_button_translate, action_button_maths, status_add_custom_emoji, status_emoji"
+ app:flow_maxElementsWrap="3"
+ app:flow_wrapMode="aligned"
+ app:layout_constraintBottom_toBottomOf="@id/action_button_extra"
+ app:layout_constraintStart_toStartOf="parent" />
- <androidx.appcompat.widget.AppCompatImageView
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/action_button_quote"
+ style="@style/Widget.Material3.Button.IconButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:icon="@drawable/ic_baseline_format_quote_24" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/action_button_translate"
+ style="@style/Widget.Material3.Button.IconButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:icon="@drawable/ic_baseline_translate_24" />
+
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/action_button_maths"
+ style="@style/Widget.Material3.Button.IconButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:icon="@drawable/ic_baseline_functions_24" />
+
+
+ <com.google.android.material.button.MaterialButton
android:id="@+id/status_add_custom_emoji"
- android:layout_width="28dp"
- android:layout_height="28dp"
- android:layout_gravity="center"
- android:adjustViewBounds="true"
- android:background="@color/transparent"
- android:clickable="true"
- android:contentDescription="@string/add_reaction"
- android:focusable="true"
- android:src="@drawable/ic_baseline_emoji_emotions_24"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/status_emoji"
- app:layout_constraintStart_toEndOf="@+id/action_button_maths"
- app:layout_constraintTop_toTopOf="parent"
- tools:visibility="visible" />
+ style="@style/Widget.Material3.Button.IconButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:icon="@drawable/ic_baseline_emoji_emotions_24" />
- <androidx.appcompat.widget.AppCompatImageView
+ <com.google.android.material.button.MaterialButton
android:id="@+id/status_emoji"
- android:layout_width="28dp"
- android:layout_height="28dp"
- android:layout_gravity="center"
- android:adjustViewBounds="true"
- android:background="@color/transparent"
- android:clickable="true"
- android:contentDescription="@string/add_reaction"
- android:focusable="true"
- android:src="@drawable/ic_baseline_add_reaction_24"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toStartOf="@+id/action_button_more"
- app:layout_constraintStart_toEndOf="@+id/status_add_custom_emoji"
- app:layout_constraintTop_toTopOf="parent"
- tools:visibility="visible" />
+ style="@style/Widget.Material3.Button.IconButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ app:icon="@drawable/ic_baseline_add_reaction_24" />
+
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/action_button_more"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 473d3eeb3..aeff5353f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1905,6 +1905,7 @@
<string name="icons_extra_features_visibility_summary">If your instance does not accept some extra features, you can hide these icons</string>
<string name="set_display_quote_indication">Display the \"Quote\" button</string>
<string name="set_display_reaction_indication">Display \"Reactions\" buttons</string>
+ <string name="quote">Quote</string>
<string name="bubble">Bubble</string>
<string name="exclude_visibility">Exclude visibility</string>
<string name="reply_visibility">Reply visibility</string>