📄 src/Storage/AppSettings.cs
using Android.Content;

namespace NotesApp.Storage;

public static class AppSettings
{
    private const string PrefsName = "notes_app_settings";
    private const string RootFolderIdKey = "root_folder_id";
    private const string RootFolderPathKey = "root_folder_path";

    private static ISharedPreferences Prefs =>
        Application.Context.GetSharedPreferences(PrefsName, FileCreationMode.Private)!;

    public static string? RootFolderId
    {
        get => Prefs.GetString(RootFolderIdKey, null);
        set => Prefs.Edit()!.PutString(RootFolderIdKey, value)!.Apply();
    }

    public static string? RootFolderPath
    {
        get => Prefs.GetString(RootFolderPathKey, null);
        set => Prefs.Edit()!.PutString(RootFolderPathKey, value)!.Apply();
    }

    public static bool HasRootFolder => RootFolderId != null;
}