pull/1814/head
kunfei 2 years ago
parent 8bdb3042da
commit df2bf13d6d
  1. 30
      app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt

@ -110,48 +110,54 @@ class TipConfigDialog : BaseDialogFragment(R.layout.dialog_tip_config) {
} }
llHeaderLeft.setOnClickListener { llHeaderLeft.setOnClickListener {
context?.selector(items = ReadTipConfig.tipNames) { _, i -> context?.selector(items = ReadTipConfig.tipNames) { _, i ->
clearRepeat(i) val tipValue = ReadTipConfig.tipValues[i]
ReadTipConfig.tipHeaderLeft = ReadTipConfig.tipValues[i] clearRepeat(tipValue)
ReadTipConfig.tipHeaderLeft = tipValue
tvHeaderLeft.text = ReadTipConfig.tipNames[i] tvHeaderLeft.text = ReadTipConfig.tipNames[i]
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }
} }
llHeaderMiddle.setOnClickListener { llHeaderMiddle.setOnClickListener {
context?.selector(items = ReadTipConfig.tipNames) { _, i -> context?.selector(items = ReadTipConfig.tipNames) { _, i ->
clearRepeat(i) val tipValue = ReadTipConfig.tipValues[i]
ReadTipConfig.tipHeaderMiddle = ReadTipConfig.tipValues[i] clearRepeat(tipValue)
ReadTipConfig.tipHeaderMiddle = tipValue
tvHeaderMiddle.text = ReadTipConfig.tipNames[i] tvHeaderMiddle.text = ReadTipConfig.tipNames[i]
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }
} }
llHeaderRight.setOnClickListener { llHeaderRight.setOnClickListener {
context?.selector(items = ReadTipConfig.tipNames) { _, i -> context?.selector(items = ReadTipConfig.tipNames) { _, i ->
clearRepeat(i) val tipValue = ReadTipConfig.tipValues[i]
ReadTipConfig.tipHeaderRight = ReadTipConfig.tipValues[i] clearRepeat(tipValue)
ReadTipConfig.tipHeaderRight = tipValue
tvHeaderRight.text = ReadTipConfig.tipNames[i] tvHeaderRight.text = ReadTipConfig.tipNames[i]
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }
} }
llFooterLeft.setOnClickListener { llFooterLeft.setOnClickListener {
context?.selector(items = ReadTipConfig.tipNames) { _, i -> context?.selector(items = ReadTipConfig.tipNames) { _, i ->
clearRepeat(i) val tipValue = ReadTipConfig.tipValues[i]
ReadTipConfig.tipFooterLeft = ReadTipConfig.tipValues[i] clearRepeat(tipValue)
ReadTipConfig.tipFooterLeft = tipValue
tvFooterLeft.text = ReadTipConfig.tipNames[i] tvFooterLeft.text = ReadTipConfig.tipNames[i]
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }
} }
llFooterMiddle.setOnClickListener { llFooterMiddle.setOnClickListener {
context?.selector(items = ReadTipConfig.tipNames) { _, i -> context?.selector(items = ReadTipConfig.tipNames) { _, i ->
clearRepeat(i) val tipValue = ReadTipConfig.tipValues[i]
ReadTipConfig.tipFooterMiddle = ReadTipConfig.tipValues[i] clearRepeat(tipValue)
ReadTipConfig.tipFooterMiddle = tipValue
tvFooterMiddle.text = ReadTipConfig.tipNames[i] tvFooterMiddle.text = ReadTipConfig.tipNames[i]
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }
} }
llFooterRight.setOnClickListener { llFooterRight.setOnClickListener {
context?.selector(items = ReadTipConfig.tipNames) { _, i -> context?.selector(items = ReadTipConfig.tipNames) { _, i ->
clearRepeat(i) val tipValue = ReadTipConfig.tipValues[i]
ReadTipConfig.tipFooterRight = ReadTipConfig.tipValues[i] clearRepeat(tipValue)
ReadTipConfig.tipFooterRight = tipValue
tvFooterRight.text = ReadTipConfig.tipNames[i] tvFooterRight.text = ReadTipConfig.tipNames[i]
postEvent(EventBus.UP_CONFIG, true) postEvent(EventBus.UP_CONFIG, true)
} }

Loading…
Cancel
Save