<commit_before>package de.eightbitboy.hijacr.data;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;

import de.eightbitboy.hijacr.R;

public class SettingsManager {

	private static SettingsManager instance;

	private SharedPreferences preferences;
	private Resources resources;


	private SettingsManager(Context context) {
		preferences = PreferenceManager.getDefaultSharedPreferences(context);
		resources = context.getResources();
	}

	public static SettingsManager getInstance(Context context) {
		if (instance == null) {
			instance = new SettingsManager(context);
		}

		return instance;
	}

	public boolean isDebugMode() {
		return preferences.getBoolean(resources.getString(R.string.pref_debug), false);
	}
}<commit_msg>Endale saving comic id<commit_after>package de.eightbitboy.hijacr.data;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;

import de.eightbitboy.hijacr.R;

//TODO use https://github.com/orhanobut/hawk for this? or https://github.com/grandcentrix/tray?
public class SettingsManager {

	private static SettingsManager instance;

	private SharedPreferences preferences;
	private Resources resources;


	private SettingsManager(Context context) {
		preferences = PreferenceManager.getDefaultSharedPreferences(context);
		resources = context.getResources();
	}

	public static SettingsManager getInstance(Context context) {
		if (instance == null) {
			instance = new SettingsManager(context);
		}

		return instance;
	}

	public boolean isDebugMode() {
		return preferences.getBoolean(resources.getString(R.string.pref_debug), false);
	}

	public int getLastComicId() {
		return preferences.getInt("pref_last_comic", 1);
	}

	public void setLastComicId(int value) {
		SharedPreferences.Editor editor = preferences.edit();
		editor.putInt("pref_last_comic", value);
		editor.commit();
	}
}
{'fraction_non_alphanumeric': 0.09458128078817735, 'fraction_numerical': 0.0004926108374384236, 'mean_word_length': 5.74750830564784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6271929', 'n_tokens_mistral': 602, 'n_tokens_neox': 564, 'n_words': 128}