formated code

This commit is contained in:
gouri-panda 2020-09-01 16:37:33 +05:30
parent a18eea8455
commit 34c6a6ced4

View File

@ -154,14 +154,12 @@ class KiwixTextToSpeech internal constructor(
} }
fun stop() { fun stop() {
tts.let { if (tts.stop() == SUCCESS) {
if (it.stop() == SUCCESS) {
currentTTSTask = null currentTTSTask = null
it.setOnUtteranceProgressListener(null) tts.setOnUtteranceProgressListener(null)
onSpeakingListener.onSpeakingEnded() onSpeakingListener.onSpeakingEnded()
} }
} }
}
private fun requestAudioFocus(): Boolean { private fun requestAudioFocus(): Boolean {
val audioFocusRequest = am.requestAudioFocus( val audioFocusRequest = am.requestAudioFocus(
@ -230,7 +228,9 @@ class KiwixTextToSpeech internal constructor(
} }
fun start() { fun start() {
if (!paused) return if (!paused) {
return
}
paused = false paused = false
// The utterance ID isn't actually used anywhere, the param is passed only to force // The utterance ID isn't actually used anywhere, the param is passed only to force
// the utterance listener to be notified // the utterance listener to be notified