2021-06-27 20:44:35 +00:00
|
|
|
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.TimeCycleSplineSet;
|
|
|
|
import androidx.constraintlayout.widget.ConstraintAttribute;
|
|
|
|
import androidx.constraintlayout.widget.R;
|
2021-12-17 21:59:34 +00:00
|
|
|
import b.d.b.a.a;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashSet;
|
|
|
|
import java.util.Iterator;
|
|
|
|
public class KeyTimeCycle extends Key {
|
|
|
|
public static final int KEY_TYPE = 3;
|
|
|
|
public static final String NAME = "KeyTimeCycle";
|
|
|
|
private static final String TAG = "KeyTimeCycle";
|
|
|
|
private float mAlpha = Float.NaN;
|
|
|
|
private int mCurveFit = -1;
|
|
|
|
private float mElevation = 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 float mWaveOffset = 0.0f;
|
|
|
|
private float mWavePeriod = Float.NaN;
|
|
|
|
private int mWaveShape = 0;
|
|
|
|
|
|
|
|
public static class Loader {
|
|
|
|
private static final int ANDROID_ALPHA = 1;
|
|
|
|
private static final int ANDROID_ELEVATION = 2;
|
|
|
|
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 final int WAVE_OFFSET = 21;
|
|
|
|
private static final int WAVE_PERIOD = 20;
|
|
|
|
private static final int WAVE_SHAPE = 19;
|
|
|
|
private static SparseIntArray mAttrMap;
|
|
|
|
|
|
|
|
static {
|
|
|
|
SparseIntArray sparseIntArray = new SparseIntArray();
|
|
|
|
mAttrMap = sparseIntArray;
|
|
|
|
sparseIntArray.append(R.styleable.KeyTimeCycle_android_alpha, 1);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_elevation, 2);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_rotation, 4);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_rotationX, 5);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_rotationY, 6);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_scaleX, 7);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_transitionPathRotate, 8);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_transitionEasing, 9);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_motionTarget, 10);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_framePosition, 12);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_curveFit, 13);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_scaleY, 14);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_translationX, 15);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_translationY, 16);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_android_translationZ, 17);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_motionProgress, 18);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_wavePeriod, 20);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_waveOffset, 21);
|
|
|
|
mAttrMap.append(R.styleable.KeyTimeCycle_waveShape, 19);
|
|
|
|
}
|
|
|
|
|
|
|
|
private Loader() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void read(KeyTimeCycle keyTimeCycle, TypedArray typedArray) {
|
|
|
|
int indexCount = typedArray.getIndexCount();
|
|
|
|
for (int i = 0; i < indexCount; i++) {
|
|
|
|
int index = typedArray.getIndex(i);
|
|
|
|
switch (mAttrMap.get(index)) {
|
|
|
|
case 1:
|
|
|
|
KeyTimeCycle.access$002(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$000(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
KeyTimeCycle.access$102(keyTimeCycle, typedArray.getDimension(index, KeyTimeCycle.access$100(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 11:
|
|
|
|
default:
|
2021-11-05 06:48:17 +00:00
|
|
|
StringBuilder R = a.R("unused attribute 0x");
|
|
|
|
R.append(Integer.toHexString(index));
|
|
|
|
R.append(" ");
|
|
|
|
R.append(mAttrMap.get(index));
|
|
|
|
Log.e("KeyTimeCycle", R.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
KeyTimeCycle.access$202(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$200(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
KeyTimeCycle.access$802(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$800(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
KeyTimeCycle.access$902(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$900(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
KeyTimeCycle.access$702(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$700(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
KeyTimeCycle.access$1202(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$1200(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
KeyTimeCycle.access$1002(keyTimeCycle, typedArray.getString(index));
|
|
|
|
break;
|
|
|
|
case 10:
|
|
|
|
if (!MotionLayout.IS_IN_EDIT_MODE) {
|
|
|
|
if (typedArray.peekValue(index).type == 3) {
|
|
|
|
keyTimeCycle.mTargetString = typedArray.getString(index);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
keyTimeCycle.mTargetId = typedArray.getResourceId(index, keyTimeCycle.mTargetId);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
int resourceId = typedArray.getResourceId(index, keyTimeCycle.mTargetId);
|
|
|
|
keyTimeCycle.mTargetId = resourceId;
|
|
|
|
if (resourceId == -1) {
|
|
|
|
keyTimeCycle.mTargetString = typedArray.getString(index);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 12:
|
|
|
|
keyTimeCycle.mFramePosition = typedArray.getInt(index, keyTimeCycle.mFramePosition);
|
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
KeyTimeCycle.access$302(keyTimeCycle, typedArray.getInteger(index, KeyTimeCycle.access$300(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 14:
|
|
|
|
KeyTimeCycle.access$1102(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$1100(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 15:
|
|
|
|
KeyTimeCycle.access$1302(keyTimeCycle, typedArray.getDimension(index, KeyTimeCycle.access$1300(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 16:
|
|
|
|
KeyTimeCycle.access$1402(keyTimeCycle, typedArray.getDimension(index, KeyTimeCycle.access$1400(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 17:
|
|
|
|
KeyTimeCycle.access$1502(keyTimeCycle, typedArray.getDimension(index, KeyTimeCycle.access$1500(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 18:
|
|
|
|
KeyTimeCycle.access$1602(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$1600(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 19:
|
|
|
|
KeyTimeCycle.access$402(keyTimeCycle, typedArray.getInt(index, KeyTimeCycle.access$400(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 20:
|
|
|
|
KeyTimeCycle.access$502(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$500(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
case 21:
|
|
|
|
if (typedArray.peekValue(index).type == 5) {
|
|
|
|
KeyTimeCycle.access$602(keyTimeCycle, typedArray.getDimension(index, KeyTimeCycle.access$600(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
KeyTimeCycle.access$602(keyTimeCycle, typedArray.getFloat(index, KeyTimeCycle.access$600(keyTimeCycle)));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public KeyTimeCycle() {
|
|
|
|
this.mType = 3;
|
|
|
|
this.mCustomConstraints = new HashMap<>();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$000(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mAlpha;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$002(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mAlpha = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$100(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mElevation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ String access$1002(KeyTimeCycle keyTimeCycle, String str) {
|
|
|
|
keyTimeCycle.mTransitionEasing = str;
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$102(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mElevation = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1100(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mScaleY;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1102(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mScaleY = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1200(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mTransitionPathRotate;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1202(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mTransitionPathRotate = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1300(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mTranslationX;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1302(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mTranslationX = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1400(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mTranslationY;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1402(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mTranslationY = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1500(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mTranslationZ;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1502(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mTranslationZ = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1600(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mProgress;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1602(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mProgress = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$200(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mRotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$202(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mRotation = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$300(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mCurveFit;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$302(KeyTimeCycle keyTimeCycle, int i) {
|
|
|
|
keyTimeCycle.mCurveFit = i;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$400(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mWaveShape;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$402(KeyTimeCycle keyTimeCycle, int i) {
|
|
|
|
keyTimeCycle.mWaveShape = i;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$500(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mWavePeriod;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$502(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mWavePeriod = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$600(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mWaveOffset;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$602(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mWaveOffset = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$700(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mScaleX;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$702(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mScaleX = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$800(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mRotationX;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$802(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mRotationX = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$900(KeyTimeCycle keyTimeCycle) {
|
|
|
|
return keyTimeCycle.mRotationY;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$902(KeyTimeCycle keyTimeCycle, float f) {
|
|
|
|
keyTimeCycle.mRotationY = f;
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:24:0x0089, code lost:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (r1.equals(androidx.constraintlayout.motion.widget.Key.SCALE_Y) == false) goto L_0x004a;
|
2021-06-27 20:44:35 +00:00
|
|
|
*/
|
|
|
|
public void addTimeValues(HashMap<String, TimeCycleSplineSet> hashMap) {
|
|
|
|
Iterator<String> it = hashMap.keySet().iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
String next = it.next();
|
|
|
|
TimeCycleSplineSet timeCycleSplineSet = hashMap.get(next);
|
2021-12-17 21:59:34 +00:00
|
|
|
char c = 7;
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.startsWith(Key.CUSTOM)) {
|
2021-06-27 20:44:35 +00:00
|
|
|
ConstraintAttribute constraintAttribute = this.mCustomConstraints.get(next.substring(7));
|
|
|
|
if (constraintAttribute != null) {
|
|
|
|
((TimeCycleSplineSet.CustomSet) timeCycleSplineSet).setPoint(this.mFramePosition, constraintAttribute, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (next.hashCode()) {
|
|
|
|
case -1249320806:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.ROTATION_X)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 0;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -1249320805:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.ROTATION_Y)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 1;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -1225497657:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.TRANSLATION_X)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 2;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -1225497656:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.TRANSLATION_Y)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 3;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -1225497655:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.TRANSLATION_Z)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 4;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -1001078227:
|
|
|
|
if (next.equals("progress")) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 5;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -908189618:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.SCALE_X)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 6;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -908189617:
|
|
|
|
break;
|
|
|
|
case -40300674:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.ROTATION)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\b';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case -4379043:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.ELEVATION)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\t';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case 37232917:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.TRANSITION_PATH_ROTATE)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\n';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
case 92909918:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (next.equals(Key.ALPHA)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 11;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
default:
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
switch (c) {
|
2021-06-27 20:44:35 +00:00
|
|
|
case 0:
|
|
|
|
if (!Float.isNaN(this.mRotationX)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mRotationX, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
if (!Float.isNaN(this.mRotationY)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mRotationY, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
if (!Float.isNaN(this.mTranslationX)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mTranslationX, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
if (!Float.isNaN(this.mTranslationY)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mTranslationY, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 4:
|
|
|
|
if (!Float.isNaN(this.mTranslationZ)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mTranslationZ, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 5:
|
|
|
|
if (!Float.isNaN(this.mProgress)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mProgress, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 6:
|
|
|
|
if (!Float.isNaN(this.mScaleX)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mScaleX, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 7:
|
|
|
|
if (!Float.isNaN(this.mScaleY)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mScaleY, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case '\b':
|
|
|
|
if (!Float.isNaN(this.mRotation)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mRotation, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case '\t':
|
|
|
|
if (!Float.isNaN(this.mElevation)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mElevation, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case '\n':
|
|
|
|
if (!Float.isNaN(this.mTransitionPathRotate)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mTransitionPathRotate, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
case 11:
|
|
|
|
if (!Float.isNaN(this.mAlpha)) {
|
|
|
|
timeCycleSplineSet.setPoint(this.mFramePosition, this.mAlpha, this.mWavePeriod, this.mWaveShape, this.mWaveOffset);
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
Log.e("KeyTimeCycles", "UNKNOWN addValues \"" + next + "\"");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Key
|
|
|
|
public void addValues(HashMap<String, SplineSet> hashMap) {
|
|
|
|
throw new IllegalArgumentException(" KeyTimeCycles do not support SplineSet");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Key
|
|
|
|
public void getAttributeNames(HashSet<String> hashSet) {
|
|
|
|
if (!Float.isNaN(this.mAlpha)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.ALPHA);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mElevation)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.ELEVATION);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mRotation)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.ROTATION);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mRotationX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.ROTATION_X);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mRotationY)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.ROTATION_Y);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTranslationX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.TRANSLATION_X);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTranslationY)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.TRANSLATION_Y);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTranslationZ)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.TRANSLATION_Z);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTransitionPathRotate)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.TRANSITION_PATH_ROTATE);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mScaleX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.SCALE_X);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mScaleY)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashSet.add(Key.SCALE_Y);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
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());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Key
|
|
|
|
public void load(Context context, AttributeSet attributeSet) {
|
|
|
|
Loader.read(this, context.obtainStyledAttributes(attributeSet, R.styleable.KeyTimeCycle));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Key
|
|
|
|
public void setInterpolation(HashMap<String, Integer> hashMap) {
|
|
|
|
if (this.mCurveFit != -1) {
|
|
|
|
if (!Float.isNaN(this.mAlpha)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.ALPHA, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mElevation)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.ELEVATION, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mRotation)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.ROTATION, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mRotationX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.ROTATION_X, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mRotationY)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.ROTATION_Y, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTranslationX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.TRANSLATION_X, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTranslationY)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.TRANSLATION_Y, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTranslationZ)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.TRANSLATION_Z, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mTransitionPathRotate)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.TRANSITION_PATH_ROTATE, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mScaleX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.SCALE_X, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mScaleX)) {
|
2021-08-09 22:51:56 +00:00
|
|
|
hashMap.put(Key.SCALE_Y, Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
if (!Float.isNaN(this.mProgress)) {
|
|
|
|
hashMap.put("progress", Integer.valueOf(this.mCurveFit));
|
|
|
|
}
|
|
|
|
if (this.mCustomConstraints.size() > 0) {
|
|
|
|
for (String str : this.mCustomConstraints.keySet()) {
|
2021-11-05 06:48:17 +00:00
|
|
|
hashMap.put(a.v("CUSTOM,", str), Integer.valueOf(this.mCurveFit));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // androidx.constraintlayout.motion.widget.Key
|
|
|
|
public void setValue(String str, Object obj) {
|
|
|
|
str.hashCode();
|
2021-12-17 21:59:34 +00:00
|
|
|
char c = 65535;
|
2021-06-27 20:44:35 +00:00
|
|
|
switch (str.hashCode()) {
|
|
|
|
case -1812823328:
|
|
|
|
if (str.equals("transitionEasing")) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 0;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -1249320806:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.ROTATION_X)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 1;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -1249320805:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.ROTATION_Y)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 2;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -1225497657:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.TRANSLATION_X)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 3;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -1225497656:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.TRANSLATION_Y)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 4;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -1001078227:
|
|
|
|
if (str.equals("progress")) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 5;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -908189618:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.SCALE_X)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 6;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -908189617:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.SCALE_Y)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 7;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -40300674:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.ROTATION)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\b';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case -4379043:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.ELEVATION)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\t';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 37232917:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.TRANSITION_PATH_ROTATE)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\n';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 92909918:
|
2021-08-09 22:51:56 +00:00
|
|
|
if (str.equals(Key.ALPHA)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = 11;
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 579057826:
|
|
|
|
if (str.equals("curveFit")) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\f';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1317633238:
|
|
|
|
if (str.equals("mTranslationZ")) {
|
2021-12-17 21:59:34 +00:00
|
|
|
c = '\r';
|
2021-06-27 20:44:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2021-12-17 21:59:34 +00:00
|
|
|
switch (c) {
|
2021-06-27 20:44:35 +00:00
|
|
|
case 0:
|
|
|
|
this.mTransitionEasing = obj.toString();
|
|
|
|
return;
|
|
|
|
case 1:
|
|
|
|
this.mRotationX = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 2:
|
|
|
|
this.mRotationY = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 3:
|
|
|
|
this.mTranslationX = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 4:
|
|
|
|
this.mTranslationY = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 5:
|
|
|
|
this.mProgress = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 6:
|
|
|
|
this.mScaleX = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 7:
|
|
|
|
this.mScaleY = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case '\b':
|
|
|
|
this.mRotation = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case '\t':
|
|
|
|
this.mElevation = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case '\n':
|
|
|
|
this.mTransitionPathRotate = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case 11:
|
|
|
|
this.mAlpha = toFloat(obj);
|
|
|
|
return;
|
|
|
|
case '\f':
|
|
|
|
this.mCurveFit = toInt(obj);
|
|
|
|
return;
|
|
|
|
case '\r':
|
|
|
|
this.mTranslationZ = toFloat(obj);
|
|
|
|
return;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|