move edit-name-etc to normal menu, the avatar is displayed anyway

This commit is contained in:
B. Petersen 2019-05-24 11:22:37 +02:00
parent 1fb81d69dd
commit 67b1dea4c1
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC
4 changed files with 23 additions and 18 deletions

View file

@ -2,11 +2,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="@string/menu_group_name_and_image"
android:id="@+id/edit_group_name_and_image"
android:icon="@drawable/ic_create_white_24dp"
app:showAsAction="always"/>
<item android:title="@string/menu_mute"
android:id="@+id/menu_mute_notifications"
app:showAsAction="never"/>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- android:icon="@drawable/ic_create_white_24dp" app:showAsAction="always" is not needed as the image is already shown
and editing group images and names is not an action that is used every time the profile is opened -->
<item android:title="@string/menu_group_name_and_image"
android:id="@+id/edit_name_etc"
app:showAsAction="never"/>
</menu>

View file

@ -2,11 +2,6 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="@string/menu_edit_name"
android:id="@+id/edit_contact_name"
android:icon="@drawable/ic_create_white_24dp"
app:showAsAction="always"/>
<item android:title="@string/profile_encryption"
android:id="@+id/show_encr_info"
app:showAsAction="never"/>

View file

@ -90,12 +90,14 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.profile_common, menu);
if (!chatIsGroup) {
menu.findItem(R.id.edit_name_etc).setTitle(R.string.menu_edit_name);
}
if (!isSelfProfile()) {
if (chatId != 0) {
inflater.inflate(R.menu.profile_chat, menu);
if (!chatIsGroup) {
menu.findItem(R.id.edit_group_name_and_image).setVisible(false);
}
}
if (isContactProfile()) {
@ -298,11 +300,13 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
case R.id.menu_vibrate:
onVibrateSettings();
break;
case R.id.edit_group_name_and_image:
case R.id.edit_name_etc:
if (chatIsGroup) {
onEditGroupNameAndImage();
break;
case R.id.edit_contact_name:
}
else {
onEditContactName();
}
break;
case R.id.show_encr_info:
onEncrInfo();