@@ -481,7 +481,7 @@ private class ConstraintLayoutParentData(
481
481
override val layoutId: Any = ref.id
482
482
483
483
override fun equals (other : Any? ) = other is ConstraintLayoutParentData &&
484
- ref.id == other.ref.id && constrain == other.constrain
484
+ ref.id == other.ref.id && constrain == other.constrain
485
485
486
486
override fun hashCode () = ref.id.hashCode() * 31 + constrain.hashCode()
487
487
}
@@ -722,7 +722,7 @@ internal abstract class EditableJSONLayout(@Language("json5") content: String) :
722
722
private var forcedWidth: Int = Int .MIN_VALUE
723
723
private var forcedHeight: Int = Int .MIN_VALUE
724
724
private var forcedDrawDebug: MotionLayoutDebugFlags =
725
- MotionLayoutDebugFlags .UNKNOWN
725
+ MotionLayoutDebugFlags .UNKNOWN
726
726
private var updateFlag: MutableState <Long >? = null
727
727
private var layoutInformationMode: LayoutInfoFlags = LayoutInfoFlags .NONE
728
728
private var layoutInformation = " "
@@ -774,7 +774,8 @@ internal abstract class EditableJSONLayout(@Language("json5") content: String) :
774
774
val registry = Registry .getInstance()
775
775
registry.register(debugName, callback)
776
776
}
777
- } catch (_: CLParsingException ) {}
777
+ } catch (_: CLParsingException ) {
778
+ }
778
779
}
779
780
780
781
// region Accessors
@@ -931,6 +932,7 @@ fun ConstraintSet(
931
932
class State (val density : Density ) : SolverState() {
932
933
var rootIncomingConstraints: Constraints = Constraints ()
933
934
lateinit var layoutDirection: LayoutDirection
935
+
934
936
init {
935
937
setDpToPixel { dp -> density.density * dp }
936
938
}
@@ -996,7 +998,7 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
996
998
Log .d(
997
999
" CCL" ,
998
1000
" Measuring ${measurable.layoutId} with: " +
999
- constraintWidget.toDebugString() + " \n " + measure.toDebugString()
1001
+ constraintWidget.toDebugString() + " \n "
1000
1002
)
1001
1003
}
1002
1004
@@ -1033,11 +1035,11 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
1033
1035
}
1034
1036
1035
1037
if ((measure.measureStrategy == TRY_GIVEN_DIMENSIONS ||
1036
- measure.measureStrategy == USE_GIVEN_DIMENSIONS ) ||
1038
+ measure.measureStrategy == USE_GIVEN_DIMENSIONS ) ||
1037
1039
! (measure.horizontalBehavior == MATCH_CONSTRAINT &&
1038
- constraintWidget.mMatchConstraintDefaultWidth == MATCH_CONSTRAINT_SPREAD &&
1039
- measure.verticalBehavior == MATCH_CONSTRAINT &&
1040
- constraintWidget.mMatchConstraintDefaultHeight == MATCH_CONSTRAINT_SPREAD )
1040
+ constraintWidget.mMatchConstraintDefaultWidth == MATCH_CONSTRAINT_SPREAD &&
1041
+ measure.verticalBehavior == MATCH_CONSTRAINT &&
1042
+ constraintWidget.mMatchConstraintDefaultHeight == MATCH_CONSTRAINT_SPREAD )
1041
1043
) {
1042
1044
if (DEBUG ) {
1043
1045
Log .d(" CCL" , " Measuring ${measurable.layoutId} with $constraints " )
@@ -1103,7 +1105,7 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
1103
1105
.copyFrom(measure)
1104
1106
1105
1107
measure.measuredNeedsSolverPass = measure.measuredWidth != measure.horizontalDimension ||
1106
- measure.measuredHeight != measure.verticalDimension
1108
+ measure.measuredHeight != measure.verticalDimension
1107
1109
}
1108
1110
1109
1111
fun addLayoutInformationReceiver (layoutReceiver : LayoutInformationReceiver ? ) {
@@ -1134,8 +1136,8 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
1134
1136
json.append(" interpolated: " )
1135
1137
json.append(
1136
1138
" { left: ${child.x} , top: ${child.y} , " +
1137
- " right: ${child.x + child.width} , " +
1138
- " bottom: ${child.y + child.height} }"
1139
+ " right: ${child.x + child.width} , " +
1140
+ " bottom: ${child.y + child.height} }"
1139
1141
)
1140
1142
json.append(" }, " )
1141
1143
}
@@ -1192,11 +1194,11 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
1192
1194
Log .d(" CCL" , " IRH $currentDimensionResolved " )
1193
1195
}
1194
1196
val useDimension = currentDimensionResolved ||
1195
- (measureStrategy == TRY_GIVEN_DIMENSIONS ||
1196
- measureStrategy == USE_GIVEN_DIMENSIONS ) &&
1197
- (measureStrategy == USE_GIVEN_DIMENSIONS ||
1198
- matchConstraintDefaultDimension != MATCH_CONSTRAINT_WRAP ||
1199
- otherDimensionResolved)
1197
+ (measureStrategy == TRY_GIVEN_DIMENSIONS ||
1198
+ measureStrategy == USE_GIVEN_DIMENSIONS ) &&
1199
+ (measureStrategy == USE_GIVEN_DIMENSIONS ||
1200
+ matchConstraintDefaultDimension != MATCH_CONSTRAINT_WRAP ||
1201
+ otherDimensionResolved)
1200
1202
if (DEBUG ) {
1201
1203
Log .d(" CCL" , " UD $useDimension " )
1202
1204
}
@@ -1288,7 +1290,7 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
1288
1290
Log .d(
1289
1291
" CCL" ,
1290
1292
" Final measurement for ${measurable.layoutId} " +
1291
- " to confirm size ${child.width} ${child.height} "
1293
+ " to confirm size ${child.width} ${child.height} "
1292
1294
)
1293
1295
}
1294
1296
measurable.measure(Constraints .fixed(child.width, child.height))
@@ -1566,11 +1568,13 @@ internal typealias SolverChain = androidx.constraintlayout.core.state.State.Chai
1566
1568
private val DEBUG = false
1567
1569
private fun ConstraintWidget.toDebugString () =
1568
1570
" $debugName " +
1569
- " width $width minWidth $minWidth maxWidth $maxWidth " +
1570
- " height $height minHeight $minHeight maxHeight $maxHeight " +
1571
- " HDB $horizontalDimensionBehaviour VDB $verticalDimensionBehaviour " +
1572
- " MCW $mMatchConstraintDefaultWidth MCH $mMatchConstraintDefaultHeight " +
1573
- " percentW $mMatchConstraintPercentWidth percentH $mMatchConstraintPercentHeight "
1574
-
1575
- private fun BasicMeasure.Measure.toDebugString () =
1576
- " measure strategy is "
1571
+ " width $width minWidth $minWidth maxWidth $maxWidth " +
1572
+ " height $height minHeight $minHeight maxHeight $maxHeight " +
1573
+ " HDB $horizontalDimensionBehaviour VDB $verticalDimensionBehaviour " +
1574
+ " MCW $mMatchConstraintDefaultWidth MCH $mMatchConstraintDefaultHeight " +
1575
+ " percentW $mMatchConstraintPercentWidth percentH $mMatchConstraintPercentHeight "
1576
+
1577
+ enum class LayoutInfoFlags {
1578
+ NONE ,
1579
+ BOUNDS
1580
+ }
0 commit comments