pull/32/head
kunfei 5 years ago
parent e562fa3fcb
commit bbdf66fbd1
  1. 10
      app/src/main/java/io/legado/app/ui/readbook/config/ReadAloudDialog.kt
  2. 2
      app/src/main/res/layout/dialog_read_aloud.xml

@ -8,7 +8,12 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import io.legado.app.R
import io.legado.app.constant.Bus
import io.legado.app.service.ReadAloudService
import io.legado.app.ui.readbook.Help
import io.legado.app.utils.observeEvent
import kotlinx.android.synthetic.main.dialog_read_aloud.*
import org.jetbrains.anko.sdk27.listeners.onClick
class ReadAloudDialog : DialogFragment() {
@ -39,11 +44,16 @@ class ReadAloudDialog : DialogFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
initData()
initOnClick()
}
private fun initData() {
observeEvent<Int>(Bus.ALOUD_STATE) {}
}
private fun initOnClick() {
iv_stop.onClick { ReadAloudService.stop(requireContext()) }
}
}

@ -15,6 +15,7 @@
android:padding="8dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_play_pause"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
@ -23,6 +24,7 @@
android:tint="@color/tv_text_default" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_stop"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="8dp"

Loading…
Cancel
Save