Well, I quickly played with it and noticed that your problem is the disappearance of circles. If you did not indicate what exactly you tried, I assume that you have not yet tried to set the color filter to Drawable ? (unlike ImageView , which only works with BitmapDrawable s).
The following statements work fine for declared xml ShapeDrawable with white as the initial color:
ImageView redCircle = (ImageView) findViewById(R.id.circle_red_imageview); ImageView greenCircle = (ImageView) findViewById(R.id.circle_green_imageview); ImageView blueCircle = (ImageView) findViewById(R.id.circle_blue_imageview); // we can create the color values in different ways: redCircle.getDrawable().setColorFilter(Color.RED, PorterDuff.Mode.MULTIPLY ); greenCircle.getDrawable().setColorFilter(0xff00ff00, PorterDuff.Mode.MULTIPLY ); blueCircle.getDrawable().setColorFilter(getResources().getColor(R.color.blue), PorterDuff.Mode.MULTIPLY );
ShapeDrawable for completeness: (I set the size on ImageView , see below)
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <solid android:color="@android:color/white" /> </shape>
And one from ImageView as an example:
<ImageView android:id="@+id/circle_red_imageview" android:layout_width="40dp" android:layout_height="40dp" android:padding="5dp" android:src="@drawable/circle_white" />
Visual result:

Mh. Apr 13 2018-12-12T00: 00Z
source share