diff options
author | Allan Wang <me@allanwang.ca> | 2019-06-13 13:51:52 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-06-13 13:51:52 -0700 |
commit | e1849c9c633047979d8017262041e925ec3bd219 (patch) | |
tree | f1cc813655513195f118948c2cef28de649f4e47 /core | |
parent | 6f97fd5f7c528594899e66d2d8b502a20ade6f53 (diff) | |
download | kau-e1849c9c633047979d8017262041e925ec3bd219.tar.gz kau-e1849c9c633047979d8017262041e925ec3bd219.tar.bz2 kau-e1849c9c633047979d8017262041e925ec3bd219.zip |
Update to sdk 29 and update changelog
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefTransaction.kt | 2 | ||||
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefTransaction.kt b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefTransaction.kt index 1070e11..3f8fe28 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefTransaction.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefTransaction.kt @@ -60,7 +60,7 @@ internal object KPrefFloatTransaction : KPrefTransaction<Float> { internal object KPrefStringTransaction : KPrefTransaction<String> { override fun get(prefs: SharedPreferences, key: String, fallback: String) = - prefs.getString(key, fallback) + prefs.getString(key, fallback) ?: "" override fun set(editor: SharedPreferences.Editor, key: String, data: String) { editor.putString(key, data) diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt index e8680dc..d002fb8 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt @@ -239,7 +239,7 @@ fun Context.hasPermission(permissions: String) = !buildIsMarshmallowAndUp || Con fun Context.copyToClipboard(text: String?, label: String = "Copied Text", showToast: Boolean = true) { val clipboard = getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager - clipboard.primaryClip = ClipData.newPlainText(label, text ?: "") + clipboard.setPrimaryClip(ClipData.newPlainText(label, text ?: "")) if (showToast) toast(R.string.kau_text_copied) } |