Added menu divider in answer menu

pull/204/head
M66B 3 years ago
parent e8a8be6542
commit 3704f10f55

@ -2634,7 +2634,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
int order = 100; int order = 100;
for (EntityAnswer answer : data.answers) { for (EntityAnswer answer : data.answers) {
order++; order++;
popupMenu.getMenu().add(1, order, order, answer.name) popupMenu.getMenu().add(Menu.FIRST, order, order, answer.name)
.setIcon(R.drawable.twotone_star_24) .setIcon(R.drawable.twotone_star_24)
.setIntent(new Intent().putExtra("id", answer.id)); .setIntent(new Intent().putExtra("id", answer.id));
} }
@ -2642,10 +2642,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
popupMenu.insertIcons(context); popupMenu.insertIcons(context);
MenuCompat.setGroupDividerEnabled(popupMenu.getMenu(), true);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override @Override
public boolean onMenuItemClick(MenuItem target) { public boolean onMenuItemClick(MenuItem target) {
if (target.getGroupId() == 1) { if (target.getGroupId() == Menu.FIRST) {
startActivity(new Intent(context, ActivityCompose.class) startActivity(new Intent(context, ActivityCompose.class)
.putExtra("action", "reply") .putExtra("action", "reply")
.putExtra("reference", message.id) .putExtra("reference", message.id)

Loading…
Cancel
Save