pull/436/head
gedoor 5 years ago
parent 462f6b7d20
commit 2a19fe8e35
  1. 11
      app/src/main/java/io/legado/app/ui/widget/seekbar/VerticalSeekBar.kt

@ -55,11 +55,11 @@ class VerticalSeekBar : AppCompatSeekBar {
} }
constructor(context: Context) : super(context) { constructor(context: Context) : super(context) {
initialize(context, null, 0, 0) initialize(context, null, 0)
} }
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
initialize(context, attrs, 0, 0) initialize(context, attrs, 0)
} }
constructor( constructor(
@ -67,14 +67,13 @@ class VerticalSeekBar : AppCompatSeekBar {
attrs: AttributeSet, attrs: AttributeSet,
defStyle: Int defStyle: Int
) : super(context, attrs, defStyle) { ) : super(context, attrs, defStyle) {
initialize(context, attrs, defStyle, 0) initialize(context, attrs, defStyle)
} }
private fun initialize( private fun initialize(
context: Context, context: Context,
attrs: AttributeSet?, attrs: AttributeSet?,
defStyleAttr: Int, defStyleAttr: Int
defStyleRes: Int
) { ) {
ATH.setTint(this, ThemeStore.accentColor(context)) ATH.setTint(this, ThemeStore.accentColor(context))
ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR) ViewCompat.setLayoutDirection(this, ViewCompat.LAYOUT_DIRECTION_LTR)
@ -84,7 +83,7 @@ class VerticalSeekBar : AppCompatSeekBar {
attrs, attrs,
R.styleable.VerticalSeekBar, R.styleable.VerticalSeekBar,
defStyleAttr, defStyleAttr,
defStyleRes 0
) )
val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0) val rotationAngle = a.getInteger(R.styleable.VerticalSeekBar_seekBarRotation, 0)
if (isValidRotationAngle(rotationAngle)) { if (isValidRotationAngle(rotationAngle)) {

Loading…
Cancel
Save