Fix issue #58 - Add a small "+" at the bottom right of reply icon to indicate that there is replies

This commit is contained in:
Thomas 2022-05-17 10:14:15 +02:00
parent b0405ae854
commit bb6e31c00a
2 changed files with 17 additions and 1 deletions

View file

@ -265,6 +265,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
holder.binding.actionButtonFavorite.setInActiveImageTintColor(theme_icons_color); holder.binding.actionButtonFavorite.setInActiveImageTintColor(theme_icons_color);
holder.binding.actionButtonBookmark.setInActiveImageTintColor(theme_icons_color); holder.binding.actionButtonBookmark.setInActiveImageTintColor(theme_icons_color);
holder.binding.actionButtonBoost.setInActiveImageTintColor(theme_icons_color); holder.binding.actionButtonBoost.setInActiveImageTintColor(theme_icons_color);
holder.binding.replyCount.setTextColor(theme_text_color);
} else { } else {
holder.binding.actionButtonFavorite.setInActiveImageTintColor(ThemeHelper.getAttColor(context, R.attr.colorControlNormal)); holder.binding.actionButtonFavorite.setInActiveImageTintColor(ThemeHelper.getAttColor(context, R.attr.colorControlNormal));
holder.binding.actionButtonBookmark.setInActiveImageTintColor(ThemeHelper.getAttColor(context, R.attr.colorControlNormal)); holder.binding.actionButtonBookmark.setInActiveImageTintColor(ThemeHelper.getAttColor(context, R.attr.colorControlNormal));
@ -941,7 +942,6 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
holder.binding.attachmentsListContainer.setVisibility(View.GONE); holder.binding.attachmentsListContainer.setVisibility(View.GONE);
} }
holder.binding.statusContent.setMovementMethod(LongClickLinkMovementMethod.getInstance()); holder.binding.statusContent.setMovementMethod(LongClickLinkMovementMethod.getInstance());
//holder.binding.statusContent.setMovementMethod(LinkMovementMethod.getInstance());
holder.binding.reblogInfo.setOnClickListener(v -> { holder.binding.reblogInfo.setOnClickListener(v -> {
if (remote) { if (remote) {
Toasty.info(context, context.getString(R.string.retrieve_remote_status), Toasty.LENGTH_SHORT).show(); Toasty.info(context, context.getString(R.string.retrieve_remote_status), Toasty.LENGTH_SHORT).show();
@ -1452,6 +1452,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}); });
popup.show(); popup.show();
}); });
if (statusToDeal.replies_count > 0 && !(context instanceof ContextActivity)) {
holder.binding.replyCount.setVisibility(View.VISIBLE);
} else {
holder.binding.replyCount.setVisibility(View.GONE);
}
holder.binding.actionButtonReply.setOnLongClickListener(v -> { holder.binding.actionButtonReply.setOnLongClickListener(v -> {
CrossActionHelper.doCrossAction(context, CrossActionHelper.TypeOfCrossAction.REPLY_ACTION, null, statusToDeal); CrossActionHelper.doCrossAction(context, CrossActionHelper.TypeOfCrossAction.REPLY_ACTION, null, statusToDeal);
return true; return true;

View file

@ -401,6 +401,17 @@
android:adjustViewBounds="true" android:adjustViewBounds="true"
app:srcCompat="@drawable/ic_reply" /> app:srcCompat="@drawable/ic_reply" />
<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" />
<com.varunest.sparkbutton.SparkButton <com.varunest.sparkbutton.SparkButton
android:id="@+id/action_button_favorite" android:id="@+id/action_button_favorite"
android:layout_width="28dp" android:layout_width="28dp"