diff --git a/android/app/src/main/java/com/chatman/helper/PreferencesHelper.java b/android/app/src/main/java/com/chatman/helper/PreferencesHelper.java index 29d81df812b97b995eb995049ff12351700ab62c..ba36f144bf53c103616f827a55e52db921138e42 100644 --- a/android/app/src/main/java/com/chatman/helper/PreferencesHelper.java +++ b/android/app/src/main/java/com/chatman/helper/PreferencesHelper.java @@ -1,4 +1,4 @@ -package com.etsi.helper; +package com.chatman.helper; import android.content.Context; import android.content.SharedPreferences; @@ -6,13 +6,8 @@ import android.preference.PreferenceManager; public class PreferencesHelper { - private static final String USER_ROLE_KEY = "user_role_key"; - public static final boolean USER_ROLE_KREATOR = true; - public static final boolean USER_ROLE_SOBAT = false; public static final String USER_FIREBASE_KEY = "user_firebase_key"; - public static final String KREATOR1_TIER_KEY = "kreator1_tier_key"; - public static final String KREATOR2_TIER_KEY = "kreator2_tier_key"; - public static String CURRENT_KREATOR_KEY; + public static final String USER_NAME = "user_name"; private static void setBooleanPreferences(Context context, String key, boolean value) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); @@ -50,14 +45,6 @@ public class PreferencesHelper { return preferences.getInt(key, 0); } - public static void setUserRole(Context context, boolean value) { - setBooleanPreferences(context, USER_ROLE_KEY, value); - } - - public static boolean getUserRole(Context context) { - return getBooleanPreferences(context, USER_ROLE_KEY); - } - public static void setUserFirebaseKey(Context context, String value) { setStringPreferences(context, USER_FIREBASE_KEY, value); } @@ -66,28 +53,13 @@ public class PreferencesHelper { return getStringPreferences(context, USER_FIREBASE_KEY); } - public static void setKreator1TierKey(Context context, int value){ - setIntPreferences(context, KREATOR1_TIER_KEY, value); + public static void setUserName(Context context, String value) { + setStringPreferences(context, USER_NAME, value); } - public static int getKreator1TierKey(Context context){ - return getIntPreferences(context, KREATOR1_TIER_KEY); + public static String getUserName(Context context) { + return getStringPreferences(context, USER_NAME); } - public static void setKreator2TierKey(Context context, int value){ - setIntPreferences(context, KREATOR2_TIER_KEY, value); - } - public static int getKreator2TierKey(Context context){ - return getIntPreferences(context, KREATOR2_TIER_KEY); - } - - - public static String getCurrentKreatorKey() { - return CURRENT_KREATOR_KEY; - } - - public static void setCurrentKreatorKey(String value) { - CURRENT_KREATOR_KEY = value; - } }