File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
app/src/main/java/org/fossasia/susi/ai/chat Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -113,14 +113,7 @@ class STTFragment : Fragment() {
113113 val thisActivity = activity
114114 if (thisActivity is ChatActivity ) thisActivity.setText(voiceResults[0 ])
115115 recognizer.destroy()
116- if ((activity as ChatActivity ).recordingThread != null ) {
117- chatPresenter.startHotwordDetection()
118- }
119- (activity as ChatActivity ).fabsetting.show()
120- activity?.searchChat?.show()
121- activity?.voiceSearchChat?.show()
122- activity?.btnSpeak?.isEnabled = true
123- activity?.supportFragmentManager?.popBackStackImmediate()
116+ restoreActivityState()
124117 }
125118
126119 override fun onReadyForSpeech (params : Bundle ) {
@@ -169,6 +162,17 @@ class STTFragment : Fragment() {
169162 recognizer.setRecognitionListener(listener)
170163 recognizer.startListening(intent)
171164 }
165+
166+ private fun restoreActivityState () {
167+ if ((activity as ChatActivity ).recordingThread != null ) {
168+ chatPresenter.startHotwordDetection()
169+ }
170+ (activity as ChatActivity ).fabsetting.show()
171+ activity?.searchChat?.show()
172+ activity?.voiceSearchChat?.show()
173+ activity?.btnSpeak?.isEnabled = true
174+ activity?.supportFragmentManager?.popBackStackImmediate()
175+ }
172176
173177 override fun onPause () {
174178 super .onPause()
You can’t perform that action at this time.
0 commit comments