mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #1886 from deltachat/adb-fix-group-profile-menu
Improve profile menus
This commit is contained in:
@@ -10,6 +10,11 @@
|
||||
android:icon="@drawable/ic_delete_white_24dp"
|
||||
app:showAsAction="always"/>
|
||||
|
||||
<item android:id="@+id/share"
|
||||
android:title="@string/menu_share"
|
||||
android:icon="@drawable/ic_share_white_24dp"
|
||||
app:showAsAction="always" />
|
||||
|
||||
<item android:id="@+id/show_in_chat"
|
||||
android:title="@string/show_in_chat"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
@@ -91,4 +91,8 @@ public abstract class MessageSelectorFragment
|
||||
intent.putExtra(ConversationActivity.STARTING_POSITION_EXTRA, DcMsg.getMessagePosition(dcMsg, dcContext));
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
protected void handleShare(final DcMsg dcMsg) {
|
||||
dcContext.openForViewOrShare(getContext(), dcMsg.getId(), Intent.ACTION_SEND);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ public class ProfileDocumentsFragment
|
||||
menu.findItem(R.id.details).setVisible(singleSelection);
|
||||
menu.findItem(R.id.show_in_chat).setVisible(singleSelection);
|
||||
menu.findItem(R.id.save).setVisible(singleSelection);
|
||||
menu.findItem(R.id.share).setVisible(singleSelection);
|
||||
}
|
||||
|
||||
private ProfileDocumentsAdapter getListAdapter() {
|
||||
@@ -217,6 +218,9 @@ public class ProfileDocumentsFragment
|
||||
handleDeleteMessages(getListAdapter().getSelectedMedia());
|
||||
mode.finish();
|
||||
return true;
|
||||
case R.id.share:
|
||||
handleShare(getSelectedMessageRecord(getListAdapter().getSelectedMedia()));
|
||||
return true;
|
||||
case R.id.show_in_chat:
|
||||
handleShowInChat(getSelectedMessageRecord(getListAdapter().getSelectedMedia()));
|
||||
return true;
|
||||
|
||||
@@ -189,6 +189,7 @@ public class ProfileGalleryFragment
|
||||
menu.findItem(R.id.details).setVisible(singleSelection);
|
||||
menu.findItem(R.id.show_in_chat).setVisible(singleSelection);
|
||||
menu.findItem(R.id.save).setVisible(singleSelection);
|
||||
menu.findItem(R.id.share).setVisible(singleSelection);
|
||||
}
|
||||
|
||||
private ProfileGalleryAdapter getListAdapter() {
|
||||
@@ -229,6 +230,9 @@ public class ProfileGalleryFragment
|
||||
handleDeleteMessages(getListAdapter().getSelectedMedia());
|
||||
mode.finish();
|
||||
return true;
|
||||
case R.id.share:
|
||||
handleShare(getSelectedMessageRecord(getListAdapter().getSelectedMedia()));
|
||||
return true;
|
||||
case R.id.show_in_chat:
|
||||
handleShowInChat(getSelectedMessageRecord(getListAdapter().getSelectedMedia()));
|
||||
return true;
|
||||
|
||||
@@ -250,6 +250,10 @@ public class ProfileSettingsFragment extends Fragment
|
||||
mode.getMenuInflater().inflate(R.menu.profile_context, menu);
|
||||
DcChat dcChat = dcContext.getChat(chatId);
|
||||
menu.findItem(R.id.delete).setVisible(!dcChat.isMailingList());
|
||||
menu.findItem(R.id.details).setVisible(false);
|
||||
menu.findItem(R.id.show_in_chat).setVisible(false);
|
||||
menu.findItem(R.id.save).setVisible(false);
|
||||
menu.findItem(R.id.share).setVisible(false);
|
||||
mode.setTitle("1");
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
|
||||
Reference in New Issue
Block a user