Skip to content

Commit 5683076

Browse files
committed
last change
1 parent 25ae93c commit 5683076

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/home/smart/fly/animationdemo/property/ShopCarAddAnimActivity.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private void addToCarAnimation(ImageView goodsImg) {
8484
int carLocation[] = new int[2];
8585
carImage.getLocationInWindow(carLocation);
8686
//
87-
// 起始点:图片起始点-父布局起始点+该商品图片的一半-图片的marginTop & marginLeft 的值
87+
// 起始点:图片起始点-父布局起始点+该商品图片的一半-图片的marginTop || marginLeft 的值
8888
float startX = animImgLocation[0] - shellLocation[0] + goodsImg.getWidth() / 2 - DpConvert.dip2px(mContext, 10.0f);
8989
float startY = animImgLocation[1] - shellLocation[1] + goodsImg.getHeight() / 2 - DpConvert.dip2px(mContext, 10.0f);
9090

@@ -115,8 +115,8 @@ public void onAnimationUpdate(ValueAnimator animation) {
115115
// 这里这个值是中间过程中的曲线长度(下面根据这个值来得出中间点的坐标值)
116116
float value = (Float) animation.getAnimatedValue();
117117
// 获取当前点坐标封装到mCurrentPosition
118-
// boolean getPosTan(float distance, float[] pos, float[] tan) :
119-
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。
118+
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距离的坐标点和切线,
119+
// pos会自动填充上坐标,这个方法很重要。
120120
// mCurrentPosition此时就是中间距离点的坐标值
121121
mPathMeasure.getPosTan(value, mCurrentPosition, null);
122122
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标

0 commit comments

Comments
 (0)