From 1015f27554eab53d714bb6bf54294b9b87d0688c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Fri, 10 Mar 2017 23:37:02 +0100 Subject: [PATCH] Mention action on profiles --- .../java/com/keylesspalace/tusky/AccountActivity.java | 9 +++++++++ app/src/main/res/menu/account_toolbar.xml | 4 ++++ app/src/main/res/values/strings.xml | 1 + 3 files changed, 14 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index ddb59820..0a217c9f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -61,6 +61,7 @@ public class AccountActivity extends BaseActivity { private boolean isSelf; private String openInWebUrl; private TabLayout tabLayout; + private Account loadedAccount; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -170,6 +171,8 @@ public class AccountActivity extends BaseActivity { } private void onObtainAccountSuccess(Account account) { + loadedAccount = account; + TextView username = (TextView) findViewById(R.id.account_username); TextView displayName = (TextView) findViewById(R.id.account_display_name); TextView note = (TextView) findViewById(R.id.account_note); @@ -448,6 +451,12 @@ public class AccountActivity extends BaseActivity { onBackPressed(); return true; } + case R.id.action_mention: { + Intent intent = new Intent(this, ComposeActivity.class); + intent.putExtra("mentioned_usernames", new String[] { loadedAccount.username }); + startActivity(intent); + return true; + } case R.id.action_open_in_web: { Uri uri = Uri.parse(openInWebUrl); Intent intent = new Intent(Intent.ACTION_VIEW, uri); diff --git a/app/src/main/res/menu/account_toolbar.xml b/app/src/main/res/menu/account_toolbar.xml index 64b2f22f..41205d26 100644 --- a/app/src/main/res/menu/account_toolbar.xml +++ b/app/src/main/res/menu/account_toolbar.xml @@ -2,6 +2,10 @@ + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 94fa8373..558e3593 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -128,5 +128,6 @@ That user wasn\'t muted. Search accounts… NSFW + Mention