Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 18bb237

Browse files
committed
resolve comments
1 parent ac115c4 commit 18bb237

File tree

3 files changed

+12
-24
lines changed

3 files changed

+12
-24
lines changed

constraintlayout/core/src/main/java/androidx/constraintlayout/core/motion/Motion.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import androidx.constraintlayout.core.motion.utils.KeyCache;
3232
import androidx.constraintlayout.core.motion.utils.KeyCycleOscillator;
3333
import androidx.constraintlayout.core.motion.utils.KeyFrameArray;
34-
import androidx.constraintlayout.core.motion.utils.NonNull;
3534
import androidx.constraintlayout.core.motion.utils.Nullable;
3635
import androidx.constraintlayout.core.motion.utils.Rect;
3736
import androidx.constraintlayout.core.motion.utils.SplineSet;
@@ -250,6 +249,7 @@ public String getAnimateRelativeTo() {
250249
public void setupRelative(Motion motionController) {
251250
mRelativeMotion = motionController;
252251
}
252+
253253
private void setupRelative() {
254254
if (mRelativeMotion == null) {
255255
return;
@@ -1734,9 +1734,9 @@ public boolean setValue(int id, String value) {
17341734
mQuantizeMotionInterpolator = getInterpolator(SPLINE_STRING, value, 0);
17351735
return true;
17361736
}
1737-
if ( MotionType.TYPE_ANIMATE_RELATIVE_TO == id) {
1738-
mStartMotionPath.mAnimateRelativeTo = value;
1739-
return true;
1737+
if (MotionType.TYPE_ANIMATE_RELATIVE_TO == id) {
1738+
mStartMotionPath.mAnimateRelativeTo = value;
1739+
return true;
17401740
}
17411741
return false;
17421742
}

constraintlayout/core/src/main/java/androidx/constraintlayout/core/motion/MotionPaths.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,7 @@ void initPolar(int parentWidth,
158158
mHeight = (int) (s.mHeight + scaleY * scaleHeight);
159159
float startfactor = 1 - position;
160160
float endfactor = position;
161-
Utils.log(mId+": start "+s.mX+","+s.mY);
162-
Utils.log(mId+": end "+e.mX+","+e.mY);
163-
Utils.log(mId+": mAnimateRelativeTo "+e.mAnimateRelativeTo);
161+
164162
switch (c.mPositionType) {
165163
case MotionKeyPosition.TYPE_SCREEN:
166164
this.mX = Float.isNaN(c.mPercentX) ? (position * (e.mX - s.mX) + s.mX)

constraintlayout/core/src/main/java/androidx/constraintlayout/core/state/Transition.java

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -705,33 +705,23 @@ public void addCustomColor(int state, String widgetId, String property, int colo
705705
}
706706

707707
/**
708-
* @TODO: add description
708+
* Update container of parameters for the state
709+
* @param container contains all the widget parameters
710+
* @param state starting or ending
709711
*/
710712
public void updateFrom(ConstraintWidgetContainer container, int state) {
711713
final ArrayList<ConstraintWidget> children = container.getChildren();
712714
final int count = children.size();
713-
WidgetState [] states = new WidgetState[count];
714-
boolean relative = false;
715+
WidgetState[] states = new WidgetState[count];
716+
715717
for (int i = 0; i < count; i++) {
716718
ConstraintWidget child = children.get(i);
717719
WidgetState widgetState = getWidgetState(child.stringId, null, state);
718720
states[i] = widgetState;
719721
widgetState.update(child, state);
720-
String id = widgetState.getPathRelativeId();
722+
String id = widgetState.getPathRelativeId();
721723
if (id != null) {
722-
relative = true;
723-
}
724-
}
725-
if (relative) {
726-
for (int i = 0; i < count; i++) {
727-
ConstraintWidget child = children.get(i);
728-
WidgetState widgetState = getWidgetState(child.stringId, null, state);
729-
states[i] = widgetState;
730-
String id = widgetState.getPathRelativeId();
731-
if (id != null) {
732-
widgetState.setPathRelative(getWidgetState(id, null, state));
733-
734-
}
724+
widgetState.setPathRelative(getWidgetState(id, null, state));
735725
}
736726
}
737727

0 commit comments

Comments
 (0)