mirror of
https://github.com/SimpleMobileTools/Simple-Dialer.git
synced 2025-02-15 02:50:53 +01:00
minor code style update
This commit is contained in:
parent
f34379405d
commit
01467bde81
@ -14,6 +14,7 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
companion object {
|
companion object {
|
||||||
fun newInstance(context: Context) = Config(context)
|
fun newInstance(context: Context) = Config(context)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getSpeedDialValues(): ArrayList<SpeedDial> {
|
fun getSpeedDialValues(): ArrayList<SpeedDial> {
|
||||||
val speedDialType = object : TypeToken<List<SpeedDial>>() {}.type
|
val speedDialType = object : TypeToken<List<SpeedDial>>() {}.type
|
||||||
val speedDialValues = Gson().fromJson<ArrayList<SpeedDial>>(speedDial, speedDialType) ?: ArrayList(1)
|
val speedDialValues = Gson().fromJson<ArrayList<SpeedDial>>(speedDial, speedDialType) ?: ArrayList(1)
|
||||||
@ -33,14 +34,12 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getCustomSIM(number: String): PhoneAccountHandle? {
|
fun getCustomSIM(number: String): PhoneAccountHandle? {
|
||||||
val myPhoneAccountHandle =
|
val myPhoneAccountHandle = prefs.getPhoneAccountHandleModel(REMEMBER_SIM_PREFIX + number, null)
|
||||||
prefs.getPhoneAccountHandleModel(REMEMBER_SIM_PREFIX + number, null)
|
|
||||||
return if (myPhoneAccountHandle != null) {
|
return if (myPhoneAccountHandle != null) {
|
||||||
val packageName = myPhoneAccountHandle.packageName
|
val packageName = myPhoneAccountHandle.packageName
|
||||||
val className = myPhoneAccountHandle.className
|
val className = myPhoneAccountHandle.className
|
||||||
val componentName = ComponentName(packageName, className)
|
val componentName = ComponentName(packageName, className)
|
||||||
val id = myPhoneAccountHandle.id
|
val id = myPhoneAccountHandle.id
|
||||||
|
|
||||||
PhoneAccountHandle(componentName, id)
|
PhoneAccountHandle(componentName, id)
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
@ -50,6 +49,7 @@ class Config(context: Context) : BaseConfig(context) {
|
|||||||
fun removeCustomSIM(number: String) {
|
fun removeCustomSIM(number: String) {
|
||||||
prefs.edit().remove(REMEMBER_SIM_PREFIX + number).apply()
|
prefs.edit().remove(REMEMBER_SIM_PREFIX + number).apply()
|
||||||
}
|
}
|
||||||
|
|
||||||
var showTabs: Int
|
var showTabs: Int
|
||||||
get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK)
|
get() = prefs.getInt(SHOW_TABS, ALL_TABS_MASK)
|
||||||
set(showTabs) = prefs.edit().putInt(SHOW_TABS, showTabs).apply()
|
set(showTabs) = prefs.edit().putInt(SHOW_TABS, showTabs).apply()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user