elimu-ai / vitabu

ЁЯУЪ Android application for reading storybooks and expanding word vocabulary.
MIT License
3 stars 3 forks source link

#21 stop audio on page change #83

Closed gscdev closed 3 years ago

nya-elimu commented 3 years ago

@gscdev Log output:

05-01 21:07:05.442  7595  7595 I ai.elimu.vitabu.ui.storybook.ChapterFragment: storyBookParagraphGson.getOriginalText(): "рджреЗрдЦреЛ рджреЗрдЦреЛ, рдореИрдВ рдЪрдиреНрджреНрд░рдорд╛ рдкрд░ рдХрд┐рддрдиреА рдКрдБрдЪреА рдЫрд▓рд╛рдВрдЧ рд▓рдЧрд╛ рд╕рдХрддреА рд╣реВрдБ!"
05-01 21:07:05.442  7595  7595 I ai.elimu.vitabu.ui.storybook.ChapterFragment: wordsInOriginalText.length: 11
05-01 21:07:05.442  7595  7595 I ai.elimu.vitabu.ui.storybook.ChapterFragment: Arrays.toString(wordsInOriginalText): [рджреЗрдЦреЛ, рджреЗрдЦреЛ,, рдореИрдВ, рдЪрдиреНрджреНрд░рдорд╛, рдкрд░, рдХрд┐рддрдиреА, рдКрдБрдЪреА, рдЫрд▓рд╛рдВрдЧ, рд▓рдЧрд╛, рд╕рдХрддреА, рд╣реВрдБ!]
05-01 21:07:05.442  7595  7595 I ai.elimu.vitabu.ui.storybook.ChapterFragment: words: [null, null, ai.elimu.model.v2.gson.content.WordGson@3a4a18, null, null, null, null, null, ai.elimu.model.v2.gson.content.WordGson@1f50c71, null, ai.elimu.model.v2.gson.content.WordGson@f86ea56]
05-01 21:07:05.443 31290  5658 W SynthesisCallbackWrappe: Invalid buffer received, buffer size=0, length=0
05-01 21:07:05.443 31290  5658 E OggPlayer: callback.audioAvailable() failed
05-01 21:07:05.447 31290  1615 I SendBroadcastPermission: action:android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED, mPermissionType:0
05-01 21:07:05.447 31290  5413 W SynthesisCallbackWrappe: Invalid buffer received, buffer size=0, length=0
05-01 21:07:05.447 31290  5413 E OggPlayer: callback.audioAvailable() failed
05-01 21:07:05.448 31290  6859 W SynthesisCallbackWrappe: Invalid buffer received, buffer size=0, length=0
05-01 21:07:05.448 31290  6859 E OggPlayer: callback.audioAvailable() failed
05-01 21:07:05.451  7595  7595 E AndroidRuntime: FATAL EXCEPTION: main
05-01 21:07:05.451  7595  7595 E AndroidRuntime: Process: ai.elimu.vitabu.debug, PID: 7595
05-01 21:07:05.451  7595  7595 E AndroidRuntime: java.lang.IndexOutOfBoundsException: setSpan (-1 ... -1) starts before 0
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.text.SpannableStringInternal.checkRange(SpannableStringInternal.java:434)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:155)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.text.SpannableString.setSpan(SpannableString.java:46)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.text.Selection.setSelection(Selection.java:76)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.widget.Editor$SelectionModifierCursorController.resetDragAcceleratorState(Editor.java:5613)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.widget.Editor$SelectionModifierCursorController.resetTouchOffsets(Editor.java:5603)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.widget.Editor.onFocusChanged(Editor.java:1247)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.widget.TextView.onFocusChanged(TextView.java:8713)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.view.View.clearFocusInternal(View.java:6101)
05-01 21:07:05.451  7595  7595 E AndroidRuntime:    at android.view.View.unFocus(View.java:6134)
gscdev commented 3 years ago

@nya-elimuai I can't reproduce the error, but I made a change to improve the code.

nya-elimu commented 3 years ago

@nya-elimuai I can't reproduce the error, but I made a change to improve the code.

@gscdev My apologies, the bug reported above was already present in the main (master) branch, and was not introduced in your branch. So to keeps things separate, I've created a separate GitHub issue for the bug: https://github.com/elimu-ai/vitabu/issues/85

So for this pull request, please ignore that bug ЁЯЩВ