Added debug option to add new folders to the nav menu

This commit is contained in:
M66B
2025-10-26 09:29:35 +01:00
parent d0b6492f5c
commit 49ec91e1d3
6 changed files with 34 additions and 5 deletions

View File

@@ -22,9 +22,11 @@ package eu.faircode.email;
import static androidx.room.ForeignKey.CASCADE;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
@@ -331,7 +333,7 @@ public class EntityFolder extends EntityOrder implements Serializable {
display = "Envoyés";
}
void inheritFrom(EntityFolder parent) {
void inheritFrom(EntityFolder parent, Context context) {
if (parent == null)
return;
if (!EntityFolder.USER.equals(type))
@@ -344,6 +346,11 @@ public class EntityFolder extends EntityOrder implements Serializable {
this.sync_days = parent.sync_days;
this.keep_days = parent.keep_days;
this.notify = parent.notify;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean auto_folder_nav = prefs.getBoolean("auto_folder_nav", false);
if (auto_folder_nav)
this.navigation = true;
}
static boolean shouldPoll(String type) {