diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ExtendedFooterStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ExtendedFooterStatusDisplayItem.java index c21ee992f..9fefedbbe 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ExtendedFooterStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ExtendedFooterStatusDisplayItem.java @@ -9,6 +9,8 @@ import android.text.style.ForegroundColorSpan; import android.text.style.TypefaceSpan; import android.view.View; import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; import android.widget.TextView; import org.joinmastodon.android.R; @@ -45,18 +47,19 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{ } public static class Holder extends StatusDisplayItem.Holder{ - private final TextView time, favoritesCount, reblogsCount, lastEditTime; - private final View favorites, reblogs, editHistory; + private final TextView time; + private final Button favorites, reblogs, editHistory; + private final ImageView visibility; + private final Context context; public Holder(Context context, ViewGroup parent){ super(context, R.layout.display_item_extended_footer, parent); + this.context = context; reblogs=findViewById(R.id.reblogs); favorites=findViewById(R.id.favorites); editHistory=findViewById(R.id.edit_history); time=findViewById(R.id.timestamp); - favoritesCount=findViewById(R.id.favorites_count); - reblogsCount=findViewById(R.id.reblogs_count); - lastEditTime=findViewById(R.id.last_edited); + visibility=findViewById(R.id.visibility); reblogs.setOnClickListener(v->startAccountListFragment(StatusReblogsListFragment.class)); favorites.setOnClickListener(v->startAccountListFragment(StatusFavoritesListFragment.class)); @@ -67,11 +70,11 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{ @Override public void onBind(ExtendedFooterStatusDisplayItem item){ Status s=item.status; - favoritesCount.setText(String.format("%,d", s.favouritesCount)); - reblogsCount.setText(String.format("%,d", s.reblogsCount)); + favorites.setText(context.getResources().getQuantityString(R.plurals.x_favorites, (int)(s.favouritesCount%1000), s.favouritesCount)); + reblogs.setText(context.getResources().getQuantityString(R.plurals.x_reblogs, (int)(s.reblogsCount%1000), s.reblogsCount)); if(s.editedAt!=null){ editHistory.setVisibility(View.VISIBLE); - lastEditTime.setText(item.parentFragment.getString(R.string.last_edit_at_x, UiUtils.formatRelativeTimestampAsMinutesAgo(itemView.getContext(), s.editedAt))); + editHistory.setText(UiUtils.formatRelativeTimestampAsMinutesAgo(itemView.getContext(), s.editedAt)); }else{ editHistory.setVisibility(View.GONE); } @@ -81,6 +84,12 @@ public class ExtendedFooterStatusDisplayItem extends StatusDisplayItem{ }else{ time.setText(timeStr); } + visibility.setImageResource(switch (s.visibility) { + case PUBLIC -> R.drawable.ic_fluent_earth_20_regular; + case UNLISTED -> R.drawable.ic_fluent_people_20_regular; + case PRIVATE -> R.drawable.ic_fluent_people_checkmark_20_regular; + case DIRECT -> R.drawable.ic_at_symbol; + }); } @Override diff --git a/mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20_regular.xml new file mode 100644 index 000000000..f68a8d413 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_earth_20_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_earth_20_regular.xml new file mode 100644 index 000000000..2ddaeff4f --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_earth_20_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_edit_20_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_edit_20_regular.xml new file mode 100644 index 000000000..00f8ffc3d --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_edit_20_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_people_20_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_people_20_regular.xml new file mode 100644 index 000000000..dd34abfff --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_people_20_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_people_checkmark_20_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_people_checkmark_20_regular.xml new file mode 100644 index 000000000..ea9b43e28 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_people_checkmark_20_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_star_20_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_star_20_regular.xml new file mode 100644 index 000000000..9264d008c --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_star_20_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/layout/display_item_extended_footer.xml b/mastodon/src/main/res/layout/display_item_extended_footer.xml index 0ffb41f21..dbfe113a8 100644 --- a/mastodon/src/main/res/layout/display_item_extended_footer.xml +++ b/mastodon/src/main/res/layout/display_item_extended_footer.xml @@ -2,150 +2,92 @@ + android:layout_height="wrap_content" + android:background="?colorBackgroundLightest"> - + android:layout_height="wrap_content"> - - - - - + android:background="@drawable/bg_text_button" + android:fontFamily="sans-serif" + android:drawableStart="@drawable/ic_fluent_arrow_repeat_all_20_regular" + android:drawablePadding="8dp" + android:drawableTint="?android:textColorSecondary" + tools:text="4 reblogs"/> - - - - - - - - - + android:background="@drawable/bg_text_button" + android:fontFamily="sans-serif" + android:drawableStart="@drawable/ic_fluent_star_20_regular" + android:drawablePadding="8dp" + android:drawableTint="?android:textColorSecondary" + tools:text="12 favorites"/> - - - - - - - - - + android:background="@drawable/bg_text_button" + android:fontFamily="sans-serif" + android:drawableStart="@drawable/ic_fluent_edit_20_regular" + android:drawablePadding="8dp" + android:drawableTint="?android:textColorSecondary" + tools:text="edited"/> - + - + android:layout_marginHorizontal="8dp" + android:minHeight="48dp"> + + + + + + \ No newline at end of file