Skip to content

Commit 1b1814a

Browse files
committed
DetailsWeatherTileUtils: fix type parameter
1 parent a31e0f6 commit 1b1814a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

app/src/fullgms/java/com/thewizrd/simpleweather/updates/InAppUpdateManager.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ class InAppUpdateManager private constructor(context: Context) {
8383

8484
val json = mConfig.getString("android_updates")
8585

86-
val updateTypeToken = listType<UpdateInfo>()
87-
return@withContext JSONParser.deserializer(json, updateTypeToken)
86+
return@withContext JSONParser.deserializer(json, listType<UpdateInfo>())
8887
}
8988
}
9089

wearapp/src/main/java/com/thewizrd/simpleweather/preferences/DetailsWeatherTileUtils.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import android.content.SharedPreferences
44
import androidx.core.content.edit
55
import androidx.preference.PreferenceManager
66
import androidx.wear.protolayout.material.layouts.LayoutDefaults.MultiButtonLayoutDefaults
7-
import com.google.common.reflect.TypeToken
87
import com.thewizrd.common.controls.WeatherDetailsType
98
import com.thewizrd.shared_resources.appLib
9+
import com.thewizrd.shared_resources.json.listType
1010
import com.thewizrd.shared_resources.utils.JSONParser
1111
import kotlinx.coroutines.channels.Channel
1212
import kotlinx.coroutines.channels.awaitClose
@@ -40,8 +40,7 @@ object DetailsWeatherTileUtils {
4040
val preferences = PreferenceManager.getDefaultSharedPreferences(appLib.context)
4141
val configJSON = preferences.getString(KEY_DETAILSWEATHERTILECONFIG, null)
4242
return configJSON?.let {
43-
val arrListType = object : TypeToken<List<WeatherDetailsType>>() {}.type
44-
JSONParser.deserializer<List<WeatherDetailsType>>(it, arrListType)
43+
JSONParser.deserializer<List<WeatherDetailsType>>(it, listType<WeatherDetailsType>())
4544
}
4645
}
4746

@@ -68,8 +67,7 @@ object DetailsWeatherTileUtils {
6867
val preferences = PreferenceManager.getDefaultSharedPreferences(appLib.context)
6968
preferences.edit {
7069
putString(KEY_DETAILSWEATHERTILECONFIG, types?.let {
71-
val arrListType = object : TypeToken<List<WeatherDetailsType>>() {}.type
72-
JSONParser.serializer(it, arrListType)
70+
JSONParser.serializer(it, listType<WeatherDetailsType>())
7371
})
7472
}
7573
}

0 commit comments

Comments
 (0)