diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-09-21 12:43:41 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-09-21 12:43:41 +0200 |
commit | c5c9c92b26759d475af1ce79fcd065e4a7128ccc (patch) | |
tree | acd7ff0f501665a49c42e3140fa967e31ca46967 /src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java | |
parent | 5289ddd6d8037ae03d5a3ec46a160b93ac8fe0d4 (diff) |
show context menu in channel search to share uri
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java index 7696bd4eb..7e0d97ea2 100644 --- a/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ChannelDiscoveryActivity.java @@ -35,8 +35,8 @@ import rocks.xmpp.addr.Jid; public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.OnActionExpandListener, TextView.OnEditorActionListener, ChannelDiscoveryService.OnChannelSearchResultsFound, ChannelSearchResultAdapter.OnChannelSearchResultSelected { private static final String CHANNEL_DISCOVERY_OPT_IN = "channel_discovery_opt_in"; private final ChannelSearchResultAdapter adapter = new ChannelSearchResultAdapter(); - private ActivityChannelDiscoveryBinding binding; private final PendingItem<String> mInitialSearchValue = new PendingItem<>(); + private ActivityChannelDiscoveryBinding binding; private MenuItem mMenuSearchView; private EditText mSearchEditText; private boolean optedIn = false; @@ -189,6 +189,19 @@ public class ChannelDiscoveryActivity extends XmppActivity implements MenuItem.O } } + @Override + public boolean onContextItemSelected(MenuItem item) { + final MuclumbusService.Room room = adapter.getCurrent(); + if (room != null) { + switch (item.getItemId()) { + case R.id.share_with: + StartConversationActivity.shareAsChannel(this, room.address); + return true; + } + } + return false; + } + public void joinChannelSearchResult(String accountJid, MuclumbusService.Room result) { final boolean syncAutojoin = getBooleanPreference("autojoin", R.bool.autojoin); Account account = xmppConnectionService.findAccountByJid(Jid.of(accountJid)); |