Search: small behavior improvement

This commit is contained in:
M66B 2022-03-13 11:37:29 +01:00
parent fd6ff59280
commit 65e3d6bdfb
2 changed files with 4 additions and 7 deletions

View File

@ -238,7 +238,6 @@ public class FragmentDialogSearch extends FragmentDialogBase {
cbHtml.setVisibility(View.GONE);
cbSearchTrash.setVisibility(View.GONE);
cbSearchJunk.setVisibility(View.GONE);
cbSearchDevice.setVisibility(View.GONE);
} else {
ibMore.setImageLevel(0);
grpMore.setVisibility(View.VISIBLE);
@ -250,8 +249,6 @@ public class FragmentDialogSearch extends FragmentDialogBase {
cbSearchTrash.setVisibility(View.VISIBLE);
cbSearchJunk.setVisibility(View.VISIBLE);
}
if (account > 0 && folder > 0)
cbSearchDevice.setVisibility(View.VISIBLE);
}
}
};
@ -376,13 +373,13 @@ public class FragmentDialogSearch extends FragmentDialogBase {
tvAfter.setText(null);
tvBefore.setText(null);
cbSearchDevice.setChecked(last_search_device);
cbSearchDevice.setEnabled(account > 0 && folder > 0);
grpMore.setVisibility(View.GONE);
cbHeaders.setVisibility(View.GONE);
cbHtml.setVisibility(View.GONE);
cbSearchTrash.setVisibility(View.GONE);
cbSearchJunk.setVisibility(View.GONE);
cbSearchDevice.setVisibility(View.GONE);
final AlertDialog dialog = new AlertDialog.Builder(context)
.setView(dview)
@ -429,7 +426,7 @@ public class FragmentDialogSearch extends FragmentDialogBase {
if (before != null)
criteria.before = ((Calendar) before).getTimeInMillis();
boolean device = (cbSearchDevice.isChecked() || account < 0 || folder < 0);
boolean device = (cbSearchDevice.isChecked() || !cbSearchDevice.isEnabled());
if (criteria.query != null) {
List<String> searches = new ArrayList<>();
@ -527,7 +524,7 @@ public class FragmentDialogSearch extends FragmentDialogBase {
else if (id == R.id.ibNotes)
criteria.with_notes = true;
boolean device = (cbSearchDevice.isChecked() || account < 0 || folder < 0);
boolean device = (cbSearchDevice.isChecked() || !cbSearchDevice.isEnabled());
FragmentMessages.search(
context, getViewLifecycleOwner(), getParentFragmentManager(),

View File

@ -559,6 +559,6 @@
app:constraint_referenced_ids="
cbSearchIndex,tvSearchIndexHint,cbSenders,cbRecipients,cbSubject,cbKeywords,cbMessage,tvSearchTextHint,tvSearchTextUnsupported,cbNotes,
tvAnd,cbUnseen,cbFlagged,cbHidden,cbEncrypted,cbAttachments,
btnAfter,btnBefore,tvBefore,tvAfter" />
btnAfter,btnBefore,tvBefore,tvAfter,cbSearchDevice" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>