From 5036d15b84a83b3ff76087891207c466076f19ca Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 5 Sep 2020 20:26:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/utils/ContextExtensions.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 "" }