|
@@ -53,6 +53,7 @@ class BasePreferenceHelper(private val context: Context) : PreferencesHelper() {
|
|
removePreference(context, KEY_FILENAME, KEY_LAUNCH)
|
|
removePreference(context, KEY_FILENAME, KEY_LAUNCH)
|
|
// removePreference(context, KEY_FILENAME, LANGUAGE)
|
|
// removePreference(context, KEY_FILENAME, LANGUAGE)
|
|
removePreference(context, KEY_FILENAME, KEY_SERVERS_ID)
|
|
removePreference(context, KEY_FILENAME, KEY_SERVERS_ID)
|
|
|
|
+ removePreference(context, KEY_FILENAME, KEY_RECENTLY_SERVERS_ID)
|
|
}
|
|
}
|
|
|
|
|
|
fun clearServerObject() {
|
|
fun clearServerObject() {
|
|
@@ -133,6 +134,19 @@ class BasePreferenceHelper(private val context: Context) : PreferencesHelper() {
|
|
putStringPreference(context, KEY_FILENAME, KEY_RECENTLY_SERVERS, Gson().toJson(list))
|
|
putStringPreference(context, KEY_FILENAME, KEY_RECENTLY_SERVERS, Gson().toJson(list))
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ fun getRecentlyListId(): ArrayList<Int>? {
|
|
|
|
+ val type = object : TypeToken<ArrayList<Int?>?>() {}.type
|
|
|
|
+ return Gson().fromJson<ArrayList<Int>>(
|
|
|
|
+ getStringPreference(
|
|
|
|
+ context, KEY_FILENAME, KEY_RECENTLY_SERVERS_ID
|
|
|
|
+ ), type
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ fun setRecentlyListId(list: ArrayList<Int>?) {
|
|
|
|
+ putStringPreference(context, KEY_FILENAME, KEY_RECENTLY_SERVERS_ID, Gson().toJson(list))
|
|
|
|
+ }
|
|
|
|
+
|
|
fun getServersId(): ArrayList<Int>? {
|
|
fun getServersId(): ArrayList<Int>? {
|
|
val type = object : TypeToken<ArrayList<Int?>?>() {}.type
|
|
val type = object : TypeToken<ArrayList<Int?>?>() {}.type
|
|
return Gson().fromJson<ArrayList<Int>>(
|
|
return Gson().fromJson<ArrayList<Int>>(
|
|
@@ -666,5 +680,6 @@ class BasePreferenceHelper(private val context: Context) : PreferencesHelper() {
|
|
private const val KEY_LAUNCH = "key_launch"
|
|
private const val KEY_LAUNCH = "key_launch"
|
|
private const val LANGUAGE = "key_language"
|
|
private const val LANGUAGE = "key_language"
|
|
private const val KEY_SERVERS_ID = "key_servers_id"
|
|
private const val KEY_SERVERS_ID = "key_servers_id"
|
|
|
|
+ private const val KEY_RECENTLY_SERVERS_ID = "keydata_recently_servers_id"
|
|
}
|
|
}
|
|
}
|
|
}
|