File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,9 @@ class CardMediaPlayer : Closeable {
126126 var playAvTagsJob: Job ? = null
127127 val isPlaying get() = playAvTagsJob != null
128128
129- private var onMediaGroupCompleted: (() -> Unit )? = null
129+ private var onMediaGroupCompleted: (suspend () -> Unit )? = null
130130
131- fun setOnMediaGroupCompletedListener (listener : (() -> Unit )? ) {
131+ fun setOnMediaGroupCompletedListener (listener : (suspend () -> Unit )? ) {
132132 onMediaGroupCompleted = listener
133133 }
134134
Original file line number Diff line number Diff line change @@ -162,14 +162,12 @@ class ReviewerViewModel(
162162 updateNextTimes()
163163 }
164164 cardMediaPlayer.setOnMediaGroupCompletedListener {
165- launchCatchingIO {
166- if (! autoAdvance.shouldWaitForAudio()) return @launchCatchingIO
165+ if (! autoAdvance.shouldWaitForAudio()) return @setOnMediaGroupCompletedListener
167166
168- if (showingAnswer.value) {
169- autoAdvance.onShowAnswer()
170- } else {
171- autoAdvance.onShowQuestion()
172- }
167+ if (showingAnswer.value) {
168+ autoAdvance.onShowAnswer()
169+ } else {
170+ autoAdvance.onShowQuestion()
173171 }
174172 }
175173 }
You can’t perform that action at this time.
0 commit comments