mirror of
https://github.com/SimpleMobileTools/Simple-Keyboard.git
synced 2025-02-16 20:00:36 +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() {
|
private fun clearClipboardContent() {
|
||||||
val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager)
|
val clipboardManager = (context.getSystemService(Context.CLIPBOARD_SERVICE) as? ClipboardManager) ?: return
|
||||||
if (isPiePlus()) {
|
if (isPiePlus()) {
|
||||||
clipboardManager?.clearPrimaryClip()
|
clipboardManager.clearPrimaryClip()
|
||||||
} else {
|
} else {
|
||||||
val clip = ClipData.newPlainText("", "")
|
val clip = ClipData.newPlainText("", "")
|
||||||
clipboardManager?.setPrimaryClip(clip)
|
clipboardManager.setPrimaryClip(clip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user