mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-01 02:03:24 +01:00
145 lines
5.6 KiB
Java
145 lines
5.6 KiB
Java
package androidx.constraintlayout.solver.widgets;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes13.dex */
|
|
public class ConstraintWidgetGroup {
|
|
public List<ConstraintWidget> mConstrainedGroup;
|
|
public final int[] mGroupDimensions;
|
|
int mGroupHeight;
|
|
int mGroupWidth;
|
|
public boolean mSkipSolver;
|
|
List<ConstraintWidget> mStartHorizontalWidgets;
|
|
List<ConstraintWidget> mStartVerticalWidgets;
|
|
List<ConstraintWidget> mUnresolvedWidgets;
|
|
HashSet<ConstraintWidget> mWidgetsToSetHorizontal;
|
|
HashSet<ConstraintWidget> mWidgetsToSetVertical;
|
|
List<ConstraintWidget> mWidgetsToSolve;
|
|
|
|
public ConstraintWidgetGroup(List<ConstraintWidget> list, boolean z) {
|
|
this.mGroupWidth = -1;
|
|
this.mGroupHeight = -1;
|
|
this.mSkipSolver = false;
|
|
this.mGroupDimensions = new int[]{-1, -1};
|
|
this.mStartHorizontalWidgets = new ArrayList();
|
|
this.mStartVerticalWidgets = new ArrayList();
|
|
this.mWidgetsToSetHorizontal = new HashSet<>();
|
|
this.mWidgetsToSetVertical = new HashSet<>();
|
|
this.mWidgetsToSolve = new ArrayList();
|
|
this.mUnresolvedWidgets = new ArrayList();
|
|
this.mConstrainedGroup = list;
|
|
this.mSkipSolver = z;
|
|
}
|
|
|
|
private void getWidgetsToSolveTraversal(ArrayList<ConstraintWidget> arrayList, ConstraintWidget constraintWidget) {
|
|
ConstraintWidget constraintWidget2;
|
|
if (constraintWidget.mGroupsToSolver) {
|
|
return;
|
|
}
|
|
arrayList.add(constraintWidget);
|
|
constraintWidget.mGroupsToSolver = true;
|
|
if (constraintWidget.isFullyResolved()) {
|
|
return;
|
|
}
|
|
if (constraintWidget instanceof Helper) {
|
|
Helper helper = (Helper) constraintWidget;
|
|
int i = helper.mWidgetsCount;
|
|
for (int i2 = 0; i2 < i; i2++) {
|
|
getWidgetsToSolveTraversal(arrayList, helper.mWidgets[i2]);
|
|
}
|
|
}
|
|
int length = constraintWidget.mListAnchors.length;
|
|
for (int i3 = 0; i3 < length; i3++) {
|
|
ConstraintAnchor constraintAnchor = constraintWidget.mListAnchors[i3].mTarget;
|
|
if (constraintAnchor != null && (constraintWidget2 = constraintAnchor.mOwner) != constraintWidget.getParent()) {
|
|
getWidgetsToSolveTraversal(arrayList, constraintWidget2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:18:0x0045 */
|
|
/* JADX WARN: Removed duplicated region for block: B:21:0x0068 */
|
|
/* JADX WARN: Removed duplicated region for block: B:27:0x0084 */
|
|
/* JADX WARN: Removed duplicated region for block: B:47:0x004d */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private void updateResolvedDimension(androidx.constraintlayout.solver.widgets.ConstraintWidget r7) {
|
|
/*
|
|
Method dump skipped, instructions count: 215
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.solver.widgets.ConstraintWidgetGroup.updateResolvedDimension(androidx.constraintlayout.solver.widgets.ConstraintWidget):void");
|
|
}
|
|
|
|
public void addWidgetsToSet(ConstraintWidget constraintWidget, int i) {
|
|
if (i == 0) {
|
|
this.mWidgetsToSetHorizontal.add(constraintWidget);
|
|
} else if (i == 1) {
|
|
this.mWidgetsToSetVertical.add(constraintWidget);
|
|
}
|
|
}
|
|
|
|
public List<ConstraintWidget> getStartWidgets(int i) {
|
|
if (i == 0) {
|
|
return this.mStartHorizontalWidgets;
|
|
}
|
|
if (i == 1) {
|
|
return this.mStartVerticalWidgets;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public Set<ConstraintWidget> getWidgetsToSet(int i) {
|
|
if (i == 0) {
|
|
return this.mWidgetsToSetHorizontal;
|
|
}
|
|
if (i == 1) {
|
|
return this.mWidgetsToSetVertical;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public List<ConstraintWidget> getWidgetsToSolve() {
|
|
if (!this.mWidgetsToSolve.isEmpty()) {
|
|
return this.mWidgetsToSolve;
|
|
}
|
|
int size = this.mConstrainedGroup.size();
|
|
for (int i = 0; i < size; i++) {
|
|
ConstraintWidget constraintWidget = this.mConstrainedGroup.get(i);
|
|
if (!constraintWidget.mOptimizerMeasurable) {
|
|
getWidgetsToSolveTraversal((ArrayList) this.mWidgetsToSolve, constraintWidget);
|
|
}
|
|
}
|
|
this.mUnresolvedWidgets.clear();
|
|
this.mUnresolvedWidgets.addAll(this.mConstrainedGroup);
|
|
this.mUnresolvedWidgets.removeAll(this.mWidgetsToSolve);
|
|
return this.mWidgetsToSolve;
|
|
}
|
|
|
|
public void updateUnresolvedWidgets() {
|
|
int size = this.mUnresolvedWidgets.size();
|
|
for (int i = 0; i < size; i++) {
|
|
updateResolvedDimension(this.mUnresolvedWidgets.get(i));
|
|
}
|
|
}
|
|
|
|
public ConstraintWidgetGroup(List<ConstraintWidget> list) {
|
|
this.mGroupWidth = -1;
|
|
this.mGroupHeight = -1;
|
|
this.mSkipSolver = false;
|
|
this.mGroupDimensions = new int[]{-1, -1};
|
|
this.mStartHorizontalWidgets = new ArrayList();
|
|
this.mStartVerticalWidgets = new ArrayList();
|
|
this.mWidgetsToSetHorizontal = new HashSet<>();
|
|
this.mWidgetsToSetVertical = new HashSet<>();
|
|
this.mWidgetsToSolve = new ArrayList();
|
|
this.mUnresolvedWidgets = new ArrayList();
|
|
this.mConstrainedGroup = list;
|
|
}
|
|
}
|