lets simplify the null check

This commit is contained in:
tibbi 2023-06-18 09:54:53 +02:00
parent d2c3116173
commit ce57b3cc4b
1 changed files with 3 additions and 3 deletions

View File

@ -749,12 +749,12 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
}
private fun clearClipboardContent() {
val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)
val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager) ?: return
if (isPiePlus()) {
clipboardManager?.clearPrimaryClip()
clipboardManager.clearPrimaryClip()
} else {
val clip = ClipData.newPlainText("", "")
clipboardManager?.setPrimaryClip(clip)
clipboardManager.setPrimaryClip(clip)
}
}