mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
add contextual menu items to NewConversationActivity
Closes #5390 // FREEBIE
This commit is contained in:
parent
a8a8ec1d40
commit
2a23b53988
@ -1,7 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item android:title="@string/new_conversation_activity__refresh"
|
<item android:title="@string/new_conversation_activity__refresh"
|
||||||
android:id="@+id/menu_refresh"
|
android:id="@+id/menu_refresh"
|
||||||
app:showAsAction="never" />
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item android:title="@string/text_secure_normal__menu_new_group"
|
||||||
|
android:id="@+id/menu_new_group" />
|
||||||
|
|
||||||
|
<item android:title="@string/text_secure_normal__invite_friends"
|
||||||
|
android:id="@+id/menu_invite" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
@ -70,8 +70,10 @@ public class NewConversationActivity extends ContactSelectionActivity {
|
|||||||
super.onOptionsItemSelected(item);
|
super.onOptionsItemSelected(item);
|
||||||
|
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case android.R.id.home: super.onBackPressed(); return true;
|
case android.R.id.home: super.onBackPressed(); return true;
|
||||||
case R.id.menu_refresh: handleManualRefresh(); return true;
|
case R.id.menu_refresh: handleManualRefresh(); return true;
|
||||||
|
case R.id.menu_new_group: handleCreateGroup(); return true;
|
||||||
|
case R.id.menu_invite: handleInvite(); return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -82,6 +84,14 @@ public class NewConversationActivity extends ContactSelectionActivity {
|
|||||||
onRefresh();
|
onRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleCreateGroup() {
|
||||||
|
startActivity(new Intent(this, GroupCreateActivity.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleInvite() {
|
||||||
|
startActivity(new Intent(this, InviteActivity.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean onPrepareOptionsPanel(View view, Menu menu) {
|
protected boolean onPrepareOptionsPanel(View view, Menu menu) {
|
||||||
MenuInflater inflater = this.getMenuInflater();
|
MenuInflater inflater = this.getMenuInflater();
|
||||||
|
Loading…
Reference in New Issue
Block a user