|
@@ -48,10 +48,6 @@ class ShapeTabView : ConstraintLayout {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private var seekBarShapeBorderOpacity: TextSeekBar? = null
|
|
|
|
- private var seekBarShapeBorderThickness: TextSeekBar? = null
|
|
|
|
- private var seekBarShapeFillOpacity: TextSeekBar? = null
|
|
|
|
-
|
|
|
|
constructor(context: Context) : super(context) {
|
|
constructor(context: Context) : super(context) {
|
|
initView()
|
|
initView()
|
|
}
|
|
}
|
|
@@ -89,11 +85,11 @@ class ShapeTabView : ConstraintLayout {
|
|
}
|
|
}
|
|
|
|
|
|
fun getShapeAttribute() : ShapeAttribute {
|
|
fun getShapeAttribute() : ShapeAttribute {
|
|
- val lineColor = 0xffff0000.toInt()
|
|
|
|
- val lineWidth = seekBarShapeBorderThickness?.currentValue?.toFloat() ?: 3f
|
|
|
|
- val lineAlpha = seekBarShapeBorderOpacity?.currentValue ?: 255
|
|
|
|
- val fillColor = 0xff00ff00.toInt()
|
|
|
|
- val fillAlpha = seekBarShapeFillOpacity?.currentValue ?: 0
|
|
|
|
|
|
+ val lineColor = colorChooser_shapeBorder.getSelectedColor()
|
|
|
|
+ val lineWidth = seekBar_shapeBorder_thickness.currentValue.toFloat()
|
|
|
|
+ val lineAlpha = seekBar_shapeBorder_opacity.currentValue
|
|
|
|
+ val fillColor = colorChooser_shapeFill.getSelectedColor()
|
|
|
|
+ val fillAlpha = seekBar_shapeFill_opacity.currentValue
|
|
return ShapeAttribute(shapeType, lineColor, lineWidth, lineAlpha, fillColor, fillAlpha)
|
|
return ShapeAttribute(shapeType, lineColor, lineWidth, lineAlpha, fillColor, fillAlpha)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -107,18 +103,13 @@ class ShapeTabView : ConstraintLayout {
|
|
}
|
|
}
|
|
val view = layoutInflater.inflate(resourceId, container, false)
|
|
val view = layoutInflater.inflate(resourceId, container, false)
|
|
if (position == 0) {
|
|
if (position == 0) {
|
|
- seekBarShapeBorderOpacity = view.seekBar_shapeBorder_opacity
|
|
|
|
- seekBarShapeBorderThickness = view.seekBar_shapeBorder_thickness
|
|
|
|
-
|
|
|
|
- seekBarShapeBorderOpacity?.formatter = object : TextSeekBar.SeekBarFormatter {
|
|
|
|
|
|
+ view.seekBar_shapeBorder_opacity.formatter = object : TextSeekBar.SeekBarFormatter {
|
|
override fun format(value: Int): String {
|
|
override fun format(value: Int): String {
|
|
return Math.round(value / 2.55).toInt().toString()
|
|
return Math.round(value / 2.55).toInt().toString()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- seekBarShapeFillOpacity = view.seekBar_shapeFill_opacity
|
|
|
|
-
|
|
|
|
- seekBarShapeFillOpacity?.formatter = object : TextSeekBar.SeekBarFormatter {
|
|
|
|
|
|
+ view.seekBar_shapeFill_opacity.formatter = object : TextSeekBar.SeekBarFormatter {
|
|
override fun format(value: Int): String {
|
|
override fun format(value: Int): String {
|
|
return Math.round(value / 2.55).toInt().toString()
|
|
return Math.round(value / 2.55).toInt().toString()
|
|
}
|
|
}
|