feat: 优化代码

pull/98/head
kunfei 5 years ago
parent 30171126e5
commit b9e1e89dd2
  1. 3
      app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt

@ -29,12 +29,10 @@ class DetailSeekBar(context: Context, attrs: AttributeSet?) : LinearLayoutCompat
iv_seek_add.onClick { iv_seek_add.onClick {
seek_bar.progressAdd(1) seek_bar.progressAdd(1)
upValue()
onChanged?.invoke(seek_bar.progress) onChanged?.invoke(seek_bar.progress)
} }
iv_seek_remove.onClick { iv_seek_remove.onClick {
seek_bar.progressAdd(-1) seek_bar.progressAdd(-1)
upValue()
onChanged?.invoke(seek_bar.progress) onChanged?.invoke(seek_bar.progress)
} }
seek_bar.setOnSeekBarChangeListener(this) seek_bar.setOnSeekBarChangeListener(this)
@ -57,7 +55,6 @@ class DetailSeekBar(context: Context, attrs: AttributeSet?) : LinearLayoutCompat
} }
override fun onStopTrackingTouch(seekBar: SeekBar?) { override fun onStopTrackingTouch(seekBar: SeekBar?) {
upValue()
onChanged?.invoke(seek_bar.progress) onChanged?.invoke(seek_bar.progress)
} }

Loading…
Cancel
Save