Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/src/main/java/org/fossasia/susi/ai/chat/ChatActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class ChatActivity : AppCompatActivity(), IChatView {
chatPresenter.startComputingThread()
}
}
searchChat.visibility = View.VISIBLE
fabsetting.visibility = View.VISIBLE
}

override fun onTouchEvent(event: MotionEvent): Boolean {
Expand Down Expand Up @@ -326,6 +328,8 @@ class ChatActivity : AppCompatActivity(), IChatView {
chatPresenter.stopHotwordDetection()
}
hideSoftKeyboard(this, window.decorView)
searchChat.visibility = View.INVISIBLE
fabsetting.visibility = View.INVISIBLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not View.GONE, so it will not accessible.

val fragmentTransaction = supportFragmentManager.beginTransaction()
fragmentTransaction.replace(R.id.speechToTextFrame, STTFragment())
fragmentTransaction.addToBackStack(null)
Expand All @@ -334,6 +338,8 @@ class ChatActivity : AppCompatActivity(), IChatView {

//Replies user with Speech
override fun voiceReply(reply: String, language: String) {
searchChat.visibility = View.VISIBLE
fabsetting.visibility = View.VISIBLE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what about it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what about it?

When we open up sttfragment, and give some voice commands, the chat activity is not again restarted. It simply calls the function voiceReply. So, it was necessary to make the visibility here

val audioFocus = getSystemService(Context.AUDIO_SERVICE) as AudioManager
val handler = Handler()
handler.post {
Expand Down