There is a layout (stencil) in the shape of a heart.

From the server I get a list of different data, including color. Is it possible to use one stencil to color the heart depending on the data obtained?

How to do not know. The only thing in my mind is the thought of making 100 such pictures of different colors ... But this is stupid. Is there a workaround?

    1 answer 1

    If I understand correctly, then you need this:

    imageView.setColorFilter(Color.argb(255, 255, 255, 255)); //к примеру белый цвет 
    • This is supposedly if there is a green picture. with white frames. Then, when specifying this method, will the green be repainted to white? - Andro
    • Suppose there is a PNG of the heart in red without a background; when using this method, the heart will be displayed in white - Nikotin N