Created
January 25, 2019 11:36
-
-
Save fevziomurtekin/7a1aea6c45e4db5f6229a76b0fdde11a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun appendText(message: String, type: Int) { | |
val layout: FrameLayout | |
when (type) { | |
USER -> layout = appendUserText() | |
BOT -> layout = appendBotText() | |
else -> layout = appendBotText() | |
} | |
layout.isFocusableInTouchMode = true | |
linear_chat.addView(layout) | |
val tv = layout.findViewById<TextView>(R.id.chatMsg) | |
tv.setText(message) | |
Util.hideKeyboard(this) | |
layout.requestFocus() | |
edittext.requestFocus() // change focus back to edit text to continue typing | |
if(type!= USER) asistan_voice?.speak(message,TextToSpeech.QUEUE_FLUSH,null) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment