aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/ca/allanwang/kau
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-06-13 13:51:52 -0700
committerAllan Wang <me@allanwang.ca>2019-06-13 13:51:52 -0700
commite1849c9c633047979d8017262041e925ec3bd219 (patch)
treef1cc813655513195f118948c2cef28de649f4e47 /core/src/main/kotlin/ca/allanwang/kau
parent6f97fd5f7c528594899e66d2d8b502a20ade6f53 (diff)
downloadkau-e1849c9c633047979d8017262041e925ec3bd219.tar.gz
kau-e1849c9c633047979d8017262041e925ec3bd219.tar.bz2
kau-e1849c9c633047979d8017262041e925ec3bd219.zip
Update to sdk 29 and update changelog
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/kpref/KPrefTransaction.kt2
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt2
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)
}