From 040f244e1527dba16e0af49374dac08a042b0545 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Mon, 2 Jan 2023 12:28:07 -0300 Subject: [PATCH] Fixing up the bot icon for good --- .../joinmastodon/android/fragments/ProfileFragment.java | 7 ++++++- mastodon/src/main/res/menu/profile.xml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index adf39d597..9bfda95f8 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -557,11 +557,14 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList if(relationship==null && !isOwnProfile) return; inflater.inflate(isOwnProfile ? R.menu.profile_own : R.menu.profile, menu); - UiUtils.enableOptionsMenuIcons(getActivity(), menu, R.id.bookmarks, R.id.followed_hashtags, R.id.favorites, R.id.scheduled, R.id.share); + UiUtils.enableOptionsMenuIcons(getActivity(), menu, R.id.bookmarks, R.id.followed_hashtags, R.id.favorites, R.id.scheduled, R.id.share, R.id.bot_icon); menu.findItem(R.id.share).setTitle(getString(R.string.share_user, account.getShortUsername())); if(isOwnProfile) return; + MenuItem botIcon = menu.findItem(R.id.bot_icon); + botIcon.setVisible(account.bot); + MenuItem mute = menu.findItem(R.id.mute); mute.setTitle(getString(relationship.muting ? R.string.unmute_user : R.string.mute_user, account.getShortUsername())); mute.setIcon(relationship.muting ? R.drawable.ic_fluent_speaker_0_24_regular : R.drawable.ic_fluent_speaker_off_24_regular); @@ -648,6 +651,8 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList Bundle args=new Bundle(); args.putString("account", accountID); Nav.go(getActivity(), ScheduledStatusListFragment.class, args); + }else if(id==R.id.bot_icon){ + Toast.makeText(getActivity(), R.string.sk_bot_account, Toast.LENGTH_LONG).show(); } return true; } diff --git a/mastodon/src/main/res/menu/profile.xml b/mastodon/src/main/res/menu/profile.xml index 1f2a99a2d..aea46e2f8 100644 --- a/mastodon/src/main/res/menu/profile.xml +++ b/mastodon/src/main/res/menu/profile.xml @@ -1,5 +1,6 @@ +