Animation not working for my Android App -
hey trying replicate animation similar gif below thinner circles:
but animation not moving, static circles, method using:
private void circleanimation3(final marker marker){ final circle circle2 = mmap.addcircle(new circleoptions() .center(new latlng(marker.getposition().latitude,marker.getposition().longitude)) .strokecolor(color.cyan).radius(1000)); animatorset = new animatorset(); animatorset.setinterpolator(new acceleratedecelerateinterpolator()); animatorlist = new arraylist<animator>(); for(int i=0;i<rippleamount;i++) { final valueanimator scalexanimator = valueanimator.offloat(1.0f); scalexanimator.setrepeatcount(valueanimator.infinite); scalexanimator.setrepeatmode(valueanimator.restart); scalexanimator.setstartdelay(i * (3000/6)); scalexanimator.setduration(3000); scalexanimator.addupdatelistener(new valueanimator.animatorupdatelistener() { @override public void onanimationupdate(valueanimator valueanimator) { float animatedfraction = valueanimator.getanimatedfraction(); log.e("", "" + animatedfraction); circle2.setradius(animatedfraction * 100); } }); animatorlist.add(scalexanimator); final valueanimator scaleyanimator = valueanimator.offloat(1.0f); scaleyanimator.setrepeatcount(valueanimator.infinite); scaleyanimator.setrepeatmode(valueanimator.restart); scaleyanimator.setstartdelay(i * (3000/6)); scaleyanimator.setduration(3000); scaleyanimator.addupdatelistener(new valueanimator.animatorupdatelistener() { @override public void onanimationupdate(valueanimator valueanimator) { float animatedfraction = valueanimator.getanimatedfraction(); log.e("", "" + animatedfraction); circle2.setradius(animatedfraction * 100); } }); animatorlist.add(scaleyanimator); final valueanimator alphaanimator = valueanimator.offloat(1.0f,0f); alphaanimator.setrepeatcount(valueanimator.infinite); alphaanimator.setrepeatmode(valueanimator.restart); alphaanimator.setstartdelay(i * (3000/6)); alphaanimator.setduration(3000); alphaanimator.addupdatelistener(new valueanimator.animatorupdatelistener() { @override public void onanimationupdate(valueanimator valueanimator) { float animatedfraction = valueanimator.getanimatedfraction(); log.e("", "" + animatedfraction); circle2.setradius(animatedfraction * 100); } }); animatorlist.add(alphaanimator); } animatorset.playtogether(animatorlist); animatorset.start(); }
i not sure why not moving :(
Comments
Post a Comment