mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-19 04:16:27 -04:00
#3740 Read aloud will stop in closed tab
This commit is contained in:
parent
e9768c69a7
commit
cdf4a01b7d
@ -259,6 +259,7 @@ abstract class CoreReaderFragment :
|
||||
@Inject
|
||||
var painter: NightModeViewPainter? = null
|
||||
protected var currentWebViewIndex = 0
|
||||
private var currentTtsWebViewIndex = 0
|
||||
protected var actionBar: ActionBar? = null
|
||||
protected var mainMenu: MainMenu? = null
|
||||
|
||||
@ -1045,6 +1046,7 @@ abstract class CoreReaderFragment :
|
||||
}
|
||||
|
||||
private fun startReadAloud() {
|
||||
currentTtsWebViewIndex = currentWebViewIndex
|
||||
getCurrentWebView()?.let {
|
||||
tts?.readAloud(it)
|
||||
}
|
||||
@ -1192,7 +1194,7 @@ abstract class CoreReaderFragment :
|
||||
}
|
||||
|
||||
private fun closeTab(index: Int) {
|
||||
if (currentWebViewIndex == index) onReadAloudStop()
|
||||
if (currentTtsWebViewIndex == index) onReadAloudStop()
|
||||
tempZimFileForUndo = zimReaderContainer?.zimFile
|
||||
tempWebViewForUndo = webViewList[index]
|
||||
webViewList.removeAt(index)
|
||||
|
Loading…
x
Reference in New Issue
Block a user