package com.alorma.github; import android.content.Context; public class GitskariosSettings extends PreferencesHelper { public static final String KEY_REPO_SORT = "KEY_REPO_SORT"; public static final String KEY_MARK_AS_READ = "KEY_MARK_AS_READ"; public static final String KEY_ISSUE_EDIT = "KEY_ISSUE_EDIT"; public static final String KEY_VERSION = "KEY_VERSION"; public static final String KEY_DOWNLOAD_FILE_TYPE = "KEY_DOWNLOAD_FILE_TYPE"; private static final String KEY_SHOW_ENTERPRISE = "KEY_SHOW_ENTERPRISE"; private static final String GCM_TOKEN = "GCM_TOKEN"; private static final String NOTIFICATIONS = "NOTIFICATIONS"; private static final String FULL_README = "FULL_README"; private static final String REPO_DEFAUL_TAB = "REPO_DEFAUL_TAB"; public GitskariosSettings(Context context) { super(context); } public void saveRepoSort(String value) { saveStringSetting(KEY_REPO_SORT, value); } public String getRepoSort(String defaultValue) { return getStringSetting(KEY_REPO_SORT, defaultValue); } public String getDownloadFileType(String defaultType) { return getStringSetting(KEY_DOWNLOAD_FILE_TYPE, defaultType); } public void saveDownloadFileType(String downloadFileType) { saveStringSetting(KEY_DOWNLOAD_FILE_TYPE, downloadFileType); } public void saveVersion(int currentVersion) { saveIntSetting(KEY_VERSION, currentVersion); } public int getVersion(int currentVersion) { return getIntSetting(KEY_VERSION, currentVersion); } public boolean shouldShowDialogEditIssue() { boolean result = getBooleanSetting(KEY_ISSUE_EDIT, true); saveBooleanSetting(KEY_ISSUE_EDIT, false); return result; } public void saveMarkAsRead(boolean value) { saveBooleanSetting(KEY_MARK_AS_READ, value); } public boolean markAsRead() { return getBooleanSetting(KEY_MARK_AS_READ, false); } public void saveGCMToken(String token) { saveStringSetting(GCM_TOKEN, token); } public String getGCMToken() { return getStringSetting(GCM_TOKEN, null); } public boolean areNotificationsEnabled() { return getBooleanSetting(NOTIFICATIONS, true); } public void setNotificationsEnabled(boolean enabled) { saveBooleanSetting(NOTIFICATIONS, enabled); } public boolean getFullReadme() { return getBooleanSetting(FULL_README, false); } public void saveFullReadme(boolean value) { saveBooleanSetting(FULL_README, value); } public String getRepoDefaulTab() { return getStringSetting(REPO_DEFAUL_TAB, "code"); } public void saveRepoDefaultTab(String defaultTab) { saveStringSetting(REPO_DEFAUL_TAB, defaultTab); } }