2021-06-27 20:44:35 +00:00
|
|
|
package androidx.constraintlayout.motion.widget;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.res.TypedArray;
|
|
|
|
import android.content.res.XmlResourceParser;
|
|
|
|
import android.graphics.RectF;
|
|
|
|
import android.util.AttributeSet;
|
|
|
|
import android.util.Log;
|
|
|
|
import android.util.SparseArray;
|
|
|
|
import android.util.SparseIntArray;
|
|
|
|
import android.util.Xml;
|
|
|
|
import android.view.MotionEvent;
|
|
|
|
import android.view.View;
|
|
|
|
import android.view.animation.AccelerateDecelerateInterpolator;
|
|
|
|
import android.view.animation.AccelerateInterpolator;
|
|
|
|
import android.view.animation.AnimationUtils;
|
|
|
|
import android.view.animation.AnticipateInterpolator;
|
|
|
|
import android.view.animation.BounceInterpolator;
|
|
|
|
import android.view.animation.DecelerateInterpolator;
|
|
|
|
import android.view.animation.Interpolator;
|
|
|
|
import androidx.constraintlayout.motion.utils.Easing;
|
|
|
|
import androidx.constraintlayout.motion.widget.MotionLayout;
|
|
|
|
import androidx.constraintlayout.widget.ConstraintSet;
|
|
|
|
import androidx.constraintlayout.widget.R;
|
|
|
|
import androidx.constraintlayout.widget.StateSet;
|
|
|
|
import c.d.b.a.a;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
2021-08-10 10:47:20 +00:00
|
|
|
import com.discord.widgets.chat.input.autocomplete.AutocompleteViewModel;
|
2021-08-09 22:50:52 +00:00
|
|
|
import com.google.android.material.shadow.ShadowDrawableWrapper;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.PrintStream;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import org.xmlpull.v1.XmlPullParser;
|
|
|
|
import org.xmlpull.v1.XmlPullParserException;
|
|
|
|
public class MotionScene {
|
|
|
|
public static final int ANTICIPATE = 4;
|
|
|
|
public static final int BOUNCE = 5;
|
|
|
|
private static final boolean DEBUG = false;
|
|
|
|
public static final int EASE_IN = 1;
|
|
|
|
public static final int EASE_IN_OUT = 0;
|
|
|
|
public static final int EASE_OUT = 2;
|
|
|
|
private static final int INTERPOLATOR_REFRENCE_ID = -2;
|
|
|
|
public static final int LAYOUT_HONOR_REQUEST = 1;
|
|
|
|
public static final int LAYOUT_IGNORE_REQUEST = 0;
|
|
|
|
public static final int LINEAR = 3;
|
|
|
|
private static final int SPLINE_STRING = -1;
|
|
|
|
public static final String TAG = "MotionScene";
|
|
|
|
public static final int TRANSITION_BACKWARD = 0;
|
|
|
|
public static final int TRANSITION_FORWARD = 1;
|
|
|
|
public static final int UNSET = -1;
|
|
|
|
private boolean DEBUG_DESKTOP = false;
|
|
|
|
private ArrayList<Transition> mAbstractTransitionList = new ArrayList<>();
|
|
|
|
private HashMap<String, Integer> mConstraintSetIdMap = new HashMap<>();
|
|
|
|
private SparseArray<ConstraintSet> mConstraintSetMap = new SparseArray<>();
|
|
|
|
public Transition mCurrentTransition = null;
|
|
|
|
private int mDefaultDuration = 400;
|
|
|
|
private Transition mDefaultTransition = null;
|
|
|
|
private SparseIntArray mDeriveMap = new SparseIntArray();
|
|
|
|
private boolean mDisableAutoTransition = false;
|
|
|
|
private boolean mIgnoreTouch = false;
|
|
|
|
private MotionEvent mLastTouchDown;
|
|
|
|
public float mLastTouchX;
|
|
|
|
public float mLastTouchY;
|
|
|
|
private int mLayoutDuringTransition = 0;
|
|
|
|
private final MotionLayout mMotionLayout;
|
|
|
|
private boolean mMotionOutsideRegion = false;
|
|
|
|
private boolean mRtl;
|
|
|
|
public StateSet mStateSet = null;
|
|
|
|
private ArrayList<Transition> mTransitionList = new ArrayList<>();
|
|
|
|
private MotionLayout.MotionTracker mVelocityTracker;
|
|
|
|
|
|
|
|
/* renamed from: androidx.constraintlayout.motion.widget.MotionScene$1 reason: invalid class name */
|
|
|
|
public class AnonymousClass1 implements Interpolator {
|
|
|
|
public final /* synthetic */ Easing val$easing;
|
|
|
|
|
|
|
|
public AnonymousClass1(Easing easing) {
|
|
|
|
this.val$easing = easing;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.animation.TimeInterpolator
|
|
|
|
public float getInterpolation(float f) {
|
|
|
|
return (float) this.val$easing.get((double) f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class Transition {
|
|
|
|
public static final int AUTO_ANIMATE_TO_END = 4;
|
|
|
|
public static final int AUTO_ANIMATE_TO_START = 3;
|
|
|
|
public static final int AUTO_JUMP_TO_END = 2;
|
|
|
|
public static final int AUTO_JUMP_TO_START = 1;
|
|
|
|
public static final int AUTO_NONE = 0;
|
|
|
|
public static final int TRANSITION_FLAG_FIRST_DRAW = 1;
|
|
|
|
private int mAutoTransition = 0;
|
|
|
|
private int mConstraintSetEnd = -1;
|
|
|
|
private int mConstraintSetStart = -1;
|
|
|
|
private int mDefaultInterpolator = 0;
|
|
|
|
private int mDefaultInterpolatorID = -1;
|
|
|
|
private String mDefaultInterpolatorString = null;
|
|
|
|
private boolean mDisable = false;
|
|
|
|
private int mDuration = 400;
|
|
|
|
private int mId = -1;
|
|
|
|
private boolean mIsAbstract = false;
|
|
|
|
private ArrayList<KeyFrames> mKeyFramesList = new ArrayList<>();
|
|
|
|
private int mLayoutDuringTransition = 0;
|
|
|
|
private final MotionScene mMotionScene;
|
|
|
|
private ArrayList<TransitionOnClick> mOnClicks = new ArrayList<>();
|
|
|
|
private int mPathMotionArc = -1;
|
|
|
|
private float mStagger = 0.0f;
|
|
|
|
private TouchResponse mTouchResponse = null;
|
|
|
|
private int mTransitionFlags = 0;
|
|
|
|
|
|
|
|
public static class TransitionOnClick implements View.OnClickListener {
|
|
|
|
public static final int ANIM_TOGGLE = 17;
|
|
|
|
public static final int ANIM_TO_END = 1;
|
|
|
|
public static final int ANIM_TO_START = 16;
|
|
|
|
public static final int JUMP_TO_END = 256;
|
|
|
|
public static final int JUMP_TO_START = 4096;
|
|
|
|
public int mMode = 17;
|
|
|
|
public int mTargetId = -1;
|
|
|
|
private final Transition mTransition;
|
|
|
|
|
|
|
|
public TransitionOnClick(Context context, Transition transition, XmlPullParser xmlPullParser) {
|
|
|
|
this.mTransition = transition;
|
|
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlPullParser), R.styleable.OnClick);
|
|
|
|
int indexCount = obtainStyledAttributes.getIndexCount();
|
|
|
|
for (int i = 0; i < indexCount; i++) {
|
|
|
|
int index = obtainStyledAttributes.getIndex(i);
|
|
|
|
if (index == R.styleable.OnClick_targetId) {
|
|
|
|
this.mTargetId = obtainStyledAttributes.getResourceId(index, this.mTargetId);
|
|
|
|
} else if (index == R.styleable.OnClick_clickAction) {
|
|
|
|
this.mMode = obtainStyledAttributes.getInt(index, this.mMode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obtainStyledAttributes.recycle();
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
/* JADX WARNING: Unknown variable types count: 1 */
|
|
|
|
public void addOnClickListeners(MotionLayout motionLayout, int i, Transition transition) {
|
|
|
|
int i2 = this.mTargetId;
|
|
|
|
MotionLayout motionLayout2 = motionLayout;
|
|
|
|
if (i2 != -1) {
|
|
|
|
motionLayout2 = motionLayout.findViewById(i2);
|
|
|
|
}
|
|
|
|
if (motionLayout2 == null) {
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O = a.O("OnClick could not find id ");
|
|
|
|
O.append(this.mTargetId);
|
|
|
|
Log.e(MotionScene.TAG, O.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
int access$100 = Transition.access$100(transition);
|
|
|
|
int access$000 = Transition.access$000(transition);
|
|
|
|
if (access$100 == -1) {
|
|
|
|
motionLayout2.setOnClickListener(this);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
int i3 = this.mMode;
|
|
|
|
boolean z2 = false;
|
|
|
|
boolean z3 = ((i3 & 1) != 0 && i == access$100) | ((i3 & 1) != 0 && i == access$100) | ((i3 & 256) != 0 && i == access$100) | ((i3 & 16) != 0 && i == access$000);
|
|
|
|
if ((i3 & 4096) != 0 && i == access$000) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
if (z3 || z2) {
|
|
|
|
motionLayout2.setOnClickListener(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isTransitionViable(Transition transition, MotionLayout motionLayout) {
|
|
|
|
Transition transition2 = this.mTransition;
|
|
|
|
if (transition2 == transition) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
int access$000 = Transition.access$000(transition2);
|
|
|
|
int access$100 = Transition.access$100(this.mTransition);
|
|
|
|
if (access$100 == -1) {
|
|
|
|
return motionLayout.mCurrentState != access$000;
|
|
|
|
}
|
|
|
|
int i = motionLayout.mCurrentState;
|
|
|
|
return i == access$100 || i == access$000;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public void onClick(View view) {
|
|
|
|
MotionLayout access$800 = MotionScene.access$800(Transition.access$700(this.mTransition));
|
|
|
|
if (access$800.isInteractionEnabled()) {
|
|
|
|
if (Transition.access$100(this.mTransition) == -1) {
|
|
|
|
int currentState = access$800.getCurrentState();
|
|
|
|
if (currentState == -1) {
|
|
|
|
access$800.transitionToState(Transition.access$000(this.mTransition));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Transition transition = new Transition(Transition.access$700(this.mTransition), this.mTransition);
|
|
|
|
Transition.access$102(transition, currentState);
|
|
|
|
Transition.access$002(transition, Transition.access$000(this.mTransition));
|
|
|
|
access$800.setTransition(transition);
|
|
|
|
access$800.transitionToEnd();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Transition transition2 = Transition.access$700(this.mTransition).mCurrentTransition;
|
|
|
|
int i = this.mMode;
|
|
|
|
boolean z2 = false;
|
|
|
|
boolean z3 = ((i & 1) == 0 && (i & 256) == 0) ? false : true;
|
|
|
|
boolean z4 = ((i & 16) == 0 && (i & 4096) == 0) ? false : true;
|
|
|
|
if (z3 && z4) {
|
|
|
|
Transition transition3 = Transition.access$700(this.mTransition).mCurrentTransition;
|
|
|
|
Transition transition4 = this.mTransition;
|
|
|
|
if (transition3 != transition4) {
|
|
|
|
access$800.setTransition(transition4);
|
|
|
|
}
|
|
|
|
if (access$800.getCurrentState() != access$800.getEndState() && access$800.getProgress() <= 0.5f) {
|
|
|
|
z2 = z3;
|
|
|
|
z4 = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
z2 = z3;
|
|
|
|
}
|
|
|
|
if (!isTransitionViable(transition2, access$800)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (z2 && (this.mMode & 1) != 0) {
|
|
|
|
access$800.setTransition(this.mTransition);
|
|
|
|
access$800.transitionToEnd();
|
|
|
|
} else if (z4 && (this.mMode & 16) != 0) {
|
|
|
|
access$800.setTransition(this.mTransition);
|
|
|
|
access$800.transitionToStart();
|
|
|
|
} else if (z2 && (this.mMode & 256) != 0) {
|
|
|
|
access$800.setTransition(this.mTransition);
|
|
|
|
access$800.setProgress(1.0f);
|
|
|
|
} else if (z4 && (this.mMode & 4096) != 0) {
|
|
|
|
access$800.setTransition(this.mTransition);
|
|
|
|
access$800.setProgress(0.0f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void removeOnClickListeners(MotionLayout motionLayout) {
|
|
|
|
int i = this.mTargetId;
|
|
|
|
if (i != -1) {
|
|
|
|
View findViewById = motionLayout.findViewById(i);
|
|
|
|
if (findViewById == null) {
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O = a.O(" (*) could not find id ");
|
|
|
|
O.append(this.mTargetId);
|
|
|
|
Log.e(MotionScene.TAG, O.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
findViewById.setOnClickListener(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Transition(int i, MotionScene motionScene, int i2, int i3) {
|
|
|
|
this.mId = i;
|
|
|
|
this.mMotionScene = motionScene;
|
|
|
|
this.mConstraintSetStart = i2;
|
|
|
|
this.mConstraintSetEnd = i3;
|
|
|
|
this.mDuration = MotionScene.access$900(motionScene);
|
|
|
|
this.mLayoutDuringTransition = MotionScene.access$1000(motionScene);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Transition(MotionScene motionScene, Context context, XmlPullParser xmlPullParser) {
|
|
|
|
this.mDuration = MotionScene.access$900(motionScene);
|
|
|
|
this.mLayoutDuringTransition = MotionScene.access$1000(motionScene);
|
|
|
|
this.mMotionScene = motionScene;
|
|
|
|
fillFromAttributeList(motionScene, context, Xml.asAttributeSet(xmlPullParser));
|
|
|
|
}
|
|
|
|
|
|
|
|
public Transition(MotionScene motionScene, Transition transition) {
|
|
|
|
this.mMotionScene = motionScene;
|
|
|
|
if (transition != null) {
|
|
|
|
this.mPathMotionArc = transition.mPathMotionArc;
|
|
|
|
this.mDefaultInterpolator = transition.mDefaultInterpolator;
|
|
|
|
this.mDefaultInterpolatorString = transition.mDefaultInterpolatorString;
|
|
|
|
this.mDefaultInterpolatorID = transition.mDefaultInterpolatorID;
|
|
|
|
this.mDuration = transition.mDuration;
|
|
|
|
this.mKeyFramesList = transition.mKeyFramesList;
|
|
|
|
this.mStagger = transition.mStagger;
|
|
|
|
this.mLayoutDuringTransition = transition.mLayoutDuringTransition;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$000(Transition transition) {
|
|
|
|
return transition.mConstraintSetEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$002(Transition transition, int i) {
|
|
|
|
transition.mConstraintSetEnd = i;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$100(Transition transition) {
|
|
|
|
return transition.mConstraintSetStart;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$102(Transition transition, int i) {
|
|
|
|
transition.mConstraintSetStart = i;
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ boolean access$1200(Transition transition) {
|
|
|
|
return transition.mIsAbstract;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ ArrayList access$1300(Transition transition) {
|
|
|
|
return transition.mKeyFramesList;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$1400(Transition transition) {
|
|
|
|
return transition.mDefaultInterpolator;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ String access$1500(Transition transition) {
|
|
|
|
return transition.mDefaultInterpolatorString;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$1600(Transition transition) {
|
|
|
|
return transition.mDefaultInterpolatorID;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$1700(Transition transition) {
|
|
|
|
return transition.mDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$1800(Transition transition) {
|
|
|
|
return transition.mPathMotionArc;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ float access$1900(Transition transition) {
|
|
|
|
return transition.mStagger;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ TouchResponse access$200(Transition transition) {
|
|
|
|
return transition.mTouchResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ TouchResponse access$202(Transition transition, TouchResponse touchResponse) {
|
|
|
|
transition.mTouchResponse = touchResponse;
|
|
|
|
return touchResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$300(Transition transition) {
|
|
|
|
return transition.mId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ ArrayList access$400(Transition transition) {
|
|
|
|
return transition.mOnClicks;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ boolean access$500(Transition transition) {
|
|
|
|
return transition.mDisable;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$600(Transition transition) {
|
|
|
|
return transition.mAutoTransition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ MotionScene access$700(Transition transition) {
|
|
|
|
return transition.mMotionScene;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void fill(MotionScene motionScene, Context context, TypedArray typedArray) {
|
|
|
|
int indexCount = typedArray.getIndexCount();
|
|
|
|
for (int i = 0; i < indexCount; i++) {
|
|
|
|
int index = typedArray.getIndex(i);
|
|
|
|
if (index == R.styleable.Transition_constraintSetEnd) {
|
|
|
|
this.mConstraintSetEnd = typedArray.getResourceId(index, this.mConstraintSetEnd);
|
|
|
|
if ("layout".equals(context.getResources().getResourceTypeName(this.mConstraintSetEnd))) {
|
|
|
|
ConstraintSet constraintSet = new ConstraintSet();
|
|
|
|
constraintSet.load(context, this.mConstraintSetEnd);
|
|
|
|
MotionScene.access$1100(motionScene).append(this.mConstraintSetEnd, constraintSet);
|
|
|
|
}
|
|
|
|
} else if (index == R.styleable.Transition_constraintSetStart) {
|
|
|
|
this.mConstraintSetStart = typedArray.getResourceId(index, this.mConstraintSetStart);
|
|
|
|
if ("layout".equals(context.getResources().getResourceTypeName(this.mConstraintSetStart))) {
|
|
|
|
ConstraintSet constraintSet2 = new ConstraintSet();
|
|
|
|
constraintSet2.load(context, this.mConstraintSetStart);
|
|
|
|
MotionScene.access$1100(motionScene).append(this.mConstraintSetStart, constraintSet2);
|
|
|
|
}
|
|
|
|
} else if (index == R.styleable.Transition_motionInterpolator) {
|
|
|
|
int i2 = typedArray.peekValue(index).type;
|
|
|
|
if (i2 == 1) {
|
|
|
|
int resourceId = typedArray.getResourceId(index, -1);
|
|
|
|
this.mDefaultInterpolatorID = resourceId;
|
|
|
|
if (resourceId != -1) {
|
|
|
|
this.mDefaultInterpolator = -2;
|
|
|
|
}
|
|
|
|
} else if (i2 == 3) {
|
|
|
|
String string = typedArray.getString(index);
|
|
|
|
this.mDefaultInterpolatorString = string;
|
2021-08-10 10:47:20 +00:00
|
|
|
if (string.indexOf(AutocompleteViewModel.COMMAND_DISCOVER_TOKEN) > 0) {
|
2021-06-27 20:44:35 +00:00
|
|
|
this.mDefaultInterpolatorID = typedArray.getResourceId(index, -1);
|
|
|
|
this.mDefaultInterpolator = -2;
|
|
|
|
} else {
|
|
|
|
this.mDefaultInterpolator = -1;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.mDefaultInterpolator = typedArray.getInteger(index, this.mDefaultInterpolator);
|
|
|
|
}
|
|
|
|
} else if (index == R.styleable.Transition_duration) {
|
|
|
|
this.mDuration = typedArray.getInt(index, this.mDuration);
|
|
|
|
} else if (index == R.styleable.Transition_staggered) {
|
|
|
|
this.mStagger = typedArray.getFloat(index, this.mStagger);
|
|
|
|
} else if (index == R.styleable.Transition_autoTransition) {
|
|
|
|
this.mAutoTransition = typedArray.getInteger(index, this.mAutoTransition);
|
|
|
|
} else if (index == R.styleable.Transition_android_id) {
|
|
|
|
this.mId = typedArray.getResourceId(index, this.mId);
|
|
|
|
} else if (index == R.styleable.Transition_transitionDisable) {
|
|
|
|
this.mDisable = typedArray.getBoolean(index, this.mDisable);
|
|
|
|
} else if (index == R.styleable.Transition_pathMotionArc) {
|
|
|
|
this.mPathMotionArc = typedArray.getInteger(index, -1);
|
|
|
|
} else if (index == R.styleable.Transition_layoutDuringTransition) {
|
|
|
|
this.mLayoutDuringTransition = typedArray.getInteger(index, 0);
|
|
|
|
} else if (index == R.styleable.Transition_transitionFlags) {
|
|
|
|
this.mTransitionFlags = typedArray.getInteger(index, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (this.mConstraintSetStart == -1) {
|
|
|
|
this.mIsAbstract = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void fillFromAttributeList(MotionScene motionScene, Context context, AttributeSet attributeSet) {
|
|
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, R.styleable.Transition);
|
|
|
|
fill(motionScene, context, obtainStyledAttributes);
|
|
|
|
obtainStyledAttributes.recycle();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void addOnClick(Context context, XmlPullParser xmlPullParser) {
|
|
|
|
this.mOnClicks.add(new TransitionOnClick(context, this, xmlPullParser));
|
|
|
|
}
|
|
|
|
|
|
|
|
public String debugString(Context context) {
|
|
|
|
String resourceEntryName = this.mConstraintSetStart == -1 ? "null" : context.getResources().getResourceEntryName(this.mConstraintSetStart);
|
|
|
|
if (this.mConstraintSetEnd == -1) {
|
2021-08-31 07:21:49 +00:00
|
|
|
return a.u(resourceEntryName, " -> null");
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder S = a.S(resourceEntryName, " -> ");
|
|
|
|
S.append(context.getResources().getResourceEntryName(this.mConstraintSetEnd));
|
|
|
|
return S.toString();
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getAutoTransition() {
|
|
|
|
return this.mAutoTransition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getDuration() {
|
|
|
|
return this.mDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getEndConstraintSetId() {
|
|
|
|
return this.mConstraintSetEnd;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
|
|
|
return this.mId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<KeyFrames> getKeyFrameList() {
|
|
|
|
return this.mKeyFramesList;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getLayoutDuringTransition() {
|
|
|
|
return this.mLayoutDuringTransition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<TransitionOnClick> getOnClickList() {
|
|
|
|
return this.mOnClicks;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getPathMotionArc() {
|
|
|
|
return this.mPathMotionArc;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getStagger() {
|
|
|
|
return this.mStagger;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getStartConstraintSetId() {
|
|
|
|
return this.mConstraintSetStart;
|
|
|
|
}
|
|
|
|
|
|
|
|
public TouchResponse getTouchResponse() {
|
|
|
|
return this.mTouchResponse;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isEnabled() {
|
|
|
|
return !this.mDisable;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isTransitionFlag(int i) {
|
|
|
|
return (i & this.mTransitionFlags) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setAutoTransition(int i) {
|
|
|
|
this.mAutoTransition = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDuration(int i) {
|
|
|
|
this.mDuration = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setEnable(boolean z2) {
|
|
|
|
this.mDisable = !z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setPathMotionArc(int i) {
|
|
|
|
this.mPathMotionArc = i;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setStagger(float f) {
|
|
|
|
this.mStagger = f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public MotionScene(Context context, MotionLayout motionLayout, int i) {
|
|
|
|
this.mMotionLayout = motionLayout;
|
|
|
|
load(context, i);
|
|
|
|
SparseArray<ConstraintSet> sparseArray = this.mConstraintSetMap;
|
|
|
|
int i2 = R.id.motion_base;
|
|
|
|
sparseArray.put(i2, new ConstraintSet());
|
|
|
|
this.mConstraintSetIdMap.put("motion_base", Integer.valueOf(i2));
|
|
|
|
}
|
|
|
|
|
|
|
|
public MotionScene(MotionLayout motionLayout) {
|
|
|
|
this.mMotionLayout = motionLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$1000(MotionScene motionScene) {
|
|
|
|
return motionScene.mLayoutDuringTransition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ SparseArray access$1100(MotionScene motionScene) {
|
|
|
|
return motionScene.mConstraintSetMap;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ MotionLayout access$800(MotionScene motionScene) {
|
|
|
|
return motionScene.mMotionLayout;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static /* synthetic */ int access$900(MotionScene motionScene) {
|
|
|
|
return motionScene.mDefaultDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
private int getId(Context context, String str) {
|
|
|
|
int i;
|
2021-08-10 10:47:20 +00:00
|
|
|
if (str.contains(AutocompleteViewModel.COMMAND_DISCOVER_TOKEN)) {
|
2021-08-09 22:50:52 +00:00
|
|
|
i = context.getResources().getIdentifier(str.substring(str.indexOf(47) + 1), ModelAuditLogEntry.CHANGE_KEY_ID, context.getPackageName());
|
2021-06-27 20:44:35 +00:00
|
|
|
if (this.DEBUG_DESKTOP) {
|
|
|
|
PrintStream printStream = System.out;
|
|
|
|
printStream.println("id getMap res = " + i);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
i = -1;
|
|
|
|
}
|
|
|
|
if (i != -1) {
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
if (str.length() > 1) {
|
|
|
|
return Integer.parseInt(str.substring(1));
|
|
|
|
}
|
2021-08-09 22:50:52 +00:00
|
|
|
Log.e(TAG, "error in parsing id");
|
2021-06-27 20:44:35 +00:00
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
private int getIndex(Transition transition) {
|
|
|
|
int access$300 = Transition.access$300(transition);
|
|
|
|
if (access$300 != -1) {
|
|
|
|
for (int i = 0; i < this.mTransitionList.size(); i++) {
|
|
|
|
if (Transition.access$300(this.mTransitionList.get(i)) == access$300) {
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
throw new IllegalArgumentException("The transition must have an id");
|
|
|
|
}
|
|
|
|
|
|
|
|
private int getRealID(int i) {
|
|
|
|
int stateGetConstraintID;
|
|
|
|
StateSet stateSet = this.mStateSet;
|
|
|
|
return (stateSet == null || (stateGetConstraintID = stateSet.stateGetConstraintID(i, -1, -1)) == -1) ? i : stateGetConstraintID;
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean hasCycleDependency(int i) {
|
|
|
|
int i2 = this.mDeriveMap.get(i);
|
|
|
|
int size = this.mDeriveMap.size();
|
|
|
|
while (i2 > 0) {
|
|
|
|
if (i2 == i) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
int i3 = size - 1;
|
|
|
|
if (size < 0) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
i2 = this.mDeriveMap.get(i2);
|
|
|
|
size = i3;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
private boolean isProcessingTouch() {
|
|
|
|
return this.mVelocityTracker != null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:28:0x006d, code lost:
|
|
|
|
if (r2.equals("Transition") != false) goto L_0x0085;
|
|
|
|
*/
|
|
|
|
private void load(Context context, int i) {
|
|
|
|
XmlResourceParser xml = context.getResources().getXml(i);
|
|
|
|
Transition transition = null;
|
|
|
|
try {
|
|
|
|
int eventType = xml.getEventType();
|
|
|
|
while (true) {
|
|
|
|
char c2 = 1;
|
|
|
|
if (eventType != 1) {
|
|
|
|
if (eventType == 0) {
|
|
|
|
xml.getName();
|
|
|
|
} else if (eventType == 2) {
|
|
|
|
String name = xml.getName();
|
|
|
|
if (this.DEBUG_DESKTOP) {
|
|
|
|
PrintStream printStream = System.out;
|
|
|
|
printStream.println("parsing = " + name);
|
|
|
|
}
|
|
|
|
switch (name.hashCode()) {
|
|
|
|
case -1349929691:
|
|
|
|
if (name.equals("ConstraintSet")) {
|
|
|
|
c2 = 5;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
case -1239391468:
|
|
|
|
if (name.equals("KeyFrameSet")) {
|
|
|
|
c2 = 6;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
case 269306229:
|
|
|
|
break;
|
|
|
|
case 312750793:
|
|
|
|
if (name.equals("OnClick")) {
|
|
|
|
c2 = 3;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
case 327855227:
|
|
|
|
if (name.equals("OnSwipe")) {
|
|
|
|
c2 = 2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
case 793277014:
|
2021-08-09 22:50:52 +00:00
|
|
|
if (name.equals(TAG)) {
|
2021-06-27 20:44:35 +00:00
|
|
|
c2 = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
case 1382829617:
|
|
|
|
if (name.equals("StateSet")) {
|
|
|
|
c2 = 4;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
c2 = 65535;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
switch (c2) {
|
|
|
|
case 0:
|
|
|
|
parseMotionSceneTags(context, xml);
|
|
|
|
continue;
|
|
|
|
case 1:
|
|
|
|
ArrayList<Transition> arrayList = this.mTransitionList;
|
|
|
|
Transition transition2 = new Transition(this, context, xml);
|
|
|
|
arrayList.add(transition2);
|
|
|
|
if (this.mCurrentTransition == null && !Transition.access$1200(transition2)) {
|
|
|
|
this.mCurrentTransition = transition2;
|
|
|
|
if (Transition.access$200(transition2) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).setRTL(this.mRtl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Transition.access$1200(transition2)) {
|
|
|
|
if (Transition.access$000(transition2) == -1) {
|
|
|
|
this.mDefaultTransition = transition2;
|
|
|
|
} else {
|
|
|
|
this.mAbstractTransitionList.add(transition2);
|
|
|
|
}
|
|
|
|
this.mTransitionList.remove(transition2);
|
|
|
|
}
|
|
|
|
transition = transition2;
|
|
|
|
continue;
|
|
|
|
case 2:
|
|
|
|
if (transition == null) {
|
|
|
|
String resourceEntryName = context.getResources().getResourceEntryName(i);
|
|
|
|
int lineNumber = xml.getLineNumber();
|
2021-08-09 22:50:52 +00:00
|
|
|
Log.v(TAG, " OnSwipe (" + resourceEntryName + ".xml:" + lineNumber + ")");
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
Transition.access$202(transition, new TouchResponse(context, this.mMotionLayout, xml));
|
|
|
|
continue;
|
|
|
|
case 3:
|
|
|
|
transition.addOnClick(context, xml);
|
|
|
|
continue;
|
|
|
|
case 4:
|
|
|
|
this.mStateSet = new StateSet(context, xml);
|
|
|
|
continue;
|
|
|
|
case 5:
|
|
|
|
parseConstraintSet(context, xml);
|
|
|
|
continue;
|
|
|
|
case 6:
|
|
|
|
Transition.access$1300(transition).add(new KeyFrames(context, xml));
|
|
|
|
continue;
|
|
|
|
default:
|
2021-08-09 22:50:52 +00:00
|
|
|
Log.v(TAG, "WARNING UNKNOWN ATTRIBUTE " + name);
|
2021-06-27 20:44:35 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
eventType = xml.next();
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (XmlPullParserException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
} catch (IOException e2) {
|
|
|
|
e2.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void parseConstraintSet(Context context, XmlPullParser xmlPullParser) {
|
|
|
|
ConstraintSet constraintSet = new ConstraintSet();
|
|
|
|
constraintSet.setForceId(false);
|
|
|
|
int attributeCount = xmlPullParser.getAttributeCount();
|
|
|
|
int i = -1;
|
|
|
|
int i2 = -1;
|
|
|
|
for (int i3 = 0; i3 < attributeCount; i3++) {
|
|
|
|
String attributeName = xmlPullParser.getAttributeName(i3);
|
|
|
|
String attributeValue = xmlPullParser.getAttributeValue(i3);
|
|
|
|
if (this.DEBUG_DESKTOP) {
|
|
|
|
PrintStream printStream = System.out;
|
|
|
|
printStream.println("id string = " + attributeValue);
|
|
|
|
}
|
|
|
|
attributeName.hashCode();
|
|
|
|
if (attributeName.equals("deriveConstraintsFrom")) {
|
|
|
|
i2 = getId(context, attributeValue);
|
2021-08-09 22:50:52 +00:00
|
|
|
} else if (attributeName.equals(ModelAuditLogEntry.CHANGE_KEY_ID)) {
|
2021-06-27 20:44:35 +00:00
|
|
|
i = getId(context, attributeValue);
|
|
|
|
this.mConstraintSetIdMap.put(stripID(attributeValue), Integer.valueOf(i));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (i != -1) {
|
|
|
|
if (this.mMotionLayout.mDebugPath != 0) {
|
|
|
|
constraintSet.setValidateOnParse(true);
|
|
|
|
}
|
|
|
|
constraintSet.load(context, xmlPullParser);
|
|
|
|
if (i2 != -1) {
|
|
|
|
this.mDeriveMap.put(i, i2);
|
|
|
|
}
|
|
|
|
this.mConstraintSetMap.put(i, constraintSet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void parseMotionSceneTags(Context context, XmlPullParser xmlPullParser) {
|
|
|
|
TypedArray obtainStyledAttributes = context.obtainStyledAttributes(Xml.asAttributeSet(xmlPullParser), R.styleable.MotionScene);
|
|
|
|
int indexCount = obtainStyledAttributes.getIndexCount();
|
|
|
|
for (int i = 0; i < indexCount; i++) {
|
|
|
|
int index = obtainStyledAttributes.getIndex(i);
|
|
|
|
if (index == R.styleable.MotionScene_defaultDuration) {
|
|
|
|
this.mDefaultDuration = obtainStyledAttributes.getInt(index, this.mDefaultDuration);
|
|
|
|
} else if (index == R.styleable.MotionScene_layoutDuringTransition) {
|
|
|
|
this.mLayoutDuringTransition = obtainStyledAttributes.getInteger(index, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
obtainStyledAttributes.recycle();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void readConstraintChain(int i) {
|
|
|
|
int i2 = this.mDeriveMap.get(i);
|
|
|
|
if (i2 > 0) {
|
|
|
|
readConstraintChain(this.mDeriveMap.get(i));
|
|
|
|
ConstraintSet constraintSet = this.mConstraintSetMap.get(i);
|
|
|
|
ConstraintSet constraintSet2 = this.mConstraintSetMap.get(i2);
|
|
|
|
if (constraintSet2 == null) {
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O = a.O("ERROR! invalid deriveConstraintsFrom: @id/");
|
|
|
|
O.append(Debug.getName(this.mMotionLayout.getContext(), i2));
|
|
|
|
Log.e(TAG, O.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
constraintSet.readFallback(constraintSet2);
|
|
|
|
this.mDeriveMap.put(i, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String stripID(String str) {
|
|
|
|
if (str == null) {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
int indexOf = str.indexOf(47);
|
|
|
|
return indexOf < 0 ? str : str.substring(indexOf + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void addOnClickListeners(MotionLayout motionLayout, int i) {
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Transition next = it.next();
|
|
|
|
if (Transition.access$400(next).size() > 0) {
|
|
|
|
Iterator it2 = Transition.access$400(next).iterator();
|
|
|
|
while (it2.hasNext()) {
|
|
|
|
((Transition.TransitionOnClick) it2.next()).removeOnClickListeners(motionLayout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Iterator<Transition> it3 = this.mAbstractTransitionList.iterator();
|
|
|
|
while (it3.hasNext()) {
|
|
|
|
Transition next2 = it3.next();
|
|
|
|
if (Transition.access$400(next2).size() > 0) {
|
|
|
|
Iterator it4 = Transition.access$400(next2).iterator();
|
|
|
|
while (it4.hasNext()) {
|
|
|
|
((Transition.TransitionOnClick) it4.next()).removeOnClickListeners(motionLayout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Iterator<Transition> it5 = this.mTransitionList.iterator();
|
|
|
|
while (it5.hasNext()) {
|
|
|
|
Transition next3 = it5.next();
|
|
|
|
if (Transition.access$400(next3).size() > 0) {
|
|
|
|
Iterator it6 = Transition.access$400(next3).iterator();
|
|
|
|
while (it6.hasNext()) {
|
|
|
|
((Transition.TransitionOnClick) it6.next()).addOnClickListeners(motionLayout, i, next3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Iterator<Transition> it7 = this.mAbstractTransitionList.iterator();
|
|
|
|
while (it7.hasNext()) {
|
|
|
|
Transition next4 = it7.next();
|
|
|
|
if (Transition.access$400(next4).size() > 0) {
|
|
|
|
Iterator it8 = Transition.access$400(next4).iterator();
|
|
|
|
while (it8.hasNext()) {
|
|
|
|
((Transition.TransitionOnClick) it8.next()).addOnClickListeners(motionLayout, i, next4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void addTransition(Transition transition) {
|
|
|
|
int index = getIndex(transition);
|
|
|
|
if (index == -1) {
|
|
|
|
this.mTransitionList.add(transition);
|
|
|
|
} else {
|
|
|
|
this.mTransitionList.set(index, transition);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean autoTransition(MotionLayout motionLayout, int i) {
|
|
|
|
if (isProcessingTouch() || this.mDisableAutoTransition) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Transition next = it.next();
|
|
|
|
if (!(Transition.access$600(next) == 0 || this.mCurrentTransition == next)) {
|
|
|
|
if (i == Transition.access$100(next) && (Transition.access$600(next) == 4 || Transition.access$600(next) == 2)) {
|
|
|
|
MotionLayout.TransitionState transitionState = MotionLayout.TransitionState.FINISHED;
|
|
|
|
motionLayout.setState(transitionState);
|
|
|
|
motionLayout.setTransition(next);
|
|
|
|
if (Transition.access$600(next) == 4) {
|
|
|
|
motionLayout.transitionToEnd();
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.SETUP);
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.MOVING);
|
|
|
|
} else {
|
|
|
|
motionLayout.setProgress(1.0f);
|
|
|
|
motionLayout.evaluate(true);
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.SETUP);
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.MOVING);
|
|
|
|
motionLayout.setState(transitionState);
|
|
|
|
motionLayout.onNewStateAttachHandlers();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
} else if (i == Transition.access$000(next) && (Transition.access$600(next) == 3 || Transition.access$600(next) == 1)) {
|
|
|
|
MotionLayout.TransitionState transitionState2 = MotionLayout.TransitionState.FINISHED;
|
|
|
|
motionLayout.setState(transitionState2);
|
|
|
|
motionLayout.setTransition(next);
|
|
|
|
if (Transition.access$600(next) == 3) {
|
|
|
|
motionLayout.transitionToStart();
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.SETUP);
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.MOVING);
|
|
|
|
} else {
|
|
|
|
motionLayout.setProgress(0.0f);
|
|
|
|
motionLayout.evaluate(true);
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.SETUP);
|
|
|
|
motionLayout.setState(MotionLayout.TransitionState.MOVING);
|
|
|
|
motionLayout.setState(transitionState2);
|
|
|
|
motionLayout.onNewStateAttachHandlers();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Transition bestTransitionFor(int i, float f, float f2, MotionEvent motionEvent) {
|
|
|
|
if (i == -1) {
|
|
|
|
return this.mCurrentTransition;
|
|
|
|
}
|
|
|
|
List<Transition> transitionsWithState = getTransitionsWithState(i);
|
|
|
|
float f3 = 0.0f;
|
|
|
|
Transition transition = null;
|
|
|
|
RectF rectF = new RectF();
|
|
|
|
for (Transition transition2 : transitionsWithState) {
|
|
|
|
if (!Transition.access$500(transition2) && Transition.access$200(transition2) != null) {
|
|
|
|
Transition.access$200(transition2).setRTL(this.mRtl);
|
|
|
|
RectF touchRegion = Transition.access$200(transition2).getTouchRegion(this.mMotionLayout, rectF);
|
|
|
|
if (touchRegion == null || motionEvent == null || touchRegion.contains(motionEvent.getX(), motionEvent.getY())) {
|
|
|
|
RectF touchRegion2 = Transition.access$200(transition2).getTouchRegion(this.mMotionLayout, rectF);
|
|
|
|
if (touchRegion2 == null || motionEvent == null || touchRegion2.contains(motionEvent.getX(), motionEvent.getY())) {
|
|
|
|
float dot = Transition.access$200(transition2).dot(f, f2) * (Transition.access$000(transition2) == i ? -1.0f : 1.1f);
|
|
|
|
if (dot > f3) {
|
|
|
|
transition = transition2;
|
|
|
|
f3 = dot;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return transition;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void disableAutoTransition(boolean z2) {
|
|
|
|
this.mDisableAutoTransition = z2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int gatPathMotionArc() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null) {
|
|
|
|
return Transition.access$1800(transition);
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintSet getConstraintSet(int i) {
|
|
|
|
return getConstraintSet(i, -1, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintSet getConstraintSet(int i, int i2, int i3) {
|
|
|
|
int stateGetConstraintID;
|
|
|
|
if (this.DEBUG_DESKTOP) {
|
|
|
|
PrintStream printStream = System.out;
|
|
|
|
printStream.println("id " + i);
|
|
|
|
PrintStream printStream2 = System.out;
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O = a.O("size ");
|
|
|
|
O.append(this.mConstraintSetMap.size());
|
|
|
|
printStream2.println(O.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
StateSet stateSet = this.mStateSet;
|
|
|
|
if (!(stateSet == null || (stateGetConstraintID = stateSet.stateGetConstraintID(i, i2, i3)) == -1)) {
|
|
|
|
i = stateGetConstraintID;
|
|
|
|
}
|
|
|
|
if (this.mConstraintSetMap.get(i) != null) {
|
|
|
|
return this.mConstraintSetMap.get(i);
|
|
|
|
}
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O2 = a.O("Warning could not find ConstraintSet id/");
|
|
|
|
O2.append(Debug.getName(this.mMotionLayout.getContext(), i));
|
|
|
|
O2.append(" In MotionScene");
|
|
|
|
Log.e(TAG, O2.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
SparseArray<ConstraintSet> sparseArray = this.mConstraintSetMap;
|
|
|
|
return sparseArray.get(sparseArray.keyAt(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
public ConstraintSet getConstraintSet(Context context, String str) {
|
|
|
|
if (this.DEBUG_DESKTOP) {
|
|
|
|
PrintStream printStream = System.out;
|
|
|
|
printStream.println("id " + str);
|
|
|
|
PrintStream printStream2 = System.out;
|
2021-10-11 07:48:45 +00:00
|
|
|
StringBuilder O = a.O("size ");
|
|
|
|
O.append(this.mConstraintSetMap.size());
|
|
|
|
printStream2.println(O.toString());
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
for (int i = 0; i < this.mConstraintSetMap.size(); i++) {
|
|
|
|
int keyAt = this.mConstraintSetMap.keyAt(i);
|
|
|
|
String resourceName = context.getResources().getResourceName(keyAt);
|
|
|
|
if (this.DEBUG_DESKTOP) {
|
|
|
|
PrintStream printStream3 = System.out;
|
|
|
|
printStream3.println("Id for <" + i + "> is <" + resourceName + "> looking for <" + str + ">");
|
|
|
|
}
|
|
|
|
if (str.equals(resourceName)) {
|
|
|
|
return this.mConstraintSetMap.get(keyAt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int[] getConstraintSetIds() {
|
|
|
|
int size = this.mConstraintSetMap.size();
|
|
|
|
int[] iArr = new int[size];
|
|
|
|
for (int i = 0; i < size; i++) {
|
|
|
|
iArr[i] = this.mConstraintSetMap.keyAt(i);
|
|
|
|
}
|
|
|
|
return iArr;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ArrayList<Transition> getDefinedTransitions() {
|
|
|
|
return this.mTransitionList;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getDuration() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
return transition != null ? Transition.access$1700(transition) : this.mDefaultDuration;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getEndId() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return Transition.access$000(transition);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Interpolator getInterpolator() {
|
|
|
|
int access$1400 = Transition.access$1400(this.mCurrentTransition);
|
|
|
|
if (access$1400 == -2) {
|
|
|
|
return AnimationUtils.loadInterpolator(this.mMotionLayout.getContext(), Transition.access$1600(this.mCurrentTransition));
|
|
|
|
}
|
|
|
|
if (access$1400 == -1) {
|
|
|
|
return new AnonymousClass1(Easing.getInterpolator(Transition.access$1500(this.mCurrentTransition)));
|
|
|
|
}
|
|
|
|
if (access$1400 == 0) {
|
|
|
|
return new AccelerateDecelerateInterpolator();
|
|
|
|
}
|
|
|
|
if (access$1400 == 1) {
|
|
|
|
return new AccelerateInterpolator();
|
|
|
|
}
|
|
|
|
if (access$1400 == 2) {
|
|
|
|
return new DecelerateInterpolator();
|
|
|
|
}
|
|
|
|
if (access$1400 == 4) {
|
|
|
|
return new AnticipateInterpolator();
|
|
|
|
}
|
|
|
|
if (access$1400 != 5) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return new BounceInterpolator();
|
|
|
|
}
|
|
|
|
|
|
|
|
public Key getKeyFrame(Context context, int i, int i2, int i3) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
Iterator it = Transition.access$1300(transition).iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
KeyFrames keyFrames = (KeyFrames) it.next();
|
|
|
|
Iterator<Integer> it2 = keyFrames.getKeys().iterator();
|
|
|
|
while (true) {
|
|
|
|
if (it2.hasNext()) {
|
|
|
|
Integer next = it2.next();
|
|
|
|
if (i2 == next.intValue()) {
|
|
|
|
Iterator<Key> it3 = keyFrames.getKeyFramesForView(next.intValue()).iterator();
|
|
|
|
while (it3.hasNext()) {
|
|
|
|
Key next2 = it3.next();
|
|
|
|
if (next2.mFramePosition == i3 && next2.mType == i) {
|
|
|
|
return next2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void getKeyFrames(MotionController motionController) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null) {
|
|
|
|
Transition transition2 = this.mDefaultTransition;
|
|
|
|
if (transition2 != null) {
|
|
|
|
Iterator it = Transition.access$1300(transition2).iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
((KeyFrames) it.next()).addFrames(motionController);
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Iterator it2 = Transition.access$1300(transition).iterator();
|
|
|
|
while (it2.hasNext()) {
|
|
|
|
((KeyFrames) it2.next()).addFrames(motionController);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getMaxAcceleration() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null || Transition.access$200(transition) == null) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
return Transition.access$200(this.mCurrentTransition).getMaxAcceleration();
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getMaxVelocity() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null || Transition.access$200(transition) == null) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
return Transition.access$200(this.mCurrentTransition).getMaxVelocity();
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean getMoveWhenScrollAtTop() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null || Transition.access$200(transition) == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return Transition.access$200(this.mCurrentTransition).getMoveWhenScrollAtTop();
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getPathPercent(View view, int i) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getProgressDirection(float f, float f2) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null || Transition.access$200(transition) == null) {
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
return Transition.access$200(this.mCurrentTransition).getProgressDirection(f, f2);
|
|
|
|
}
|
|
|
|
|
|
|
|
public float getStaggered() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null) {
|
|
|
|
return Transition.access$1900(transition);
|
|
|
|
}
|
|
|
|
return 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getStartId() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return Transition.access$100(transition);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Transition getTransitionById(int i) {
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Transition next = it.next();
|
|
|
|
if (Transition.access$300(next) == i) {
|
|
|
|
return next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getTransitionDirection(int i) {
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
if (Transition.access$100(it.next()) == i) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<Transition> getTransitionsWithState(int i) {
|
|
|
|
int realID = getRealID(i);
|
|
|
|
ArrayList arrayList = new ArrayList();
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Transition next = it.next();
|
|
|
|
if (Transition.access$100(next) == realID || Transition.access$000(next) == realID) {
|
|
|
|
arrayList.add(next);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return arrayList;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean hasKeyFramePosition(View view, int i) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Iterator it = Transition.access$1300(transition).iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Iterator<Key> it2 = ((KeyFrames) it.next()).getKeyFramesForView(view.getId()).iterator();
|
|
|
|
while (true) {
|
|
|
|
if (it2.hasNext()) {
|
|
|
|
if (it2.next().mFramePosition == i) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int lookUpConstraintId(String str) {
|
|
|
|
return this.mConstraintSetIdMap.get(str).intValue();
|
|
|
|
}
|
|
|
|
|
|
|
|
public String lookUpConstraintName(int i) {
|
|
|
|
for (Map.Entry<String, Integer> entry : this.mConstraintSetIdMap.entrySet()) {
|
|
|
|
if (entry.getValue().intValue() == i) {
|
|
|
|
return entry.getKey();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onLayout(boolean z2, int i, int i2, int i3, int i4) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public void processScrollMove(float f, float f2) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null && Transition.access$200(transition) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).scrollMove(f, f2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void processScrollUp(float f, float f2) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null && Transition.access$200(transition) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).scrollUp(f, f2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void processTouchEvent(MotionEvent motionEvent, int i, MotionLayout motionLayout) {
|
|
|
|
MotionLayout.MotionTracker motionTracker;
|
|
|
|
MotionEvent motionEvent2;
|
|
|
|
RectF rectF = new RectF();
|
|
|
|
if (this.mVelocityTracker == null) {
|
|
|
|
this.mVelocityTracker = this.mMotionLayout.obtainVelocityTracker();
|
|
|
|
}
|
|
|
|
this.mVelocityTracker.addMovement(motionEvent);
|
|
|
|
if (i != -1) {
|
|
|
|
int action = motionEvent.getAction();
|
|
|
|
boolean z2 = false;
|
|
|
|
if (action == 0) {
|
|
|
|
this.mLastTouchX = motionEvent.getRawX();
|
|
|
|
this.mLastTouchY = motionEvent.getRawY();
|
|
|
|
this.mLastTouchDown = motionEvent;
|
|
|
|
this.mIgnoreTouch = false;
|
|
|
|
if (Transition.access$200(this.mCurrentTransition) != null) {
|
|
|
|
RectF limitBoundsTo = Transition.access$200(this.mCurrentTransition).getLimitBoundsTo(this.mMotionLayout, rectF);
|
|
|
|
if (limitBoundsTo == null || limitBoundsTo.contains(this.mLastTouchDown.getX(), this.mLastTouchDown.getY())) {
|
|
|
|
RectF touchRegion = Transition.access$200(this.mCurrentTransition).getTouchRegion(this.mMotionLayout, rectF);
|
|
|
|
if (touchRegion == null || touchRegion.contains(this.mLastTouchDown.getX(), this.mLastTouchDown.getY())) {
|
|
|
|
this.mMotionOutsideRegion = false;
|
|
|
|
} else {
|
|
|
|
this.mMotionOutsideRegion = true;
|
|
|
|
}
|
|
|
|
Transition.access$200(this.mCurrentTransition).setDown(this.mLastTouchX, this.mLastTouchY);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this.mLastTouchDown = null;
|
|
|
|
this.mIgnoreTouch = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
} else if (action == 2 && !this.mIgnoreTouch) {
|
|
|
|
float rawY = motionEvent.getRawY() - this.mLastTouchY;
|
|
|
|
float rawX = motionEvent.getRawX() - this.mLastTouchX;
|
2021-08-09 22:50:52 +00:00
|
|
|
if ((((double) rawX) != ShadowDrawableWrapper.COS_45 || ((double) rawY) != ShadowDrawableWrapper.COS_45) && (motionEvent2 = this.mLastTouchDown) != null) {
|
2021-06-27 20:44:35 +00:00
|
|
|
Transition bestTransitionFor = bestTransitionFor(i, rawX, rawY, motionEvent2);
|
|
|
|
if (bestTransitionFor != null) {
|
|
|
|
motionLayout.setTransition(bestTransitionFor);
|
|
|
|
RectF touchRegion2 = Transition.access$200(this.mCurrentTransition).getTouchRegion(this.mMotionLayout, rectF);
|
|
|
|
if (touchRegion2 != null && !touchRegion2.contains(this.mLastTouchDown.getX(), this.mLastTouchDown.getY())) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
this.mMotionOutsideRegion = z2;
|
|
|
|
Transition.access$200(this.mCurrentTransition).setUpTouchEvent(this.mLastTouchX, this.mLastTouchY);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!this.mIgnoreTouch) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (!(transition == null || Transition.access$200(transition) == null || this.mMotionOutsideRegion)) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).processTouchEvent(motionEvent, this.mVelocityTracker, i, this);
|
|
|
|
}
|
|
|
|
this.mLastTouchX = motionEvent.getRawX();
|
|
|
|
this.mLastTouchY = motionEvent.getRawY();
|
|
|
|
if (motionEvent.getAction() == 1 && (motionTracker = this.mVelocityTracker) != null) {
|
|
|
|
motionTracker.recycle();
|
|
|
|
this.mVelocityTracker = null;
|
|
|
|
int i2 = motionLayout.mCurrentState;
|
|
|
|
if (i2 != -1) {
|
|
|
|
autoTransition(motionLayout, i2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void readFallback(MotionLayout motionLayout) {
|
|
|
|
for (int i = 0; i < this.mConstraintSetMap.size(); i++) {
|
|
|
|
int keyAt = this.mConstraintSetMap.keyAt(i);
|
|
|
|
if (hasCycleDependency(keyAt)) {
|
2021-08-09 22:50:52 +00:00
|
|
|
Log.e(TAG, "Cannot be derived from yourself");
|
2021-06-27 20:44:35 +00:00
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
readConstraintChain(keyAt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int i2 = 0; i2 < this.mConstraintSetMap.size(); i2++) {
|
|
|
|
this.mConstraintSetMap.valueAt(i2).readFallback(motionLayout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void removeTransition(Transition transition) {
|
|
|
|
int index = getIndex(transition);
|
|
|
|
if (index != -1) {
|
|
|
|
this.mTransitionList.remove(index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setConstraintSet(int i, ConstraintSet constraintSet) {
|
|
|
|
this.mConstraintSetMap.put(i, constraintSet);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setDuration(int i) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null) {
|
|
|
|
transition.setDuration(i);
|
|
|
|
} else {
|
|
|
|
this.mDefaultDuration = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setKeyframe(View view, int i, String str, Object obj) {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null) {
|
|
|
|
Iterator it = Transition.access$1300(transition).iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Iterator<Key> it2 = ((KeyFrames) it.next()).getKeyFramesForView(view.getId()).iterator();
|
|
|
|
while (it2.hasNext()) {
|
|
|
|
if (it2.next().mFramePosition == i) {
|
|
|
|
int i2 = ((obj != null ? ((Float) obj).floatValue() : 0.0f) > 0.0f ? 1 : ((obj != null ? ((Float) obj).floatValue() : 0.0f) == 0.0f ? 0 : -1));
|
|
|
|
str.equalsIgnoreCase("app:PerpendicularPath_percent");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRtl(boolean z2) {
|
|
|
|
this.mRtl = z2;
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null && Transition.access$200(transition) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).setRTL(this.mRtl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Code restructure failed: missing block: B:6:0x0013, code lost:
|
|
|
|
if (r2 != -1) goto L_0x0018;
|
|
|
|
*/
|
|
|
|
public void setTransition(int i, int i2) {
|
|
|
|
int i3;
|
|
|
|
int i4;
|
|
|
|
StateSet stateSet = this.mStateSet;
|
|
|
|
if (stateSet != null) {
|
|
|
|
i4 = stateSet.stateGetConstraintID(i, -1, -1);
|
|
|
|
if (i4 == -1) {
|
|
|
|
i4 = i;
|
|
|
|
}
|
|
|
|
i3 = this.mStateSet.stateGetConstraintID(i2, -1, -1);
|
|
|
|
} else {
|
|
|
|
i4 = i;
|
|
|
|
}
|
|
|
|
i3 = i2;
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Transition next = it.next();
|
|
|
|
if ((Transition.access$000(next) == i3 && Transition.access$100(next) == i4) || (Transition.access$000(next) == i2 && Transition.access$100(next) == i)) {
|
|
|
|
this.mCurrentTransition = next;
|
|
|
|
if (next != null && Transition.access$200(next) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).setRTL(this.mRtl);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Transition transition = this.mDefaultTransition;
|
|
|
|
Iterator<Transition> it2 = this.mAbstractTransitionList.iterator();
|
|
|
|
while (it2.hasNext()) {
|
|
|
|
Transition next2 = it2.next();
|
|
|
|
if (Transition.access$000(next2) == i2) {
|
|
|
|
transition = next2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Transition transition2 = new Transition(this, transition);
|
|
|
|
Transition.access$102(transition2, i4);
|
|
|
|
Transition.access$002(transition2, i3);
|
|
|
|
if (i4 != -1) {
|
|
|
|
this.mTransitionList.add(transition2);
|
|
|
|
}
|
|
|
|
this.mCurrentTransition = transition2;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTransition(Transition transition) {
|
|
|
|
this.mCurrentTransition = transition;
|
|
|
|
if (transition != null && Transition.access$200(transition) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).setRTL(this.mRtl);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setupTouch() {
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
if (transition != null && Transition.access$200(transition) != null) {
|
|
|
|
Transition.access$200(this.mCurrentTransition).setupTouch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean supportTouch() {
|
|
|
|
Iterator<Transition> it = this.mTransitionList.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
if (Transition.access$200(it.next()) != null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Transition transition = this.mCurrentTransition;
|
|
|
|
return (transition == null || Transition.access$200(transition) == null) ? false : true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean validateLayout(MotionLayout motionLayout) {
|
|
|
|
return motionLayout == this.mMotionLayout && motionLayout.mScene == this;
|
|
|
|
}
|
|
|
|
}
|