package com.example.myapplication.service;

import android.content.Context;
import android.content.SharedPreferences;

public class NoteService {
    public static void setCurrentNoteId(Context ctx, int id) {
        SharedPreferences prefs = ctx.getSharedPreferences("app_prefs", Context.MODE_PRIVATE);
        prefs.edit().putInt("currentNoteId", id).apply();
    }

    public static int getCurrentNoteId(Context ctx) {
        SharedPreferences prefs = ctx.getSharedPreferences("app_prefs", Context.MODE_PRIVATE);
        return prefs.getInt("currentNoteId", -1);
    }

    public static int incrementLikeCount(int current) {
        return current + 1;
    }
}