[Android] Don't precompute empty text
Geoffrey Métais
git at videolan.org
Wed Feb 20 11:22:17 CET 2019
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 20 11:10:21 2019 +0100| [618fe6f738dcf42eed8877264c17bf178f3ce582] | committer: Geoffrey Métais
Don't precompute empty text
> https://code.videolan.org/videolan/vlc-android/commit/618fe6f738dcf42eed8877264c17bf178f3ce582
---
vlc-android/src/org/videolan/vlc/util/Kextensions.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
index 26f096df6..a47066b22 100644
--- a/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
+++ b/vlc-android/src/org/videolan/vlc/util/Kextensions.kt
@@ -147,7 +147,7 @@ fun <X, Y> CoroutineScope.map(
@BindingAdapter("app:asyncText", requireAll = false)
fun asyncText(view: TextView, text: CharSequence?) {
- if (text === null) return
+ if (text.isNullOrEmpty()) return
val params = TextViewCompat.getTextMetricsParams(view)
(view as AppCompatTextView).setTextFuture(PrecomputedTextCompat.getTextFuture(text, params, null))
}
More information about the Android
mailing list