Fix crash on Android 12.
I guess we accept only images coming from the keyboard.
This commit is contained in:
parent
b26ea752b5
commit
60d75ff8e2
|
@ -46,7 +46,7 @@ class ComposerEditText @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||||
|
|
||||||
override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? {
|
override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection? {
|
||||||
var ic = super.onCreateInputConnection(editorInfo) ?: return null
|
var ic = super.onCreateInputConnection(editorInfo) ?: return null
|
||||||
val mimeTypes = ViewCompat.getOnReceiveContentMimeTypes(this) ?: arrayOf("*/*")
|
val mimeTypes = ViewCompat.getOnReceiveContentMimeTypes(this) ?: arrayOf("image/*")
|
||||||
|
|
||||||
EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes)
|
EditorInfoCompat.setContentMimeTypes(editorInfo, mimeTypes)
|
||||||
ic = InputConnectionCompat.createWrapper(this, ic, editorInfo)
|
ic = InputConnectionCompat.createWrapper(this, ic, editorInfo)
|
||||||
|
|
Loading…
Reference in New Issue