feat: tipConfig

pull/193/head^2
kunfei 5 years ago
parent a35b0ea7c4
commit 3d971657f3
  1. 8
      app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt

@ -7,9 +7,11 @@ import android.view.View
import android.view.ViewGroup
import io.legado.app.R
import io.legado.app.base.BaseDialogFragment
import io.legado.app.constant.EventBus
import io.legado.app.help.ReadTipConfig
import io.legado.app.lib.dialogs.selector
import io.legado.app.ui.book.read.Help
import io.legado.app.utils.postEvent
import kotlinx.android.synthetic.main.dialog_tip_config.*
import org.jetbrains.anko.sdk27.listeners.onClick
@ -57,36 +59,42 @@ class TipConfigDialog : BaseDialogFragment() {
selector(items = ReadTipConfig.tipArray.toList()) { _, i ->
ReadTipConfig.tipHeaderLeft = i
tv_header_left.text = ReadTipConfig.tipArray[i]
postEvent(EventBus.UP_CONFIG, true)
}
}
tv_header_middle.onClick {
selector(items = ReadTipConfig.tipArray.toList()) { _, i ->
ReadTipConfig.tipHeaderMiddle = i
tv_header_middle.text = ReadTipConfig.tipArray[i]
postEvent(EventBus.UP_CONFIG, true)
}
}
tv_header_right.onClick {
selector(items = ReadTipConfig.tipArray.toList()) { _, i ->
ReadTipConfig.tipHeaderRight = i
tv_header_right.text = ReadTipConfig.tipArray[i]
postEvent(EventBus.UP_CONFIG, true)
}
}
tv_footer_left.onClick {
selector(items = ReadTipConfig.tipArray.toList()) { _, i ->
ReadTipConfig.tipFooterLeft = i
tv_footer_left.text = ReadTipConfig.tipArray[i]
postEvent(EventBus.UP_CONFIG, true)
}
}
tv_footer_middle.onClick {
selector(items = ReadTipConfig.tipArray.toList()) { _, i ->
ReadTipConfig.tipFooterMiddle = i
tv_footer_middle.text = ReadTipConfig.tipArray[i]
postEvent(EventBus.UP_CONFIG, true)
}
}
tv_footer_right.onClick {
selector(items = ReadTipConfig.tipArray.toList()) { _, i ->
ReadTipConfig.tipFooterRight = i
tv_footer_right.text = ReadTipConfig.tipArray[i]
postEvent(EventBus.UP_CONFIG, true)
}
}
}

Loading…
Cancel
Save