优化
This commit is contained in:
@@ -25,8 +25,6 @@ import io.legado.app.databinding.PopupActionMenuBinding
|
|||||||
import io.legado.app.service.BaseReadAloudService
|
import io.legado.app.service.BaseReadAloudService
|
||||||
import io.legado.app.utils.*
|
import io.legado.app.utils.*
|
||||||
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
class TextActionMenu(private val context: Context, private val callBack: CallBack) :
|
class TextActionMenu(private val context: Context, private val callBack: CallBack) :
|
||||||
PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT),
|
PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT),
|
||||||
@@ -248,7 +246,6 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac
|
|||||||
@Synchronized
|
@Synchronized
|
||||||
override fun onInit(status: Int) {
|
override fun onInit(status: Int) {
|
||||||
if (status == TextToSpeech.SUCCESS) {
|
if (status == TextToSpeech.SUCCESS) {
|
||||||
textToSpeech?.language = Locale.CHINA
|
|
||||||
ttsInitFinish = true
|
ttsInitFinish = true
|
||||||
readAloud(lastText)
|
readAloud(lastText)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application),
|
|||||||
@Synchronized
|
@Synchronized
|
||||||
override fun onInit(status: Int) {
|
override fun onInit(status: Int) {
|
||||||
if (status == TextToSpeech.SUCCESS) {
|
if (status == TextToSpeech.SUCCESS) {
|
||||||
textToSpeech?.language = Locale.CHINA
|
|
||||||
textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener())
|
textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener())
|
||||||
ttsInitFinish = true
|
ttsInitFinish = true
|
||||||
play()
|
play()
|
||||||
|
|||||||
Reference in New Issue
Block a user