TP-0000 | row constraints change (#95)

* TP-0000 | row constraints change

* TP-0000 | mock fix
This commit is contained in:
Maila Rajanikanth
2023-06-23 18:20:48 +05:30
committed by GitHub Enterprise
parent 3fab0f84e7
commit 5690cdb38c
4 changed files with 22 additions and 14 deletions

View File

@@ -7503,11 +7503,13 @@
"layoutId": "text_1",
"width": "MATCH_PARENT",
"height": "WRAP_CONTENT",
"rowConstraints": {
"rowWeight": {
"weight": 4
},
"verticalAlignment": "Bottom"
"parentConstraints": {
"rowConstraints": {
"rowWeight": {
"weight": 4
},
"verticalAlignment": "Bottom"
}
},
"backgroundColor": "#983643"
}
@@ -7518,9 +7520,11 @@
"layoutId": "text_2",
"width": "MATCH_PARENT",
"height": "WRAP_CONTENT",
"rowConstraints": {
"rowWeight": {
"weight": 2
"parentConstraints": {
"rowConstraints": {
"rowWeight": {
"weight": 2
}
}
},
"backgroundColor": "#123874"

View File

@@ -34,6 +34,10 @@ data class ArrangementData(
val spacingValue: Int? = null
)
@Parcelize
data class ParentConstraints(
var rowConstraints: RowConstraints? = null
): Parcelable
@Parcelize
data class RowConstraints(

View File

@@ -38,7 +38,7 @@ open class BaseProperty(
var backgroundColor: String? = null,
var shape: UiTronShape? = null,
var statesMap: Map<String, BaseProperty>? = null,
var rowConstraints: RowConstraints? = null,
var parentConstraints: ParentConstraints? = null,
@SerializedName("visible", alternate = ["isVisible"])
var visible: Boolean? = null,
var alpha: Float? = null,
@@ -57,7 +57,7 @@ open class BaseProperty(
property?.backgroundColor?.let { backgroundColor = it }
property?.shape?.let { shape = it }
property?.statesMap?.let { statesMap = it }
property?.rowConstraints?.let { rowConstraints = it }
property?.parentConstraints?.let { parentConstraints = it }
property?.visible?.let { visible = it }
property?.alpha?.let { alpha = it }
property?.borderStrokeData?.let { borderStrokeData = it }

View File

@@ -102,12 +102,12 @@ class RowRenderer(
if (childrenView.data.isNullOrEmpty()) {
uiTronRenderer.Render(
listOf(childrenView),
constraintsToModifier(childrenView.property?.rowConstraints)
constraintsToModifier(childrenView.property?.parentConstraints?.rowConstraints)
)
} else {
UiTronRenderer(childrenView.data, uiTronViewModel).Render(
listOf(childrenView),
constraintsToModifier(childrenView.property?.rowConstraints)
constraintsToModifier(childrenView.property?.parentConstraints?.rowConstraints)
)
}
}
@@ -126,7 +126,7 @@ class RowRenderer(
if (childrenView.data.isNullOrEmpty()) {
uiTronRenderer.Render(
listOf(childrenView),
constraintsToModifier(childrenView.property?.rowConstraints)
constraintsToModifier(childrenView.property?.parentConstraints?.rowConstraints)
)
} else {
UiTronRenderer(
@@ -134,7 +134,7 @@ class RowRenderer(
uiTronViewModel
).Render(
listOf(childrenView),
constraintsToModifier(childrenView.property?.rowConstraints)
constraintsToModifier(childrenView.property?.parentConstraints?.rowConstraints)
)
}
}