Auto reselect system folders

This commit is contained in:
M66B
2022-11-11 09:30:26 +01:00
parent 28782301cc
commit 7b03bb0777
4 changed files with 2868 additions and 10 deletions

View File

@@ -30,6 +30,7 @@ import android.Manifest;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
@@ -64,6 +65,7 @@ import androidx.constraintlayout.widget.Group;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.preference.PreferenceManager;
import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textfield.TextInputLayout;
@@ -1419,6 +1421,15 @@ public class FragmentAccount extends FragmentBase {
args.putBoolean("saved", true);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("unset." + account.id + "." + EntityFolder.DRAFTS, drafts == null);
editor.putBoolean("unset." + account.id + "." + EntityFolder.SENT, sent == null);
editor.putBoolean("unset." + account.id + "." + EntityFolder.ARCHIVE, archive == null);
editor.putBoolean("unset." + account.id + "." + EntityFolder.TRASH, trash == null);
editor.putBoolean("unset." + account.id + "." + EntityFolder.JUNK, junk == null);
editor.apply();
return false;
}