Rabbit-R1/original r1/java/sources/androidx/constraintlayout/widget/VirtualLayout.java
2024-05-21 17:08:36 -04:00

80 lines
3 KiB
Java

package androidx.constraintlayout.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
/* loaded from: classes.dex */
public abstract class VirtualLayout extends ConstraintHelper {
private boolean mApplyElevationOnAttach;
private boolean mApplyVisibilityOnAttach;
public void onMeasure(androidx.constraintlayout.solver.widgets.VirtualLayout virtualLayout, int i, int i2) {
}
public VirtualLayout(Context context) {
super(context);
}
public VirtualLayout(Context context, AttributeSet attributeSet) {
super(context, attributeSet);
}
public VirtualLayout(Context context, AttributeSet attributeSet, int i) {
super(context, attributeSet, i);
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // androidx.constraintlayout.widget.ConstraintHelper
public void init(AttributeSet attributeSet) {
super.init(attributeSet);
if (attributeSet != null) {
TypedArray obtainStyledAttributes = getContext().obtainStyledAttributes(attributeSet, R.styleable.ConstraintLayout_Layout);
int indexCount = obtainStyledAttributes.getIndexCount();
for (int i = 0; i < indexCount; i++) {
int index = obtainStyledAttributes.getIndex(i);
if (index == R.styleable.ConstraintLayout_Layout_android_visibility) {
this.mApplyVisibilityOnAttach = true;
} else if (index == R.styleable.ConstraintLayout_Layout_android_elevation) {
this.mApplyElevationOnAttach = true;
}
}
}
}
@Override // androidx.constraintlayout.widget.ConstraintHelper, android.view.View
public void onAttachedToWindow() {
ViewParent parent;
super.onAttachedToWindow();
if ((this.mApplyVisibilityOnAttach || this.mApplyElevationOnAttach) && (parent = getParent()) != null && (parent instanceof ConstraintLayout)) {
ConstraintLayout constraintLayout = (ConstraintLayout) parent;
int visibility = getVisibility();
float elevation = getElevation();
for (int i = 0; i < this.mCount; i++) {
View viewById = constraintLayout.getViewById(this.mIds[i]);
if (viewById != null) {
if (this.mApplyVisibilityOnAttach) {
viewById.setVisibility(visibility);
}
if (this.mApplyElevationOnAttach && elevation > 0.0f) {
viewById.setTranslationZ(viewById.getTranslationZ() + elevation);
}
}
}
}
}
@Override // android.view.View
public void setVisibility(int i) {
super.setVisibility(i);
applyLayoutFeatures();
}
@Override // android.view.View
public void setElevation(float f) {
super.setElevation(f);
applyLayoutFeatures();
}
}