I have an ImageView on which I need to draw a red circle when I click on the screen, I need this circle to change its radius with a certain frequency. (increased, and then decreased). One of the options with which this can be done is to draw a circle on the Canvas, and then change its radius, redraw the Canvas at regular intervals, using invalidate (), save (), restore (). And what other options are there, how can this be done differently?

    1 answer 1

    Create a VectorDrawable with a circle, an ObjectAnimator in which you animate , for example, increasing the circle as you need, then merge them into AnimatedVectorDrawable and that's it. 3 xml files, a droplet of code to start the animation and for support on the androids below 5th, read Support Vector Drawables and Animated Vector Drawables , if at the end, just add such code to build.gradle:

    // Gradle Plugin 2.0+ android { defaultConfig { vectorDrawables.useSupportLibrary = true } } 
    • Thanks, I will try! - Lucky_girl