diff --git a/app/src/main/res/raw/mock.json b/app/src/main/res/raw/mock.json index b01e144..120608a 100644 --- a/app/src/main/res/raw/mock.json +++ b/app/src/main/res/raw/mock.json @@ -13442,12 +13442,11 @@ { "property": { "viewType": "Spacer", - "height": "200", + "height": "20", "width": "2000", "shape": { "shapeType": "TrapeziumShape", - "height": 30, - "isFlipped":true, + "isFlipped":false, "widthDifference": 20 }, "backgroundColor": "#795287", @@ -13463,7 +13462,8 @@ "viewType": "Column", "width": "MATCH_PARENT", "blurData": { - "radius": 5 + "radius": 6, + "edgeTreatment": "Unbounded" } } } diff --git a/navi-uitron/src/main/java/com/navi/uitron/model/ui/UiTronView.kt b/navi-uitron/src/main/java/com/navi/uitron/model/ui/UiTronView.kt index d2a6501..47fdf5a 100644 --- a/navi-uitron/src/main/java/com/navi/uitron/model/ui/UiTronView.kt +++ b/navi-uitron/src/main/java/com/navi/uitron/model/ui/UiTronView.kt @@ -127,7 +127,6 @@ data class TicketShapeData( @Parcelize data class TrapeziumShapeData( - val height: Float? = null, val widthDifference: Float? = null, val isFlipped: Boolean? = null ) : UiTronShape(), Parcelable diff --git a/navi-uitron/src/main/java/com/navi/uitron/utils/ShapeUtil.kt b/navi-uitron/src/main/java/com/navi/uitron/utils/ShapeUtil.kt index f9b80da..5a2b172 100644 --- a/navi-uitron/src/main/java/com/navi/uitron/utils/ShapeUtil.kt +++ b/navi-uitron/src/main/java/com/navi/uitron/utils/ShapeUtil.kt @@ -87,7 +87,6 @@ object ShapeUtil { ShapeType.TrapeziumShape.name -> { (shape as TrapeziumShapeData).let { TrapeziumShape( - height = shape.height?.dp?.toPx() ?: 0.dp.toPx(), widthDifference = shape.widthDifference?.dp?.toPx() ?: 0.dp.toPx(), isFlipped = shape.isFlipped ?: false ) diff --git a/navi-uitron/src/main/java/com/navi/uitron/utils/shapes/TrapeziumShape.kt b/navi-uitron/src/main/java/com/navi/uitron/utils/shapes/TrapeziumShape.kt index 17ddc25..c018e10 100644 --- a/navi-uitron/src/main/java/com/navi/uitron/utils/shapes/TrapeziumShape.kt +++ b/navi-uitron/src/main/java/com/navi/uitron/utils/shapes/TrapeziumShape.kt @@ -8,7 +8,6 @@ import androidx.compose.ui.unit.Density import androidx.compose.ui.unit.LayoutDirection class TrapeziumShape( - private val height: Float, private val widthDifference: Float, private val isFlipped: Boolean ) : Shape { @@ -18,12 +17,12 @@ class TrapeziumShape( density: Density ): Outline { return Outline.Generic( - path = drawShadow(size, height, widthDifference, isFlipped = isFlipped) + path = drawShadow(size, widthDifference, isFlipped = isFlipped) ) } } -fun drawShadow(size: Size, height: Float, widthDifference: Float, isFlipped: Boolean): Path { +fun drawShadow(size: Size, widthDifference: Float, isFlipped: Boolean): Path { val path = when (isFlipped) { @@ -31,8 +30,8 @@ fun drawShadow(size: Size, height: Float, widthDifference: Float, isFlipped: Boo Path().apply { moveTo(widthDifference, 0f) lineTo(size.width - widthDifference, 0f) - lineTo(size.width, height) - lineTo(0f, height) + lineTo(size.width, size.height) + lineTo(0f, size.height) close() } } @@ -41,8 +40,8 @@ fun drawShadow(size: Size, height: Float, widthDifference: Float, isFlipped: Boo Path().apply { moveTo(0f, 0f) lineTo(size.width, 0f) - lineTo(size.width - widthDifference, height) - lineTo( widthDifference, height) + lineTo(size.width - widthDifference, size.height) + lineTo( widthDifference, size.height) close() } }