From d4fbb298c19626f772846d15be18b2ba61af2c34 Mon Sep 17 00:00:00 2001 From: sk Date: Sun, 4 Jun 2023 22:57:06 +0200 Subject: [PATCH] use sp for reply line inline icons --- .../displayitems/ReblogOrReplyLineStatusDisplayItem.java | 6 +++--- .../android/ui/displayitems/StatusDisplayItem.java | 6 +++--- .../drawable/ic_fluent_arrow_repeat_all_20sp_filled.xml | 7 +++++++ .../res/drawable/ic_fluent_arrow_reply_20sp_filled.xml | 7 +++++++ .../src/main/res/drawable/ic_fluent_earth_20sp_regular.xml | 7 +++++++ .../res/drawable/ic_fluent_lock_closed_20sp_filled.xml | 7 +++++++ .../main/res/drawable/ic_fluent_lock_open_20sp_regular.xml | 7 +++++++ .../res/drawable/ic_fluent_number_symbol_20sp_filled.xml | 7 +++++++ .../main/res/layout/display_item_reblog_or_reply_line.xml | 2 +- 9 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20sp_filled.xml create mode 100644 mastodon/src/main/res/drawable/ic_fluent_arrow_reply_20sp_filled.xml create mode 100644 mastodon/src/main/res/drawable/ic_fluent_earth_20sp_regular.xml create mode 100644 mastodon/src/main/res/drawable/ic_fluent_lock_closed_20sp_filled.xml create mode 100644 mastodon/src/main/res/drawable/ic_fluent_lock_open_20sp_regular.xml create mode 100644 mastodon/src/main/res/drawable/ic_fluent_number_symbol_20sp_filled.xml diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java index 696944029..03ac49430 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/ReblogOrReplyLineStatusDisplayItem.java @@ -73,9 +73,9 @@ public class ReblogOrReplyLineStatusDisplayItem extends StatusDisplayItem{ public void updateVisibility(StatusPrivacy visibility) { this.visibility = visibility; this.iconEnd = visibility != null ? switch (visibility) { - case PUBLIC -> R.drawable.ic_fluent_earth_20_regular; - case UNLISTED -> R.drawable.ic_fluent_lock_open_20_regular; - case PRIVATE -> R.drawable.ic_fluent_lock_closed_20_filled; + case PUBLIC -> R.drawable.ic_fluent_earth_20sp_regular; + case UNLISTED -> R.drawable.ic_fluent_lock_open_20sp_regular; + case PRIVATE -> R.drawable.ic_fluent_lock_closed_20sp_filled; default -> 0; } : 0; } diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java index c55c4f925..b1bd67d3a 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java @@ -129,7 +129,7 @@ public abstract class StatusDisplayItem{ : fragment.getString(R.string.in_reply_to, account.displayName); replyLine = new ReblogOrReplyLineStatusDisplayItem( parentID, fragment, text, account == null ? List.of() : account.emojis, - R.drawable.ic_fluent_arrow_reply_20_filled, null, null, fullText + R.drawable.ic_fluent_arrow_reply_20sp_filled, null, null, fullText ); } @@ -137,7 +137,7 @@ public abstract class StatusDisplayItem{ boolean isOwnPost = AccountSessionManager.getInstance().isSelf(fragment.getAccountID(), status.account); String fullText = fragment.getString(R.string.user_boosted, status.account.displayName); String text = GlobalUserPreferences.compactReblogReplyLine && replyLine != null ? status.account.displayName : fullText; - items.add(new ReblogOrReplyLineStatusDisplayItem(parentID, fragment, text, status.account.emojis, R.drawable.ic_fluent_arrow_repeat_all_20_filled, isOwnPost ? status.visibility : null, i->{ + items.add(new ReblogOrReplyLineStatusDisplayItem(parentID, fragment, text, status.account.emojis, R.drawable.ic_fluent_arrow_repeat_all_20sp_filled, isOwnPost ? status.visibility : null, i->{ args.putParcelable("profileAccount", Parcels.wrap(status.account)); Nav.go(fragment.getActivity(), ProfileFragment.class, args); }, fullText)); @@ -152,7 +152,7 @@ public abstract class StatusDisplayItem{ // post contains a hashtag the user is following .ifPresent(hashtag -> items.add(new ReblogOrReplyLineStatusDisplayItem( parentID, fragment, hashtag.name, List.of(), - R.drawable.ic_fluent_number_symbol_20_filled, null, + R.drawable.ic_fluent_number_symbol_20sp_filled, null, i -> { args.putString("hashtag", hashtag.name); Nav.go(fragment.getActivity(), HashtagTimelineFragment.class, args); diff --git a/mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20sp_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20sp_filled.xml new file mode 100644 index 000000000..dac0ca015 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_arrow_repeat_all_20sp_filled.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_fluent_arrow_reply_20sp_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_arrow_reply_20sp_filled.xml new file mode 100644 index 000000000..0b67fae20 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_arrow_reply_20sp_filled.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_fluent_earth_20sp_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_earth_20sp_regular.xml new file mode 100644 index 000000000..ba7d44180 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_earth_20sp_regular.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_fluent_lock_closed_20sp_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_lock_closed_20sp_filled.xml new file mode 100644 index 000000000..e096e2ff0 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_lock_closed_20sp_filled.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_fluent_lock_open_20sp_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_lock_open_20sp_regular.xml new file mode 100644 index 000000000..6d5df216f --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_lock_open_20sp_regular.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_fluent_number_symbol_20sp_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_number_symbol_20sp_filled.xml new file mode 100644 index 000000000..29a1c95e8 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_number_symbol_20sp_filled.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/mastodon/src/main/res/layout/display_item_reblog_or_reply_line.xml b/mastodon/src/main/res/layout/display_item_reblog_or_reply_line.xml index b15c5ae8d..c16e85f2e 100644 --- a/mastodon/src/main/res/layout/display_item_reblog_or_reply_line.xml +++ b/mastodon/src/main/res/layout/display_item_reblog_or_reply_line.xml @@ -14,7 +14,7 @@ android:paddingTop="16dp" android:paddingBottom="6dp" android:textAppearance="@style/m3_title_small" - android:drawableStart="@drawable/ic_fluent_arrow_reply_20_filled" + android:drawableStart="@drawable/ic_fluent_arrow_reply_20sp_filled" android:drawableTint="?android:textColorSecondary" android:drawablePadding="6dp" android:singleLine="true"