File tree 1 file changed +3
-3
lines changed
app/src/main/java/home/smart/fly/animationdemo/property
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ private void addToCarAnimation(ImageView goodsImg) {
84
84
int carLocation [] = new int [2 ];
85
85
carImage .getLocationInWindow (carLocation );
86
86
//
87
- // 起始点:图片起始点-父布局起始点+该商品图片的一半-图片的marginTop & marginLeft 的值
87
+ // 起始点:图片起始点-父布局起始点+该商品图片的一半-图片的marginTop || marginLeft 的值
88
88
float startX = animImgLocation [0 ] - shellLocation [0 ] + goodsImg .getWidth () / 2 - DpConvert .dip2px (mContext , 10.0f );
89
89
float startY = animImgLocation [1 ] - shellLocation [1 ] + goodsImg .getHeight () / 2 - DpConvert .dip2px (mContext , 10.0f );
90
90
@@ -115,8 +115,8 @@ public void onAnimationUpdate(ValueAnimator animation) {
115
115
// 这里这个值是中间过程中的曲线长度(下面根据这个值来得出中间点的坐标值)
116
116
float value = (Float ) animation .getAnimatedValue ();
117
117
// 获取当前点坐标封装到mCurrentPosition
118
- // boolean getPosTan(float distance, float[] pos, float[] tan) :
119
- // 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距离的坐标点和切线, pos会自动填充上坐标,这个方法很重要。
118
+ // 传入一个距离distance(0<= distance<=getLength()),然后会计算当前距离的坐标点和切线,
119
+ // pos会自动填充上坐标,这个方法很重要。
120
120
// mCurrentPosition此时就是中间距离点的坐标值
121
121
mPathMeasure .getPosTan (value , mCurrentPosition , null );
122
122
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标
You can’t perform that action at this time.
0 commit comments