Reorganized compose menu

pull/178/head
M66B 5 years ago
parent 206c3b06a9
commit c93ac65b0c

@ -1148,17 +1148,17 @@ public class FragmentCompose extends FragmentBase {
menu.findItem(R.id.menu_zoom).setVisible(state == State.LOADED); menu.findItem(R.id.menu_zoom).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_media).setVisible(state == State.LOADED); menu.findItem(R.id.menu_media).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_compact).setVisible(state == State.LOADED); menu.findItem(R.id.menu_compact).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_clear).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_contact_group).setVisible(state == State.LOADED); menu.findItem(R.id.menu_contact_group).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_answer).setVisible(state == State.LOADED); menu.findItem(R.id.menu_answer).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_clear).setVisible(state == State.LOADED);
menu.findItem(R.id.menu_encrypt).setEnabled(!busy); menu.findItem(R.id.menu_encrypt).setEnabled(!busy);
menu.findItem(R.id.menu_zoom).setEnabled(!busy); menu.findItem(R.id.menu_zoom).setEnabled(!busy);
menu.findItem(R.id.menu_media).setEnabled(!busy); menu.findItem(R.id.menu_media).setEnabled(!busy);
menu.findItem(R.id.menu_compact).setEnabled(!busy); menu.findItem(R.id.menu_compact).setEnabled(!busy);
menu.findItem(R.id.menu_clear).setEnabled(!busy);
menu.findItem(R.id.menu_contact_group).setEnabled(!busy && hasPermission(Manifest.permission.READ_CONTACTS)); menu.findItem(R.id.menu_contact_group).setEnabled(!busy && hasPermission(Manifest.permission.READ_CONTACTS));
menu.findItem(R.id.menu_answer).setEnabled(!busy); menu.findItem(R.id.menu_answer).setEnabled(!busy);
menu.findItem(R.id.menu_clear).setEnabled(!busy);
int colorEncrypt = Helper.resolveColor(getContext(), R.attr.colorEncrypt); int colorEncrypt = Helper.resolveColor(getContext(), R.attr.colorEncrypt);
ImageButton ib = (ImageButton) menu.findItem(R.id.menu_encrypt).getActionView(); ImageButton ib = (ImageButton) menu.findItem(R.id.menu_encrypt).getActionView();
@ -1214,18 +1214,18 @@ public class FragmentCompose extends FragmentBase {
case R.id.menu_compact: case R.id.menu_compact:
onMenuCompact(); onMenuCompact();
return true; return true;
case R.id.menu_clear:
StyleHelper.apply(R.id.menu_clear, etBody);
return true;
case R.id.menu_legend:
onMenuLegend();
return true;
case R.id.menu_contact_group: case R.id.menu_contact_group:
onMenuContactGroup(); onMenuContactGroup();
return true; return true;
case R.id.menu_answer: case R.id.menu_answer:
onMenuAnswer(); onMenuAnswer();
return true; return true;
case R.id.menu_clear:
StyleHelper.apply(R.id.menu_clear, etBody);
return true;
case R.id.menu_legend:
onMenuLegend();
return true;
default: default:
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }

@ -41,22 +41,22 @@
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/menu_legend" android:id="@+id/menu_contact_group"
android:title="@string/menu_legend" android:title="@string/title_insert_contact_group"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/menu_clear" android:id="@+id/menu_answer"
android:title="@string/title_style_clear" android:title="@string/title_insert_template"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/menu_contact_group" android:id="@+id/menu_clear"
android:title="@string/title_insert_contact_group" android:title="@string/title_style_clear"
app:showAsAction="never" /> app:showAsAction="never" />
<item <item
android:id="@+id/menu_answer" android:id="@+id/menu_legend"
android:title="@string/title_insert_template" android:title="@string/menu_legend"
app:showAsAction="never" /> app:showAsAction="never" />
</menu> </menu>

Loading…
Cancel
Save