diff --git a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt index 0bb238a79..272c8d02d 100644 --- a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt @@ -59,8 +59,10 @@ fun Context.getPrefString(@StringRes keyId: Int, defValue: String? = null) = fun Context.putPrefString(key: String, value: String) = defaultSharedPreferences.edit { putString(key, value) } -fun Context.getPrefStringSet(key: String, defValue: MutableSet? = null) = - defaultSharedPreferences.getStringSet(key, defValue) +fun Context.getPrefStringSet( + key: String, + defValue: MutableSet? = null +): MutableSet? = defaultSharedPreferences.getStringSet(key, defValue) fun Context.putPrefStringSet(key: String, value: MutableSet) = defaultSharedPreferences.edit { putStringSet(key, value) } @@ -194,10 +196,10 @@ val Context.channel: String get() { try { val pm = packageManager - val appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA); + val appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA) return appInfo.metaData.getString("channel") ?: "" } catch (e: Exception) { - e.printStackTrace(); + e.printStackTrace() } return "" }