Vladimir Arevshatyan
Vladimir Arevshatyan

Reputation: 673

Change Nine Patch image color at runtime android

Good day.I want to change the actual 9 patch png image color during the runtime.The reason i need,is that i want to let user customize the actual color of image.My 9 patch image is an chat bubble.Simple DrawableTintCompat is not working as it is tinting the whole background except actual bubble.What i want is something like tinting,where the color of that bubble will be changed in 9 patch,so any of you guys have encounter such thing?Can you please give me an heads up?

Upvotes: 1

Views: 1219

Answers (1)

Vladimir Arevshatyan
Vladimir Arevshatyan

Reputation: 673

Ok i have managed to do it slightly in other way.Here what you can do.

ninePatchImageViewHolder.setColorFilter(Color.parseColor(s), PorterDuff.Mode.SRC_ATOP);

At this point it will not change the whole background and keep the bubble lets say in same color,but will in correct way change the actual bubble color

Upvotes: 4

Related Questions