Added quick search for attachments

pull/183/head
M66B 4 years ago
parent 0955a122fe
commit 9a22a2eecd

@ -59,6 +59,7 @@ public class FragmentDialogSearch extends FragmentDialogBase {
View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_search, null);
final AutoCompleteTextView etQuery = dview.findViewById(R.id.etQuery);
final ImageButton ibAttachment = dview.findViewById(R.id.ibAttachment);
final ImageButton ibEvent = dview.findViewById(R.id.ibInvite);
final ImageButton ibUnseen = dview.findViewById(R.id.ibUnseen);
final ImageButton ibFlagged = dview.findViewById(R.id.ibFlagged);
@ -314,6 +315,9 @@ public class FragmentDialogSearch extends FragmentDialogBase {
BoundaryCallbackMessages.SearchCriteria criteria = new BoundaryCallbackMessages.SearchCriteria();
switch (v.getId()) {
case R.id.ibAttachment:
criteria.with_attachments = true;
break;
case R.id.ibInvite:
criteria.with_attachments = true;
criteria.with_types = new String[]{"text/calendar"};
@ -332,6 +336,7 @@ public class FragmentDialogSearch extends FragmentDialogBase {
}
};
ibAttachment.setOnClickListener(onClick);
ibEvent.setOnClickListener(onClick);
ibUnseen.setOnClickListener(onClick);
ibFlagged.setOnClickListener(onClick);

@ -18,6 +18,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/ibAttachment"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="12dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_search_flag_attachments"
android:padding="6dp"
android:scaleType="fitCenter"
android:tooltipText="@string/title_search_flag_attachments"
app:layout_constraintEnd_toStartOf="@+id/ibInvite"
app:layout_constraintTop_toBottomOf="@id/tvCaption"
app:srcCompat="@drawable/baseline_attachment_24" />
<ImageButton
android:id="@+id/ibInvite"
android:layout_width="36dp"

Loading…
Cancel
Save