discord-jadx/app/src/main/java/androidx/constraintlayout/motion/widget/KeyAttributes.java

819 lines
31 KiB
Java

package androidx.constraintlayout.motion.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseIntArray;
import androidx.constraintlayout.motion.widget.SplineSet;
import androidx.constraintlayout.widget.ConstraintAttribute;
import androidx.constraintlayout.widget.R;
import c.d.b.a.a;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
public class KeyAttributes extends Key {
public static final int KEY_TYPE = 1;
public static final String NAME = "KeyAttribute";
private static final String TAG = "KeyAttribute";
private float mAlpha = Float.NaN;
private int mCurveFit = -1;
private float mElevation = Float.NaN;
private float mPivotX = Float.NaN;
private float mPivotY = Float.NaN;
private float mProgress = Float.NaN;
private float mRotation = Float.NaN;
private float mRotationX = Float.NaN;
private float mRotationY = Float.NaN;
private float mScaleX = Float.NaN;
private float mScaleY = Float.NaN;
private String mTransitionEasing;
private float mTransitionPathRotate = Float.NaN;
private float mTranslationX = Float.NaN;
private float mTranslationY = Float.NaN;
private float mTranslationZ = Float.NaN;
private boolean mVisibility = false;
public static class Loader {
private static final int ANDROID_ALPHA = 1;
private static final int ANDROID_ELEVATION = 2;
private static final int ANDROID_PIVOT_X = 19;
private static final int ANDROID_PIVOT_Y = 20;
private static final int ANDROID_ROTATION = 4;
private static final int ANDROID_ROTATION_X = 5;
private static final int ANDROID_ROTATION_Y = 6;
private static final int ANDROID_SCALE_X = 7;
private static final int ANDROID_SCALE_Y = 14;
private static final int ANDROID_TRANSLATION_X = 15;
private static final int ANDROID_TRANSLATION_Y = 16;
private static final int ANDROID_TRANSLATION_Z = 17;
private static final int CURVE_FIT = 13;
private static final int FRAME_POSITION = 12;
private static final int PROGRESS = 18;
private static final int TARGET_ID = 10;
private static final int TRANSITION_EASING = 9;
private static final int TRANSITION_PATH_ROTATE = 8;
private static SparseIntArray mAttrMap;
static {
SparseIntArray sparseIntArray = new SparseIntArray();
mAttrMap = sparseIntArray;
sparseIntArray.append(R.styleable.KeyAttribute_android_alpha, 1);
mAttrMap.append(R.styleable.KeyAttribute_android_elevation, 2);
mAttrMap.append(R.styleable.KeyAttribute_android_rotation, 4);
mAttrMap.append(R.styleable.KeyAttribute_android_rotationX, 5);
mAttrMap.append(R.styleable.KeyAttribute_android_rotationY, 6);
mAttrMap.append(R.styleable.KeyAttribute_android_transformPivotX, 19);
mAttrMap.append(R.styleable.KeyAttribute_android_transformPivotY, 20);
mAttrMap.append(R.styleable.KeyAttribute_android_scaleX, 7);
mAttrMap.append(R.styleable.KeyAttribute_transitionPathRotate, 8);
mAttrMap.append(R.styleable.KeyAttribute_transitionEasing, 9);
mAttrMap.append(R.styleable.KeyAttribute_motionTarget, 10);
mAttrMap.append(R.styleable.KeyAttribute_framePosition, 12);
mAttrMap.append(R.styleable.KeyAttribute_curveFit, 13);
mAttrMap.append(R.styleable.KeyAttribute_android_scaleY, 14);
mAttrMap.append(R.styleable.KeyAttribute_android_translationX, 15);
mAttrMap.append(R.styleable.KeyAttribute_android_translationY, 16);
mAttrMap.append(R.styleable.KeyAttribute_android_translationZ, 17);
mAttrMap.append(R.styleable.KeyAttribute_motionProgress, 18);
}
private Loader() {
}
public static void read(KeyAttributes keyAttributes, TypedArray typedArray) {
int indexCount = typedArray.getIndexCount();
for (int i = 0; i < indexCount; i++) {
int index = typedArray.getIndex(i);
switch (mAttrMap.get(index)) {
case 1:
KeyAttributes.access$002(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$000(keyAttributes)));
break;
case 2:
KeyAttributes.access$102(keyAttributes, typedArray.getDimension(index, KeyAttributes.access$100(keyAttributes)));
break;
case 3:
case 11:
default:
StringBuilder L = a.L("unused attribute 0x");
L.append(Integer.toHexString(index));
L.append(" ");
L.append(mAttrMap.get(index));
Log.e("KeyAttribute", L.toString());
break;
case 4:
KeyAttributes.access$202(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$200(keyAttributes)));
break;
case 5:
KeyAttributes.access$502(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$500(keyAttributes)));
break;
case 6:
KeyAttributes.access$602(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$600(keyAttributes)));
break;
case 7:
KeyAttributes.access$402(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$400(keyAttributes)));
break;
case 8:
KeyAttributes.access$1102(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$1100(keyAttributes)));
break;
case 9:
KeyAttributes.access$902(keyAttributes, typedArray.getString(index));
break;
case 10:
if (!MotionLayout.IS_IN_EDIT_MODE) {
if (typedArray.peekValue(index).type == 3) {
keyAttributes.mTargetString = typedArray.getString(index);
break;
} else {
keyAttributes.mTargetId = typedArray.getResourceId(index, keyAttributes.mTargetId);
break;
}
} else {
int resourceId = typedArray.getResourceId(index, keyAttributes.mTargetId);
keyAttributes.mTargetId = resourceId;
if (resourceId == -1) {
keyAttributes.mTargetString = typedArray.getString(index);
break;
} else {
break;
}
}
case 12:
keyAttributes.mFramePosition = typedArray.getInt(index, keyAttributes.mFramePosition);
break;
case 13:
KeyAttributes.access$302(keyAttributes, typedArray.getInteger(index, KeyAttributes.access$300(keyAttributes)));
break;
case 14:
KeyAttributes.access$1002(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$1000(keyAttributes)));
break;
case 15:
KeyAttributes.access$1202(keyAttributes, typedArray.getDimension(index, KeyAttributes.access$1200(keyAttributes)));
break;
case 16:
KeyAttributes.access$1302(keyAttributes, typedArray.getDimension(index, KeyAttributes.access$1300(keyAttributes)));
break;
case 17:
KeyAttributes.access$1402(keyAttributes, typedArray.getDimension(index, KeyAttributes.access$1400(keyAttributes)));
break;
case 18:
KeyAttributes.access$1502(keyAttributes, typedArray.getFloat(index, KeyAttributes.access$1500(keyAttributes)));
break;
case 19:
KeyAttributes.access$702(keyAttributes, typedArray.getDimension(index, KeyAttributes.access$700(keyAttributes)));
break;
case 20:
KeyAttributes.access$802(keyAttributes, typedArray.getDimension(index, KeyAttributes.access$800(keyAttributes)));
break;
}
}
}
}
public KeyAttributes() {
this.mType = 1;
this.mCustomConstraints = new HashMap<>();
}
public static /* synthetic */ float access$000(KeyAttributes keyAttributes) {
return keyAttributes.mAlpha;
}
public static /* synthetic */ float access$002(KeyAttributes keyAttributes, float f) {
keyAttributes.mAlpha = f;
return f;
}
public static /* synthetic */ float access$100(KeyAttributes keyAttributes) {
return keyAttributes.mElevation;
}
public static /* synthetic */ float access$1000(KeyAttributes keyAttributes) {
return keyAttributes.mScaleY;
}
public static /* synthetic */ float access$1002(KeyAttributes keyAttributes, float f) {
keyAttributes.mScaleY = f;
return f;
}
public static /* synthetic */ float access$102(KeyAttributes keyAttributes, float f) {
keyAttributes.mElevation = f;
return f;
}
public static /* synthetic */ float access$1100(KeyAttributes keyAttributes) {
return keyAttributes.mTransitionPathRotate;
}
public static /* synthetic */ float access$1102(KeyAttributes keyAttributes, float f) {
keyAttributes.mTransitionPathRotate = f;
return f;
}
public static /* synthetic */ float access$1200(KeyAttributes keyAttributes) {
return keyAttributes.mTranslationX;
}
public static /* synthetic */ float access$1202(KeyAttributes keyAttributes, float f) {
keyAttributes.mTranslationX = f;
return f;
}
public static /* synthetic */ float access$1300(KeyAttributes keyAttributes) {
return keyAttributes.mTranslationY;
}
public static /* synthetic */ float access$1302(KeyAttributes keyAttributes, float f) {
keyAttributes.mTranslationY = f;
return f;
}
public static /* synthetic */ float access$1400(KeyAttributes keyAttributes) {
return keyAttributes.mTranslationZ;
}
public static /* synthetic */ float access$1402(KeyAttributes keyAttributes, float f) {
keyAttributes.mTranslationZ = f;
return f;
}
public static /* synthetic */ float access$1500(KeyAttributes keyAttributes) {
return keyAttributes.mProgress;
}
public static /* synthetic */ float access$1502(KeyAttributes keyAttributes, float f) {
keyAttributes.mProgress = f;
return f;
}
public static /* synthetic */ float access$200(KeyAttributes keyAttributes) {
return keyAttributes.mRotation;
}
public static /* synthetic */ float access$202(KeyAttributes keyAttributes, float f) {
keyAttributes.mRotation = f;
return f;
}
public static /* synthetic */ int access$300(KeyAttributes keyAttributes) {
return keyAttributes.mCurveFit;
}
public static /* synthetic */ int access$302(KeyAttributes keyAttributes, int i) {
keyAttributes.mCurveFit = i;
return i;
}
public static /* synthetic */ float access$400(KeyAttributes keyAttributes) {
return keyAttributes.mScaleX;
}
public static /* synthetic */ float access$402(KeyAttributes keyAttributes, float f) {
keyAttributes.mScaleX = f;
return f;
}
public static /* synthetic */ float access$500(KeyAttributes keyAttributes) {
return keyAttributes.mRotationX;
}
public static /* synthetic */ float access$502(KeyAttributes keyAttributes, float f) {
keyAttributes.mRotationX = f;
return f;
}
public static /* synthetic */ float access$600(KeyAttributes keyAttributes) {
return keyAttributes.mRotationY;
}
public static /* synthetic */ float access$602(KeyAttributes keyAttributes, float f) {
keyAttributes.mRotationY = f;
return f;
}
public static /* synthetic */ float access$700(KeyAttributes keyAttributes) {
return keyAttributes.mPivotX;
}
public static /* synthetic */ float access$702(KeyAttributes keyAttributes, float f) {
keyAttributes.mPivotX = f;
return f;
}
public static /* synthetic */ float access$800(KeyAttributes keyAttributes) {
return keyAttributes.mPivotY;
}
public static /* synthetic */ float access$802(KeyAttributes keyAttributes, float f) {
keyAttributes.mPivotY = f;
return f;
}
public static /* synthetic */ String access$902(KeyAttributes keyAttributes, String str) {
keyAttributes.mTransitionEasing = str;
return str;
}
/* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
/* JADX WARNING: Code restructure failed: missing block: B:30:0x009c, code lost:
if (r1.equals("scaleY") == false) goto L_0x0041;
*/
@Override // androidx.constraintlayout.motion.widget.Key
public void addValues(HashMap<String, SplineSet> hashMap) {
Iterator<String> it = hashMap.keySet().iterator();
while (it.hasNext()) {
String next = it.next();
SplineSet splineSet = hashMap.get(next);
char c2 = 7;
if (next.startsWith("CUSTOM")) {
ConstraintAttribute constraintAttribute = this.mCustomConstraints.get(next.substring(7));
if (constraintAttribute != null) {
((SplineSet.CustomSet) splineSet).setPoint(this.mFramePosition, constraintAttribute);
}
} else {
switch (next.hashCode()) {
case -1249320806:
if (next.equals("rotationX")) {
c2 = 0;
break;
}
c2 = 65535;
break;
case -1249320805:
if (next.equals("rotationY")) {
c2 = 1;
break;
}
c2 = 65535;
break;
case -1225497657:
if (next.equals("translationX")) {
c2 = 2;
break;
}
c2 = 65535;
break;
case -1225497656:
if (next.equals("translationY")) {
c2 = 3;
break;
}
c2 = 65535;
break;
case -1225497655:
if (next.equals("translationZ")) {
c2 = 4;
break;
}
c2 = 65535;
break;
case -1001078227:
if (next.equals("progress")) {
c2 = 5;
break;
}
c2 = 65535;
break;
case -908189618:
if (next.equals("scaleX")) {
c2 = 6;
break;
}
c2 = 65535;
break;
case -908189617:
break;
case -760884510:
if (next.equals("transformPivotX")) {
c2 = '\b';
break;
}
c2 = 65535;
break;
case -760884509:
if (next.equals("transformPivotY")) {
c2 = '\t';
break;
}
c2 = 65535;
break;
case -40300674:
if (next.equals("rotation")) {
c2 = '\n';
break;
}
c2 = 65535;
break;
case -4379043:
if (next.equals("elevation")) {
c2 = 11;
break;
}
c2 = 65535;
break;
case 37232917:
if (next.equals("transitionPathRotate")) {
c2 = '\f';
break;
}
c2 = 65535;
break;
case 92909918:
if (next.equals("alpha")) {
c2 = '\r';
break;
}
c2 = 65535;
break;
default:
c2 = 65535;
break;
}
switch (c2) {
case 0:
if (!Float.isNaN(this.mRotationX)) {
splineSet.setPoint(this.mFramePosition, this.mRotationX);
break;
} else {
continue;
}
case 1:
if (!Float.isNaN(this.mRotationY)) {
splineSet.setPoint(this.mFramePosition, this.mRotationY);
break;
} else {
continue;
}
case 2:
if (!Float.isNaN(this.mTranslationX)) {
splineSet.setPoint(this.mFramePosition, this.mTranslationX);
break;
} else {
continue;
}
case 3:
if (!Float.isNaN(this.mTranslationY)) {
splineSet.setPoint(this.mFramePosition, this.mTranslationY);
break;
} else {
continue;
}
case 4:
if (!Float.isNaN(this.mTranslationZ)) {
splineSet.setPoint(this.mFramePosition, this.mTranslationZ);
break;
} else {
continue;
}
case 5:
if (!Float.isNaN(this.mProgress)) {
splineSet.setPoint(this.mFramePosition, this.mProgress);
break;
} else {
continue;
}
case 6:
if (!Float.isNaN(this.mScaleX)) {
splineSet.setPoint(this.mFramePosition, this.mScaleX);
break;
} else {
continue;
}
case 7:
if (!Float.isNaN(this.mScaleY)) {
splineSet.setPoint(this.mFramePosition, this.mScaleY);
break;
} else {
continue;
}
case '\b':
if (!Float.isNaN(this.mRotationX)) {
splineSet.setPoint(this.mFramePosition, this.mPivotX);
break;
} else {
continue;
}
case '\t':
if (!Float.isNaN(this.mRotationY)) {
splineSet.setPoint(this.mFramePosition, this.mPivotY);
break;
} else {
continue;
}
case '\n':
if (!Float.isNaN(this.mRotation)) {
splineSet.setPoint(this.mFramePosition, this.mRotation);
break;
} else {
continue;
}
case 11:
if (!Float.isNaN(this.mElevation)) {
splineSet.setPoint(this.mFramePosition, this.mElevation);
break;
} else {
continue;
}
case '\f':
if (!Float.isNaN(this.mTransitionPathRotate)) {
splineSet.setPoint(this.mFramePosition, this.mTransitionPathRotate);
break;
} else {
continue;
}
case '\r':
if (!Float.isNaN(this.mAlpha)) {
splineSet.setPoint(this.mFramePosition, this.mAlpha);
break;
} else {
continue;
}
default:
Log.v("KeyAttributes", "UNKNOWN addValues \"" + next + "\"");
continue;
}
}
}
}
@Override // androidx.constraintlayout.motion.widget.Key
public void getAttributeNames(HashSet<String> hashSet) {
if (!Float.isNaN(this.mAlpha)) {
hashSet.add("alpha");
}
if (!Float.isNaN(this.mElevation)) {
hashSet.add("elevation");
}
if (!Float.isNaN(this.mRotation)) {
hashSet.add("rotation");
}
if (!Float.isNaN(this.mRotationX)) {
hashSet.add("rotationX");
}
if (!Float.isNaN(this.mRotationY)) {
hashSet.add("rotationY");
}
if (!Float.isNaN(this.mPivotX)) {
hashSet.add("transformPivotX");
}
if (!Float.isNaN(this.mPivotY)) {
hashSet.add("transformPivotY");
}
if (!Float.isNaN(this.mTranslationX)) {
hashSet.add("translationX");
}
if (!Float.isNaN(this.mTranslationY)) {
hashSet.add("translationY");
}
if (!Float.isNaN(this.mTranslationZ)) {
hashSet.add("translationZ");
}
if (!Float.isNaN(this.mTransitionPathRotate)) {
hashSet.add("transitionPathRotate");
}
if (!Float.isNaN(this.mScaleX)) {
hashSet.add("scaleX");
}
if (!Float.isNaN(this.mScaleY)) {
hashSet.add("scaleY");
}
if (!Float.isNaN(this.mProgress)) {
hashSet.add("progress");
}
if (this.mCustomConstraints.size() > 0) {
Iterator<String> it = this.mCustomConstraints.keySet().iterator();
while (it.hasNext()) {
hashSet.add("CUSTOM," + it.next());
}
}
}
public int getCurveFit() {
return this.mCurveFit;
}
@Override // androidx.constraintlayout.motion.widget.Key
public void load(Context context, AttributeSet attributeSet) {
Loader.read(this, context.obtainStyledAttributes(attributeSet, R.styleable.KeyAttribute));
}
@Override // androidx.constraintlayout.motion.widget.Key
public void setInterpolation(HashMap<String, Integer> hashMap) {
if (this.mCurveFit != -1) {
if (!Float.isNaN(this.mAlpha)) {
hashMap.put("alpha", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mElevation)) {
hashMap.put("elevation", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mRotation)) {
hashMap.put("rotation", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mRotationX)) {
hashMap.put("rotationX", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mRotationY)) {
hashMap.put("rotationY", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mPivotX)) {
hashMap.put("transformPivotX", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mPivotY)) {
hashMap.put("transformPivotY", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mTranslationX)) {
hashMap.put("translationX", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mTranslationY)) {
hashMap.put("translationY", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mTranslationZ)) {
hashMap.put("translationZ", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mTransitionPathRotate)) {
hashMap.put("transitionPathRotate", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mScaleX)) {
hashMap.put("scaleX", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mScaleY)) {
hashMap.put("scaleY", Integer.valueOf(this.mCurveFit));
}
if (!Float.isNaN(this.mProgress)) {
hashMap.put("progress", Integer.valueOf(this.mCurveFit));
}
if (this.mCustomConstraints.size() > 0) {
for (String str : this.mCustomConstraints.keySet()) {
hashMap.put(a.t("CUSTOM,", str), Integer.valueOf(this.mCurveFit));
}
}
}
}
@Override // androidx.constraintlayout.motion.widget.Key
public void setValue(String str, Object obj) {
str.hashCode();
char c2 = 65535;
switch (str.hashCode()) {
case -1913008125:
if (str.equals("motionProgress")) {
c2 = 0;
break;
}
break;
case -1812823328:
if (str.equals("transitionEasing")) {
c2 = 1;
break;
}
break;
case -1249320806:
if (str.equals("rotationX")) {
c2 = 2;
break;
}
break;
case -1249320805:
if (str.equals("rotationY")) {
c2 = 3;
break;
}
break;
case -1225497657:
if (str.equals("translationX")) {
c2 = 4;
break;
}
break;
case -1225497656:
if (str.equals("translationY")) {
c2 = 5;
break;
}
break;
case -987906986:
if (str.equals("pivotX")) {
c2 = 6;
break;
}
break;
case -987906985:
if (str.equals("pivotY")) {
c2 = 7;
break;
}
break;
case -908189618:
if (str.equals("scaleX")) {
c2 = '\b';
break;
}
break;
case -908189617:
if (str.equals("scaleY")) {
c2 = '\t';
break;
}
break;
case -40300674:
if (str.equals("rotation")) {
c2 = '\n';
break;
}
break;
case -4379043:
if (str.equals("elevation")) {
c2 = 11;
break;
}
break;
case 37232917:
if (str.equals("transitionPathRotate")) {
c2 = '\f';
break;
}
break;
case 92909918:
if (str.equals("alpha")) {
c2 = '\r';
break;
}
break;
case 579057826:
if (str.equals("curveFit")) {
c2 = 14;
break;
}
break;
case 1317633238:
if (str.equals("mTranslationZ")) {
c2 = 15;
break;
}
break;
case 1941332754:
if (str.equals("visibility")) {
c2 = 16;
break;
}
break;
}
switch (c2) {
case 0:
this.mProgress = toFloat(obj);
return;
case 1:
this.mTransitionEasing = obj.toString();
return;
case 2:
this.mRotationX = toFloat(obj);
return;
case 3:
this.mRotationY = toFloat(obj);
return;
case 4:
this.mTranslationX = toFloat(obj);
return;
case 5:
this.mTranslationY = toFloat(obj);
return;
case 6:
this.mPivotX = toFloat(obj);
return;
case 7:
this.mPivotY = toFloat(obj);
return;
case '\b':
this.mScaleX = toFloat(obj);
return;
case '\t':
this.mScaleY = toFloat(obj);
return;
case '\n':
this.mRotation = toFloat(obj);
return;
case 11:
this.mElevation = toFloat(obj);
return;
case '\f':
this.mTransitionPathRotate = toFloat(obj);
return;
case '\r':
this.mAlpha = toFloat(obj);
return;
case 14:
this.mCurveFit = toInt(obj);
return;
case 15:
this.mTranslationZ = toFloat(obj);
return;
case 16:
this.mVisibility = toBoolean(obj);
return;
default:
return;
}
}
}