mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-27 09:32:27 -06:00
112 lines
3.9 KiB
Java
112 lines
3.9 KiB
Java
package androidx.constraintlayout.motion.widget;
|
|
|
|
import android.content.Context;
|
|
import android.content.res.TypedArray;
|
|
import android.util.AttributeSet;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import androidx.constraintlayout.motion.widget.MotionLayout;
|
|
import androidx.constraintlayout.widget.ConstraintHelper;
|
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
|
import androidx.constraintlayout.widget.R;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class MotionHelper extends ConstraintHelper implements Animatable, MotionLayout.TransitionListener {
|
|
private float mProgress;
|
|
private boolean mUseOnHide;
|
|
private boolean mUseOnShow;
|
|
protected View[] views;
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Animatable
|
|
public float getProgress() {
|
|
return this.mProgress;
|
|
}
|
|
|
|
public boolean isUseOnHide() {
|
|
return this.mUseOnHide;
|
|
}
|
|
|
|
public boolean isUsedOnShow() {
|
|
return this.mUseOnShow;
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener
|
|
public void onTransitionChange(MotionLayout motionLayout, int i, int i2, float f) {
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener
|
|
public void onTransitionCompleted(MotionLayout motionLayout, int i) {
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener
|
|
public void onTransitionStarted(MotionLayout motionLayout, int i, int i2) {
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.MotionLayout.TransitionListener
|
|
public void onTransitionTrigger(MotionLayout motionLayout, int i, boolean z, float f) {
|
|
}
|
|
|
|
public void setProgress(View view, float f) {
|
|
}
|
|
|
|
public MotionHelper(Context context) {
|
|
super(context);
|
|
this.mUseOnShow = false;
|
|
this.mUseOnHide = false;
|
|
}
|
|
|
|
public MotionHelper(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.mUseOnShow = false;
|
|
this.mUseOnHide = false;
|
|
init(attributeSet);
|
|
}
|
|
|
|
public MotionHelper(Context context, AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
this.mUseOnShow = false;
|
|
this.mUseOnHide = false;
|
|
init(attributeSet);
|
|
}
|
|
|
|
/* 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.MotionHelper);
|
|
int indexCount = obtainStyledAttributes.getIndexCount();
|
|
for (int i = 0; i < indexCount; i++) {
|
|
int index = obtainStyledAttributes.getIndex(i);
|
|
if (index == R.styleable.MotionHelper_onShow) {
|
|
this.mUseOnShow = obtainStyledAttributes.getBoolean(index, this.mUseOnShow);
|
|
} else if (index == R.styleable.MotionHelper_onHide) {
|
|
this.mUseOnHide = obtainStyledAttributes.getBoolean(index, this.mUseOnHide);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Animatable
|
|
public void setProgress(float f) {
|
|
this.mProgress = f;
|
|
int i = 0;
|
|
if (this.mCount > 0) {
|
|
this.views = getViews((ConstraintLayout) getParent());
|
|
while (i < this.mCount) {
|
|
setProgress(this.views[i], f);
|
|
i++;
|
|
}
|
|
return;
|
|
}
|
|
ViewGroup viewGroup = (ViewGroup) getParent();
|
|
int childCount = viewGroup.getChildCount();
|
|
while (i < childCount) {
|
|
View childAt = viewGroup.getChildAt(i);
|
|
if (!(childAt instanceof MotionHelper)) {
|
|
setProgress(childAt, f);
|
|
}
|
|
i++;
|
|
}
|
|
}
|
|
}
|