I am trying to make a chat in jetpack compose, and I want to be able to use the standard gif keyboard on my samsung to send a gif.
When I click a GIF on a normal TextField, I am currently getting a message "Can't enter this content here"
I found something called Commit Content API which should make it possible to add a GIF in a old EditText so I am trying that inside an AndroidView, Now I dont get the error message anymore, But I also don't have a clue where the GIF is and how it is represented.
AndroidView(factory = {
val editText = @SuppressLint("AppCompatCustomView")
object : EditText(it) {
override fun setOnReceiveContentListener(
mimeTypes: Array<out String>?,
listener: OnReceiveContentListener?
) {
super.setOnReceiveContentListener(mimeTypes, listener)
}
override fun onCreateInputConnection(editorInfo: EditorInfo): InputConnection {
val ic: InputConnection = super.onCreateInputConnection(editorInfo)
EditorInfoCompat.setContentMimeTypes(editorInfo, arrayOf("image/gif"))
val callback =
InputConnectionCompat.OnCommitContentListener { inputContentInfo, _, _ ->
try {
inputContentInfo.requestPermission()
} catch (e: Exception) {
return@OnCommitContentListener false
}
true // return true if succeeded
}
return InputConnectionCompat.createWrapper(ic, editorInfo, callback)
}
}
editText
}) {}
from How can I receive GIF's from the keyboard in jetpack compose?
damascus titanium - Tatinium Artisan & Woodworking
ReplyDeletedamascus titanium is a steel structure that uses a unique guy tang titanium toner diamond patterned edge ford titanium of steel. It is the most titanium tube polished, ford focus titanium hatchback authentic and ceramic vs titanium curling iron lightweight steel that has $0.50 · In stock
ub614 caterpillar boots canada,teniskyasics,gymshark rea,keen mexico,on running norway,mizuno løbesko,on running kengät,on cloud sko,altra zapatillas xn713
ReplyDelete