From 50baffefbece44eaef2912b66a213a05cd92c218 Mon Sep 17 00:00:00 2001 From: sk Date: Sat, 21 Jan 2023 21:39:11 +0100 Subject: [PATCH] add lists to status header --- .../ui/displayitems/HeaderStatusDisplayItem.java | 11 +++++++++++ mastodon/src/main/res/menu/post.xml | 1 + mastodon/src/main/res/values/strings_sk.xml | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java index 0b99871ef..5af396cbe 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java @@ -33,6 +33,7 @@ import org.joinmastodon.android.api.session.AccountSession; import org.joinmastodon.android.api.session.AccountSessionManager; import org.joinmastodon.android.fragments.BaseStatusListFragment; import org.joinmastodon.android.fragments.ComposeFragment; +import org.joinmastodon.android.fragments.ListTimelinesFragment; import org.joinmastodon.android.fragments.NotificationsListFragment; import org.joinmastodon.android.fragments.ProfileFragment; import org.joinmastodon.android.fragments.ThreadFragment; @@ -264,6 +265,12 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{ UiUtils.confirmToggleBlockDomain(activity, item.parentFragment.getAccountID(), account.getDomain(), relationship!=null && relationship.domainBlocking, ()->{}); }else if(id==R.id.bookmark){ AccountSessionManager.getInstance().getAccount(item.accountID).getStatusInteractionController().setBookmarked(item.status, !item.status.bookmarked); + }else if(id==R.id.manage_user_lists){ + final Bundle args=new Bundle(); + args.putString("account", item.parentFragment.getAccountID()); + args.putString("profileAccount", account.id); + args.putString("profileDisplayUsername", account.getDisplayUsername()); + Nav.go(item.parentFragment.getActivity(), ListTimelinesFragment.class, args); } return true; }); @@ -464,6 +471,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{ MenuItem block=menu.findItem(R.id.block); MenuItem report=menu.findItem(R.id.report); MenuItem follow=menu.findItem(R.id.follow); + MenuItem manageUserLists = menu.findItem(R.id.manage_user_lists); MenuItem bookmark=menu.findItem(R.id.bookmark); bookmark.setVisible(false); /* disabled in megalodon: add/remove bookmark is already available through status footer @@ -480,6 +488,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{ report.setVisible(false); follow.setVisible(false); blockDomain.setVisible(false); + manageUserLists.setVisible(false); }else{ mute.setVisible(true); block.setVisible(true); @@ -500,6 +509,8 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{ boolean following = relationship!=null && relationship.following; follow.setTitle(item.parentFragment.getString(following ? R.string.unfollow_user : R.string.follow_user, account.getShortUsername())); follow.setIcon(following ? R.drawable.ic_fluent_person_delete_24_regular : R.drawable.ic_fluent_person_add_24_regular); + manageUserLists.setVisible(relationship != null && relationship.following); + manageUserLists.setTitle(item.parentFragment.getString(R.string.sk_lists_with_user, account.getShortUsername())); UiUtils.insetPopupMenuIcon(item.parentFragment.getContext(), follow); } } diff --git a/mastodon/src/main/res/menu/post.xml b/mastodon/src/main/res/menu/post.xml index b0de637d0..42d588d9e 100644 --- a/mastodon/src/main/res/menu/post.xml +++ b/mastodon/src/main/res/menu/post.xml @@ -12,6 +12,7 @@ + diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index 9baea2577..798906c1e 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -33,7 +33,7 @@ Follow requests Accept follow request Reject follow request - Edit lists with %s + Lists with %s Always reveal content warnings Disable scrolling text in title bars Contribute to Megalodon