Android Gaode map positioning small dot breathing animation flashing effect

Breathing flicker
 private Marker breatheMarker;// 定位雷达小图标 


// 呼吸动画
                    breatheMarker = aMap1.addMarker(new MarkerOptions().position(locll).zIndex(1).anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromResource(R.mipmap.gps_point)));
                    // 中心的marker
                    // 动画执行完成后,默认会保持到最后一帧的状态
                    AnimationSet animationSet = new AnimationSet(true);
                    AlphaAnimation alphaAnimation = new AlphaAnimation(0.5f, 0f);
                    alphaAnimation.setDuration(2000);
                    // 设置不断重复
                    alphaAnimation.setRepeatCount(Animation.INFINITE);
                    ScaleAnimation scaleAnimation = new ScaleAnimation(1, 3.5f, 1, 3.5f);
                    scaleAnimation.setDuration(2000);
                    // 设置不断重复
                    scaleAnimation.setRepeatCount(Animation.INFINITE);
                    animationSet.addAnimation(alphaAnimation);
                    animationSet.addAnimation(scaleAnimation);
                    animationSet.setInterpolator(new LinearInterpolator());
                    breatheMarker.setAnimation(animationSet);
                    breatheMarker.startAnimation();

 

Guess you like

Origin blog.csdn.net/shu_quan/article/details/109283708