mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-01-31 10:24:45 +01:00
lets simplify the null check
This commit is contained in:
parent
d2c3116173
commit
ce57b3cc4b
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user