Added optional notes button

pull/193/head
M66B 4 years ago
parent 19b3930a47
commit 6a45a60536

@ -430,6 +430,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private ImageButton ibSearch;
private ImageButton ibSeen;
private ImageButton ibAnswer;
private ImageButton ibNotes;
private ImageButton ibLabels;
private ImageButton ibKeywords;
private ImageButton ibCopy;
@ -655,6 +656,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch = vsBody.findViewById(R.id.ibSearch);
ibSeen = vsBody.findViewById(R.id.ibSeen);
ibAnswer = vsBody.findViewById(R.id.ibAnswer);
ibNotes = vsBody.findViewById(R.id.ibNotes);
ibLabels = vsBody.findViewById(R.id.ibLabels);
ibKeywords = vsBody.findViewById(R.id.ibKeywords);
ibCopy = vsBody.findViewById(R.id.ibCopy);
@ -756,6 +758,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setOnClickListener(this);
ibSeen.setOnClickListener(this);
ibAnswer.setOnClickListener(this);
ibNotes.setOnClickListener(this);
ibLabels.setOnClickListener(this);
ibKeywords.setOnClickListener(this);
ibCopy.setOnClickListener(this);
@ -866,6 +869,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setOnClickListener(null);
ibSeen.setOnClickListener(null);
ibAnswer.setOnClickListener(null);
ibNotes.setOnClickListener(null);
ibLabels.setOnClickListener(null);
ibKeywords.setOnClickListener(null);
ibCopy.setOnClickListener(null);
@ -1334,6 +1338,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setVisibility(View.GONE);
ibSeen.setVisibility(View.GONE);
ibAnswer.setVisibility(View.GONE);
ibNotes.setVisibility(View.GONE);
ibLabels.setVisibility(View.GONE);
ibKeywords.setVisibility(View.GONE);
ibCopy.setVisibility(View.GONE);
@ -1521,6 +1526,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setVisibility(View.GONE);
ibSeen.setVisibility(View.GONE);
ibAnswer.setVisibility(View.GONE);
ibNotes.setVisibility(View.GONE);
ibLabels.setVisibility(View.GONE);
ibKeywords.setVisibility(View.GONE);
ibCopy.setVisibility(View.GONE);
@ -1675,6 +1681,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean button_move = prefs.getBoolean("button_move", true);
boolean button_copy = prefs.getBoolean("button_copy", false);
boolean button_keywords = prefs.getBoolean("button_keywords", false);
boolean button_notes = prefs.getBoolean("button_notes", false);
boolean button_seen = prefs.getBoolean("button_seen", false);
boolean button_search = prefs.getBoolean("button_search", false);
boolean button_event = prefs.getBoolean("button_event", false);
@ -1695,6 +1702,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibSearch.setVisibility(tools && button_search && (froms > 0 || tos > 0) ? View.VISIBLE : View.GONE);
ibSeen.setVisibility(tools && button_seen && !outbox && seen ? View.VISIBLE : View.GONE);
ibAnswer.setVisibility(!tools || outbox || (!expand_all && expand_one) ? View.GONE : View.VISIBLE);
ibNotes.setVisibility(tools && button_notes ? View.VISIBLE : View.GONE);
ibLabels.setVisibility(tools && labels_header && labels ? View.VISIBLE : View.GONE);
ibKeywords.setVisibility(tools && button_keywords && keywords ? View.VISIBLE : View.GONE);
ibCopy.setVisibility(tools && button_copy && move ? View.VISIBLE : View.GONE);
@ -2981,6 +2989,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
case R.id.ibAnswer:
onActionAnswer(message, ibAnswer);
break;
case R.id.ibNotes:
onMenuNotes(message);
break;
case R.id.ibLabels:
onActionLabels(message);
break;
@ -4022,6 +4033,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean button_move = prefs.getBoolean("button_move", true);
boolean button_copy = prefs.getBoolean("button_copy", false);
boolean button_keywords = prefs.getBoolean("button_keywords", false);
boolean button_notes = prefs.getBoolean("button_notes", false);
boolean button_seen = prefs.getBoolean("button_seen", false);
boolean button_search = prefs.getBoolean("button_search", false);
boolean button_event = prefs.getBoolean("button_event", false);
@ -4039,6 +4051,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
popupMenu.getMenu().findItem(R.id.menu_button_move).setChecked(button_move);
popupMenu.getMenu().findItem(R.id.menu_button_copy).setChecked(button_copy);
popupMenu.getMenu().findItem(R.id.menu_button_keywords).setChecked(button_keywords);
popupMenu.getMenu().findItem(R.id.menu_button_notes).setChecked(button_notes);
popupMenu.getMenu().findItem(R.id.menu_button_seen).setChecked(button_seen);
popupMenu.getMenu().findItem(R.id.menu_button_search).setChecked(button_search);
popupMenu.getMenu().findItem(R.id.menu_button_event).setChecked(button_event);
@ -4117,6 +4130,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
case R.id.menu_button_keywords:
onMenuButton(message, "keywords", target.isChecked());
return true;
case R.id.menu_button_notes:
onMenuButton(message, "notes", target.isChecked());
return true;
case R.id.menu_button_seen:
onMenuButton(message, "seen", target.isChecked());
return true;

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M5,5v14h9v-5h5V5H5zM12,14H7v-2h5V14zM17,10H7V8h10V10z"
android:strokeAlpha="0.3"
android:fillAlpha="0.3"/>
<path
android:fillColor="@android:color/white"
android:pathData="M19,5v9l-5,0l0,5H5V5H19M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h10l6,-6V5C21,3.9 20.1,3 19,3zM12,14H7v-2h5V14zM17,10H7V8h10V10z"/>
</vector>

@ -41,7 +41,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="3dp"
app:constraint_referenced_ids="ibMore,ibInbox,ibJunk,ibTrash,ibArchive,ibMove,ibCopy,ibKeywords,ibLabels,ibAnswer,ibSeen,ibSearch,ibEvent,ibShare,ibPrint,ibUnsubscribe,ibRule,ibUndo"
app:constraint_referenced_ids="ibMore,ibInbox,ibJunk,ibTrash,ibArchive,ibMove,ibCopy,ibKeywords,ibLabels,ibNotes,ibAnswer,ibSeen,ibSearch,ibEvent,ibShare,ibPrint,ibUnsubscribe,ibRule,ibUndo"
app:flow_horizontalBias="0"
app:flow_horizontalGap="3dp"
app:flow_horizontalStyle="packed"
@ -154,6 +154,16 @@
app:srcCompat="@drawable/twotone_label_24"
tools:ignore="MissingConstraints" />
<ImageButton
android:id="@+id/ibNotes"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:padding="6dp"
android:scaleType="fitCenter"
app:srcCompat="@drawable/twotone_sticky_note_2_24"
tools:ignore="MissingConstraints" />
<ImageButton
android:id="@+id/ibAnswer"
android:layout_width="36dp"

@ -28,6 +28,10 @@
android:id="@+id/menu_button_keywords"
android:checkable="true"
android:title="@string/title_keywords_btn" />
<item
android:id="@+id/menu_button_notes"
android:checkable="true"
android:title="@string/title_edit_notes" />
<item
android:id="@+id/menu_button_seen"
android:checkable="true"

Loading…
Cancel
Save