mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
#1228 group image now behaves like single contact image.
This commit is contained in:
@@ -51,6 +51,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/pager"
|
||||
android:layout_gravity="center"
|
||||
android:padding="8dp"
|
||||
android:adjustViewBounds="true"/>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
||||
@@ -2,10 +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_group_image"
|
||||
android:id="@+id/edit_group_image"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item android:title="@string/menu_mute"
|
||||
android:id="@+id/menu_mute_notifications"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
@@ -168,6 +168,7 @@
|
||||
<string name="menu_select_all">Select all</string>
|
||||
<string name="menu_expand">Expand</string>
|
||||
<string name="menu_edit_name">Edit name</string>
|
||||
<string name="menu_edit_group_name_and_image">Edit group name and image</string>
|
||||
<string name="menu_edit_group_name">Edit group name</string>
|
||||
<string name="menu_edit_group_image">Edit group image</string>
|
||||
<string name="menu_settings">Settings</string>
|
||||
|
||||
@@ -98,7 +98,7 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
titleView = (ConversationTitleView) supportActionBar.getCustomView();
|
||||
titleView.setOnBackClickedListener(view -> onBackPressed());
|
||||
titleView.setOnAvatarClickListener(view -> onShowAndEditImage());
|
||||
titleView.setOnAvatarClickListener(view -> onEnlargeAvatar());
|
||||
|
||||
updateToolbar();
|
||||
|
||||
@@ -118,10 +118,7 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
if (chatId != 0) {
|
||||
inflater.inflate(R.menu.profile_chat, menu);
|
||||
if (chatIsGroup) {
|
||||
menu.findItem(R.id.edit_name).setTitle(R.string.menu_edit_group_name);
|
||||
}
|
||||
else {
|
||||
menu.findItem(R.id.edit_group_image).setVisible(false);
|
||||
menu.findItem(R.id.edit_name).setTitle(R.string.menu_edit_group_name_and_image);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,9 +336,6 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
case R.id.edit_name:
|
||||
onEditName();
|
||||
break;
|
||||
case R.id.edit_group_image:
|
||||
onShowAndEditImage();
|
||||
break;
|
||||
case R.id.show_encr_info:
|
||||
onEncrInfo();
|
||||
break;
|
||||
@@ -398,7 +392,19 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
.show();
|
||||
}
|
||||
|
||||
public void onShowAndEditImage() {
|
||||
public void onEnlargeAvatar() {
|
||||
AvatarImageView profileLarge = findViewById(R.id.profile_large);
|
||||
Recipient recipient;
|
||||
if(chatIsGroup)
|
||||
recipient = dcContext.getRecipient(dcContext.getChat(chatId));
|
||||
else
|
||||
recipient = dcContext.getRecipient(dcContext.getContact(contactId));
|
||||
profileLarge.setAvatar(GlideApp.with(this), recipient, false);
|
||||
profileLarge.setVisibility(ImageView.VISIBLE);
|
||||
profileLarge.setOnClickListener(v -> profileLarge.setVisibility(ImageView.INVISIBLE));
|
||||
}
|
||||
|
||||
public void onEditName() {
|
||||
if (chatIsGroup) {
|
||||
Intent intent = new Intent(this, GroupCreateActivity.class);
|
||||
intent.putExtra(GroupCreateActivity.EDIT_GROUP_CHAT_ID, chatId);
|
||||
@@ -406,19 +412,6 @@ public class ProfileActivity extends PassphraseRequiredActionBarActivity
|
||||
intent.putExtra(GroupCreateActivity.GROUP_CREATE_VERIFIED_EXTRA, true);
|
||||
}
|
||||
startActivity(intent);
|
||||
} else {
|
||||
AvatarImageView profileLarge = findViewById(R.id.profile_large);
|
||||
DcContact contact = dcContext.getContact(contactId);
|
||||
Recipient recipient = dcContext.getRecipient(contact);
|
||||
profileLarge.setAvatar(GlideApp.with(this), recipient, false);
|
||||
profileLarge.setVisibility(ImageView.VISIBLE);
|
||||
profileLarge.setOnClickListener(v -> profileLarge.setVisibility(ImageView.INVISIBLE));
|
||||
}
|
||||
}
|
||||
|
||||
public void onEditName() {
|
||||
if (chatIsGroup) {
|
||||
onShowAndEditImage();
|
||||
}
|
||||
else {
|
||||
DcContact dcContact = dcContext.getContact(contactId);
|
||||
|
||||
Reference in New Issue
Block a user