@@ -481,7 +481,7 @@ private class ConstraintLayoutParentData(
481481 override val layoutId: Any = ref.id
482482
483483 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
485485
486486 override fun hashCode () = ref.id.hashCode() * 31 + constrain.hashCode()
487487}
@@ -722,7 +722,7 @@ internal abstract class EditableJSONLayout(@Language("json5") content: String) :
722722 private var forcedWidth: Int = Int .MIN_VALUE
723723 private var forcedHeight: Int = Int .MIN_VALUE
724724 private var forcedDrawDebug: MotionLayoutDebugFlags =
725- MotionLayoutDebugFlags .UNKNOWN
725+ MotionLayoutDebugFlags .UNKNOWN
726726 private var updateFlag: MutableState <Long >? = null
727727 private var layoutInformationMode: LayoutInfoFlags = LayoutInfoFlags .NONE
728728 private var layoutInformation = " "
@@ -774,7 +774,8 @@ internal abstract class EditableJSONLayout(@Language("json5") content: String) :
774774 val registry = Registry .getInstance()
775775 registry.register(debugName, callback)
776776 }
777- } catch (_: CLParsingException ) {}
777+ } catch (_: CLParsingException ) {
778+ }
778779 }
779780
780781 // region Accessors
@@ -931,6 +932,7 @@ fun ConstraintSet(
931932class State (val density : Density ) : SolverState() {
932933 var rootIncomingConstraints: Constraints = Constraints ()
933934 lateinit var layoutDirection: LayoutDirection
935+
934936 init {
935937 setDpToPixel { dp -> density.density * dp }
936938 }
@@ -996,7 +998,7 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
996998 Log .d(
997999 " CCL" ,
9981000 " Measuring ${measurable.layoutId} with: " +
999- constraintWidget.toDebugString() + " \n " + measure.toDebugString()
1001+ constraintWidget.toDebugString() + " \n "
10001002 )
10011003 }
10021004
@@ -1033,11 +1035,11 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
10331035 }
10341036
10351037 if ((measure.measureStrategy == TRY_GIVEN_DIMENSIONS ||
1036- measure.measureStrategy == USE_GIVEN_DIMENSIONS ) ||
1038+ measure.measureStrategy == USE_GIVEN_DIMENSIONS ) ||
10371039 ! (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 )
10411043 ) {
10421044 if (DEBUG ) {
10431045 Log .d(" CCL" , " Measuring ${measurable.layoutId} with $constraints " )
@@ -1103,7 +1105,7 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
11031105 .copyFrom(measure)
11041106
11051107 measure.measuredNeedsSolverPass = measure.measuredWidth != measure.horizontalDimension ||
1106- measure.measuredHeight != measure.verticalDimension
1108+ measure.measuredHeight != measure.verticalDimension
11071109 }
11081110
11091111 fun addLayoutInformationReceiver (layoutReceiver : LayoutInformationReceiver ? ) {
@@ -1134,8 +1136,8 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
11341136 json.append(" interpolated: " )
11351137 json.append(
11361138 " { 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} }"
11391141 )
11401142 json.append(" }, " )
11411143 }
@@ -1192,11 +1194,11 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
11921194 Log .d(" CCL" , " IRH $currentDimensionResolved " )
11931195 }
11941196 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)
12001202 if (DEBUG ) {
12011203 Log .d(" CCL" , " UD $useDimension " )
12021204 }
@@ -1288,7 +1290,7 @@ internal open class Measurer : BasicMeasure.Measurer, DesignInfoProvider {
12881290 Log .d(
12891291 " CCL" ,
12901292 " Final measurement for ${measurable.layoutId} " +
1291- " to confirm size ${child.width} ${child.height} "
1293+ " to confirm size ${child.width} ${child.height} "
12921294 )
12931295 }
12941296 measurable.measure(Constraints .fixed(child.width, child.height))
@@ -1566,11 +1568,13 @@ internal typealias SolverChain = androidx.constraintlayout.core.state.State.Chai
15661568private val DEBUG = false
15671569private fun ConstraintWidget.toDebugString () =
15681570 " $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