Added account/identity copy

This commit is contained in:
M66B
2019-08-13 12:07:30 +02:00
parent 3012584eae
commit efba726dc8
5 changed files with 67 additions and 28 deletions

View File

@@ -214,6 +214,8 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
popupMenu.getMenu().add(Menu.NONE, R.string.title_edit_channel, 2, R.string.title_edit_channel);
}
popupMenu.getMenu().add(Menu.NONE, R.string.title_copy, 3, R.string.title_copy);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@@ -226,6 +228,10 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
onActionEditChannel();
return true;
case R.string.title_copy:
onActionCopy();
return true;
default:
return false;
}
@@ -271,6 +277,14 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
.putExtra(Settings.EXTRA_CHANNEL_ID, EntityAccount.getNotificationChannelId(account.id));
context.startActivity(intent);
}
private void onActionCopy() {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(settings ? ActivitySetup.ACTION_EDIT_ACCOUNT : ActivityView.ACTION_VIEW_FOLDERS)
.putExtra("id", account.id)
.putExtra("copy", true));
}
});
popupMenu.show();