Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit a0ee41a

Browse files
authored
Fix for check 409 (#349)
1 parent 9c43494 commit a0ee41a

File tree

7 files changed

+28
-21
lines changed

7 files changed

+28
-21
lines changed

constraintlayout/core/src/main/java/androidx/constraintlayout/core/widgets/Chain.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ static void applyChainConstraints(ConstraintWidgetContainer container, LinearSys
152152
if (isSpreadOnly && !isChainPacked) {
153153
strength = SolverVariable.STRENGTH_EQUALITY;
154154
}
155+
if (widget == firstVisibleWidget && isChainPacked && widget.isInBarrier(orientation)) {
156+
strength = SolverVariable.STRENGTH_EQUALITY;
157+
}
155158
system.addEquality(begin.mSolverVariable, begin.mTarget.mSolverVariable, margin,
156159
strength);
157160
}

constraintlayout/core/src/main/java/androidx/constraintlayout/core/widgets/ConstraintWidget.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ protected void setInBarrier(int orientation, boolean value) {
369369
mIsInBarrier[orientation] = value;
370370
}
371371

372+
public boolean isInBarrier(int orientation) {
373+
return mIsInBarrier[orientation];
374+
}
375+
372376
public void setMeasureRequested(boolean measureRequested) {
373377
mMeasureRequested = measureRequested;
374378
}

desktop/ValidationTool/references/check_409_MATCH_MATCH.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
"duration": "590500",
2+
"duration": "197500",
33
"layout": {
44
"children": [
55
{
66
"bounds": {
77
"top": "0",
8-
"left": "1080",
8+
"left": "225",
99
"bottom": "0",
10-
"right": "1080"
10+
"right": "225"
1111
},
1212
"id": "barrierStart",
1313
"class": "Barrier"
1414
},
1515
{
1616
"bounds": {
1717
"top": "0",
18-
"left": "0",
18+
"left": "855",
1919
"bottom": "0",
20-
"right": "0"
20+
"right": "855"
2121
},
2222
"id": "barrierEnd",
2323
"class": "Barrier"
2424
},
2525
{
2626
"bounds": {
2727
"top": "0",
28-
"left": "1080",
28+
"left": "225",
2929
"bottom": "120",
30-
"right": "1260"
30+
"right": "405"
3131
},
3232
"id": "view1",
3333
"class": "MaterialTextView"
3434
},
3535
{
3636
"bounds": {
3737
"top": "0",
38-
"left": "0",
38+
"left": "405",
3939
"bottom": "120",
40-
"right": "0"
40+
"right": "855"
4141
},
4242
"id": "view2",
4343
"class": "MaterialTextView"

desktop/ValidationTool/references/check_409_MATCH_WRAP.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
"duration": "445500",
2+
"duration": "193500",
33
"layout": {
44
"children": [
55
{
66
"bounds": {
77
"top": "0",
8-
"left": "1080",
8+
"left": "225",
99
"bottom": "0",
10-
"right": "1080"
10+
"right": "225"
1111
},
1212
"id": "barrierStart",
1313
"class": "Barrier"
1414
},
1515
{
1616
"bounds": {
1717
"top": "0",
18-
"left": "0",
18+
"left": "855",
1919
"bottom": "0",
20-
"right": "0"
20+
"right": "855"
2121
},
2222
"id": "barrierEnd",
2323
"class": "Barrier"
2424
},
2525
{
2626
"bounds": {
2727
"top": "0",
28-
"left": "1080",
28+
"left": "225",
2929
"bottom": "120",
30-
"right": "1260"
30+
"right": "405"
3131
},
3232
"id": "view1",
3333
"class": "MaterialTextView"
3434
},
3535
{
3636
"bounds": {
3737
"top": "0",
38-
"left": "0",
38+
"left": "405",
3939
"bottom": "120",
40-
"right": "0"
40+
"right": "855"
4141
},
4242
"id": "view2",
4343
"class": "MaterialTextView"

desktop/ValidationTool/references/check_409_WRAP_MATCH.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"duration": "439000",
2+
"duration": "220000",
33
"layout": {
44
"children": [
55
{

desktop/ValidationTool/references/check_409_WRAP_WRAP.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"duration": "554500",
2+
"duration": "245500",
33
"layout": {
44
"children": [
55
{

projects/ConstraintLayoutValidation/app/src/main/java/androidx/constraintlayout/validation/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ protected void onCreate(Bundle savedInstanceState) {
690690
// list_view.setLayoutManager(linearLayoutManager);
691691
// list_view.setAdapter(new Adapter339(getApplicationContext(), xVals));
692692

693-
setContentView(R.layout.check_446);
693+
setContentView(R.layout.check_409);
694694

695695
//setContentView(R.layout.check_251);
696696
// setContentView(R.layout.check_024);

0 commit comments

Comments
 (0)