Added searching with importance

master
M66B 3 weeks ago
parent f8c7dc26d9
commit 0f590bb591

1
.gitignore vendored

@ -20,6 +20,7 @@ crowdin.properties
.idea/deploymentTargetSelector.xml
.idea/other.xml
.idea/runConfigurations.xml
.idea/deviceManager.xml
.kotlin
app/.cxx/
build

@ -31,6 +31,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### Next version (Work in progress)
* Adapted for [Android 17](https://developer.android.com/about/versions/17)
* Added searching for important messages
* Small improvements and minor bug fixes
### 1.2315 2026-04-27

@ -31,6 +31,7 @@ For support you can use [the contact form](https://contact.faircode.eu/?product=
### Next version (Work in progress)
* Adapted for [Android 17](https://developer.android.com/about/versions/17)
* Added searching for important messages
* Small improvements and minor bug fixes
### 1.2315 2026-04-27

@ -6821,7 +6821,7 @@ org.zw
// newGTLDs
// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2026-04-15T16:04:02Z
// List of new gTLDs imported from https://www.icann.org/resources/registries/gtlds/v2/gtlds.json on 2026-04-30T16:18:08Z
// This list is auto-generated, don't edit it manually.
// aaa : American Automobile Association, Inc.
// https://www.iana.org/domains/root/db/aaa.html
@ -7007,7 +7007,7 @@ anquan
// https://www.iana.org/domains/root/db/anz.html
anz
// aol : Yahoo Inc.
// aol : AOL Media LLC
// https://www.iana.org/domains/root/db/aol.html
aol
@ -12817,10 +12817,6 @@ craft.me
// Submitted by Ales Krajnik <ales.krajnik@craynic.com>
realm.cz
// Crisp IM SAS : https://crisp.chat/
// Submitted by Baptiste Jamin <hostmaster@crisp.chat>
on.crisp.email
// Cryptonomic : https://cryptonomic.net/
// Submitted by Andrew Cady <public-suffix-list@cryptonomic.net>
*.cryptonomic.net
@ -15659,6 +15655,12 @@ pp.ua
// Submitted by Information Administration <info@sasf.org.cn>
as.sh.cn
// Shanghai Oray Information Technology Co., Ltd.: https://www.oray.com/
// Submitted by: Shanghai Oray Information Technology Co., Ltd. <registrar@oray.com>
vicp.fun
yicp.fun
zicp.fun
// Sheezy.Art : https://sheezy.art
// Submitted by Nyoom <admin@sheezy.art>
sheezy.games
@ -16346,6 +16348,8 @@ zeabur.app
// Zerops : https://zerops.io/
// Submitted by Zerops Team <security@zerops.io>
*.zerops.app
prg1-zerops.zone
*.zerops.zone
// Zine EOOD : https://zine.bg/
// Submitted by Martin Angelov <martin@zine.bg>

@ -354,6 +354,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
criteria.with_unseen,
criteria.with_flagged,
criteria.with_hidden,
criteria.with_importance,
criteria.with_encrypted,
criteria.with_attachments,
criteria.with_notes,
@ -793,6 +794,10 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
return false;
}
if (criteria.with_importance != null)
if (!Objects.equals(message.importance, criteria.with_importance))
return false;
if (criteria.with_encrypted) {
if (message.encrypt == null ||
EntityMessage.ENCRYPT_NONE.equals(message.encrypt))
@ -1060,6 +1065,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
boolean with_flagged;
Integer with_flag_color;
boolean with_hidden;
Integer with_importance;
boolean with_encrypted;
boolean with_attachments;
boolean with_notes;
@ -1314,6 +1320,14 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
flags.add(context.getString(R.string.title_search_flag_flagged));
if (with_hidden)
flags.add(context.getString(R.string.title_search_flag_hidden));
if (with_importance != null) {
if (with_importance.equals(EntityMessage.PRIORITIY_LOW))
flags.add(context.getString(R.string.title_importance_low));
else if (with_importance.equals(EntityMessage.PRIORITIY_NORMAL))
flags.add(context.getString(R.string.title_importance_normal));
else if (with_importance.equals(EntityMessage.PRIORITIY_HIGH))
flags.add(context.getString(R.string.title_importance_high));
}
if (with_encrypted)
flags.add(context.getString(R.string.title_search_flag_encrypted));
if (with_attachments)
@ -1356,6 +1370,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
this.with_flagged == other.with_flagged &&
Objects.equals(this.with_flag_color, other.with_flag_color) &&
this.with_hidden == other.with_hidden &&
Objects.equals(this.with_importance, other.with_importance) &&
this.with_encrypted == other.with_encrypted &&
this.with_attachments == other.with_attachments &&
this.with_notes == other.with_notes &&
@ -1389,6 +1404,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
if (with_flag_color != null)
json.put("with_flag_color", with_flag_color);
json.put("with_hidden", with_hidden);
if (with_importance != null)
json.put("with_importance", with_importance);
json.put("with_encrypted", with_encrypted);
json.put("with_attachments", with_attachments);
json.put("with_notes", with_notes);
@ -1446,6 +1463,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
if (json.has("with_flag_color"))
criteria.with_flag_color = json.getInt("with_flag_color");
criteria.with_hidden = json.optBoolean("with_hidden");
if (json.has("with_importance"))
criteria.with_importance = json.getInt("with_importance");
criteria.with_encrypted = json.optBoolean("with_encrypted");
criteria.with_attachments = json.optBoolean("with_attachments");
criteria.with_notes = json.optBoolean("with_notes");
@ -1501,6 +1520,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
" unseen=" + with_unseen +
" flagged=" + with_flagged + ":" + with_flag_color +
" hidden=" + with_hidden +
" importance=" + with_importance +
" encrypted=" + with_encrypted +
" w/attachments=" + with_attachments +
" w/notes=" + with_notes +

@ -392,6 +392,7 @@ public interface DaoMessage {
" AND (NOT :unseen OR NOT ui_seen)" +
" AND (NOT :flagged OR ui_flagged)" +
" AND (NOT :hidden OR NOT ui_snoozed IS NULL OR ui_unsnoozed)" +
" AND (:importance IS NULL OR importance = :importance)" +
" AND (NOT :encrypted OR ui_encrypt > 0)" +
" AND (NOT :with_attachments OR attachments > 0)" +
" AND (NOT :with_notes OR NOT `notes` IS NULL)" +
@ -407,7 +408,7 @@ public interface DaoMessage {
List<TupleMatch> matchMessages(
Long account, Long folder, long[] exclude, String find,
//boolean senders, boolean recipients, boolean subject, boolean keywords, boolean message, boolean notes, boolean headers,
boolean unseen, boolean flagged, boolean hidden, boolean encrypted, boolean with_attachments, boolean with_notes,
boolean unseen, boolean flagged, boolean hidden, Integer importance, boolean encrypted, boolean with_attachments, boolean with_notes,
int type_count, String[] types,
Integer size,
Long after, Long before, Long touched,

@ -126,6 +126,8 @@ public class FragmentDialogSearch extends FragmentDialogBase {
final CheckBox cbUnseen = dview.findViewById(R.id.cbUnseen);
final CheckBox cbFlagged = dview.findViewById(R.id.cbFlagged);
final CheckBox cbHidden = dview.findViewById(R.id.cbHidden);
final CheckBox cbImportance = dview.findViewById(R.id.cbImportance);
final Spinner spImportance = dview.findViewById(R.id.spImportance);
final CheckBox cbEncrypted = dview.findViewById(R.id.cbEncrypted);
final CheckBox cbAttachments = dview.findViewById(R.id.cbAttachments);
final Spinner spMessageSize = dview.findViewById(R.id.spMessageSize);
@ -441,6 +443,7 @@ public class FragmentDialogSearch extends FragmentDialogBase {
cbFileNames.setChecked(last_search_filenames);
cbSearchTrash.setChecked(last_search_trash);
cbSearchJunk.setChecked(last_search_junk);
spImportance.setSelection(1);
tvAfter.setText(null);
tvBefore.setText(null);
cbSearchDevice.setChecked(last_search_device);
@ -478,6 +481,7 @@ public class FragmentDialogSearch extends FragmentDialogBase {
criteria.with_unseen = cbUnseen.isChecked();
criteria.with_flagged = cbFlagged.isChecked();
criteria.with_hidden = cbHidden.isChecked();
criteria.with_importance = (cbImportance.isChecked() ? spImportance.getSelectedItemPosition() : null);
criteria.with_encrypted = cbEncrypted.isChecked();
criteria.with_attachments = cbAttachments.isChecked();

@ -2093,6 +2093,7 @@ public class FragmentMessages extends FragmentBase
if (viewType != AdapterMessage.ViewType.SEARCH ||
criteria == null ||
criteria.with_hidden ||
criteria.with_importance != null ||
criteria.with_encrypted ||
criteria.with_attachments ||
criteria.with_notes ||

@ -477,6 +477,28 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbFlagged" />
<CheckBox
android:id="@+id/cbImportance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_search_with_importance"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbHidden" />
<eu.faircode.email.SpinnerEx
android:id="@+id/spImportance"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="6dp"
android:entries="@array/priorityNames"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbImportance" />
<CheckBox
android:id="@+id/cbEncrypted"
android:layout_width="0dp"
@ -486,7 +508,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbHidden" />
app:layout_constraintTop_toBottomOf="@id/spImportance" />
<CheckBox
android:id="@+id/cbAttachments"
@ -609,7 +631,7 @@
android:layout_height="0dp"
app:constraint_referenced_ids="
cbSearchIndex,tvSearchIndexHint,cbSenders,cbRecipients,cbSubject,cbKeywords,cbMessage,tvSearchTextHint,tvSearchTextUnsupported,cbNotes,cbFileNames,
tvAnd,cbUnseen,cbFlagged,cbHidden,cbEncrypted,cbAttachments,
tvAnd,cbUnseen,cbFlagged,cbHidden,cbImportance,spImportance,cbEncrypted,cbAttachments,
tvDate,btnAfter,btnBefore,tvBefore,tvAfter,cbSearchDevice" />
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>

@ -1998,6 +1998,7 @@
<string name="title_search_with_unseen">Unread</string>
<string name="title_search_with_flagged">Starred</string>
<string name="title_search_with_hidden">Hidden (on device only)</string>
<string name="title_search_with_importance">Importance (on device only)</string>
<string name="title_search_with_encrypted">Encrypted (on device only)</string>
<string name="title_search_with_attachments">With attachments (on device only)</string>
<string name="title_search_with_size">Message size larger than</string>

@ -31,6 +31,7 @@ Diuqin
Next version (Work in progress)
* Adapted for Android 17
* Added searching for important messages
* Small improvements and minor bug fixes
1.2315 2026-04-27

Loading…
Cancel
Save