Rabbit-R1/android (non root)/java/sources/androidx/constraintlayout/motion/widget/KeyTrigger.java

180 lines
7.6 KiB
Java
Raw Normal View History

2024-05-21 16:08:36 -05:00
package androidx.constraintlayout.motion.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseIntArray;
import android.view.View;
import androidx.constraintlayout.widget.R;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
/* loaded from: classes.dex */
public class KeyTrigger extends Key {
public static final int KEY_TYPE = 5;
static final String NAME = "KeyTrigger";
private static final String TAG = "KeyTrigger";
private Method mFireCross;
private float mFireLastPos;
private Method mFireNegativeCross;
private Method mFirePositiveCross;
private int mCurveFit = -1;
private String mCross = null;
private int mTriggerReceiver = UNSET;
private String mNegativeCross = null;
private String mPositiveCross = null;
private int mTriggerID = UNSET;
private int mTriggerCollisionId = UNSET;
private View mTriggerCollisionView = null;
float mTriggerSlack = 0.1f;
private boolean mFireCrossReset = true;
private boolean mFireNegativeReset = true;
private boolean mFirePositiveReset = true;
private float mFireThreshold = Float.NaN;
private boolean mPostLayout = false;
RectF mCollisionRect = new RectF();
RectF mTargetRect = new RectF();
@Override // androidx.constraintlayout.motion.widget.Key
public void addValues(HashMap<String, SplineSet> hashMap) {
}
@Override // androidx.constraintlayout.motion.widget.Key
public void getAttributeNames(HashSet<String> hashSet) {
}
int getCurveFit() {
return this.mCurveFit;
}
@Override // androidx.constraintlayout.motion.widget.Key
public void setValue(String str, Object obj) {
}
public KeyTrigger() {
this.mType = 5;
this.mCustomConstraints = new HashMap<>();
}
@Override // androidx.constraintlayout.motion.widget.Key
public void load(Context context, AttributeSet attributeSet) {
Loader.read(this, context.obtainStyledAttributes(attributeSet, R.styleable.KeyTrigger), context);
}
private void setUpRect(RectF rectF, View view, boolean z) {
rectF.top = view.getTop();
rectF.bottom = view.getBottom();
rectF.left = view.getLeft();
rectF.right = view.getRight();
if (z) {
view.getMatrix().mapRect(rectF);
}
}
/* JADX WARN: Removed duplicated region for block: B:100:0x00c9 */
/* JADX WARN: Removed duplicated region for block: B:104:0x00a1 */
/* JADX WARN: Removed duplicated region for block: B:86:0x008d */
/* JADX WARN: Removed duplicated region for block: B:93:0x00b6 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void conditionallyFire(float r11, android.view.View r12) {
/*
Method dump skipped, instructions count: 643
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: androidx.constraintlayout.motion.widget.KeyTrigger.conditionallyFire(float, android.view.View):void");
}
/* loaded from: classes.dex */
private static class Loader {
private static final int COLLISION = 9;
private static final int CROSS = 4;
private static final int FRAME_POS = 8;
private static final int NEGATIVE_CROSS = 1;
private static final int POSITIVE_CROSS = 2;
private static final int POST_LAYOUT = 10;
private static final int TARGET_ID = 7;
private static final int TRIGGER_ID = 6;
private static final int TRIGGER_RECEIVER = 11;
private static final int TRIGGER_SLACK = 5;
private static SparseIntArray mAttrMap;
private Loader() {
}
static {
SparseIntArray sparseIntArray = new SparseIntArray();
mAttrMap = sparseIntArray;
sparseIntArray.append(R.styleable.KeyTrigger_framePosition, 8);
mAttrMap.append(R.styleable.KeyTrigger_onCross, 4);
mAttrMap.append(R.styleable.KeyTrigger_onNegativeCross, 1);
mAttrMap.append(R.styleable.KeyTrigger_onPositiveCross, 2);
mAttrMap.append(R.styleable.KeyTrigger_motionTarget, 7);
mAttrMap.append(R.styleable.KeyTrigger_triggerId, 6);
mAttrMap.append(R.styleable.KeyTrigger_triggerSlack, 5);
mAttrMap.append(R.styleable.KeyTrigger_motion_triggerOnCollision, 9);
mAttrMap.append(R.styleable.KeyTrigger_motion_postLayoutCollision, 10);
mAttrMap.append(R.styleable.KeyTrigger_triggerReceiver, 11);
}
public static void read(KeyTrigger keyTrigger, TypedArray typedArray, Context context) {
int indexCount = typedArray.getIndexCount();
for (int i = 0; i < indexCount; i++) {
int index = typedArray.getIndex(i);
switch (mAttrMap.get(index)) {
case 1:
keyTrigger.mNegativeCross = typedArray.getString(index);
continue;
case 2:
keyTrigger.mPositiveCross = typedArray.getString(index);
continue;
case 4:
keyTrigger.mCross = typedArray.getString(index);
continue;
case 5:
keyTrigger.mTriggerSlack = typedArray.getFloat(index, keyTrigger.mTriggerSlack);
continue;
case 6:
keyTrigger.mTriggerID = typedArray.getResourceId(index, keyTrigger.mTriggerID);
continue;
case 7:
if (MotionLayout.IS_IN_EDIT_MODE) {
keyTrigger.mTargetId = typedArray.getResourceId(index, keyTrigger.mTargetId);
if (keyTrigger.mTargetId == -1) {
keyTrigger.mTargetString = typedArray.getString(index);
break;
} else {
continue;
}
} else if (typedArray.peekValue(index).type == 3) {
keyTrigger.mTargetString = typedArray.getString(index);
break;
} else {
keyTrigger.mTargetId = typedArray.getResourceId(index, keyTrigger.mTargetId);
break;
}
case 8:
keyTrigger.mFramePosition = typedArray.getInteger(index, keyTrigger.mFramePosition);
keyTrigger.mFireThreshold = (keyTrigger.mFramePosition + 0.5f) / 100.0f;
continue;
case 9:
keyTrigger.mTriggerCollisionId = typedArray.getResourceId(index, keyTrigger.mTriggerCollisionId);
continue;
case 10:
keyTrigger.mPostLayout = typedArray.getBoolean(index, keyTrigger.mPostLayout);
continue;
case 11:
keyTrigger.mTriggerReceiver = typedArray.getResourceId(index, keyTrigger.mTriggerReceiver);
break;
}
Log.e("KeyTrigger", "unused attribute 0x" + Integer.toHexString(index) + " " + mAttrMap.get(index));
}
}
}
}