|
|
|
@ -78,6 +78,8 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
boolean last_search_keywords = prefs.getBoolean("last_search_keywords", false);
|
|
|
|
|
boolean last_search_message = prefs.getBoolean("last_search_message", true);
|
|
|
|
|
boolean last_search_notes = prefs.getBoolean("last_search_notes", true);
|
|
|
|
|
boolean last_search_trash = prefs.getBoolean("last_search_trash", true);
|
|
|
|
|
boolean last_search_junk = prefs.getBoolean("last_search_junk", true);
|
|
|
|
|
|
|
|
|
|
View dview = LayoutInflater.from(context).inflate(R.layout.dialog_search, null);
|
|
|
|
|
|
|
|
|
@ -110,6 +112,8 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
final CheckBox cbEncrypted = dview.findViewById(R.id.cbEncrypted);
|
|
|
|
|
final CheckBox cbAttachments = dview.findViewById(R.id.cbAttachments);
|
|
|
|
|
final Spinner spMessageSize = dview.findViewById(R.id.spMessageSize);
|
|
|
|
|
final CheckBox cbSearchTrash = dview.findViewById(R.id.cbSearchTrash);
|
|
|
|
|
final CheckBox cbSearchJunk = dview.findViewById(R.id.cbSearchJunk);
|
|
|
|
|
final Button btnBefore = dview.findViewById(R.id.btnBefore);
|
|
|
|
|
final Button btnAfter = dview.findViewById(R.id.btnAfter);
|
|
|
|
|
final TextView tvBefore = dview.findViewById(R.id.tvBefore);
|
|
|
|
@ -214,6 +218,8 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
grpMore.setVisibility(View.GONE);
|
|
|
|
|
cbHeaders.setVisibility(View.GONE);
|
|
|
|
|
cbHtml.setVisibility(View.GONE);
|
|
|
|
|
cbSearchTrash.setVisibility(View.GONE);
|
|
|
|
|
cbSearchJunk.setVisibility(View.GONE);
|
|
|
|
|
} else {
|
|
|
|
|
ibMore.setImageLevel(0);
|
|
|
|
|
grpMore.setVisibility(View.VISIBLE);
|
|
|
|
@ -221,6 +227,10 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
cbHeaders.setVisibility(View.VISIBLE);
|
|
|
|
|
cbHtml.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
if (account < 0) {
|
|
|
|
|
cbSearchTrash.setVisibility(View.VISIBLE);
|
|
|
|
|
cbSearchJunk.setVisibility(View.VISIBLE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -308,6 +318,20 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cbSearchTrash.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
|
|
prefs.edit().putBoolean("last_search_trash", isChecked).apply();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
cbSearchJunk.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
|
|
prefs.edit().putBoolean("last_search_junk", isChecked).apply();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
btnAfter.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
@ -333,10 +357,14 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
cbNotes.setChecked(last_search_notes);
|
|
|
|
|
tvAfter.setText(null);
|
|
|
|
|
tvBefore.setText(null);
|
|
|
|
|
cbSearchTrash.setChecked(last_search_trash);
|
|
|
|
|
cbSearchJunk.setChecked(last_search_junk);
|
|
|
|
|
|
|
|
|
|
grpMore.setVisibility(View.GONE);
|
|
|
|
|
cbHeaders.setVisibility(View.GONE);
|
|
|
|
|
cbHtml.setVisibility(View.GONE);
|
|
|
|
|
cbSearchTrash.setVisibility(View.GONE);
|
|
|
|
|
cbSearchJunk.setVisibility(View.GONE);
|
|
|
|
|
|
|
|
|
|
final AlertDialog dialog = new AlertDialog.Builder(context)
|
|
|
|
|
.setView(dview)
|
|
|
|
@ -390,6 +418,9 @@ public class FragmentDialogSearch extends FragmentDialogBase {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
criteria.in_trash = cbSearchTrash.isChecked();
|
|
|
|
|
criteria.in_junk = cbSearchJunk.isChecked();
|
|
|
|
|
|
|
|
|
|
Object after = tvAfter.getTag();
|
|
|
|
|
Object before = tvBefore.getTag();
|
|
|
|
|
|
|
|
|
|