android - How to add a gradient to a colored ImageView icon? -


i'm showing icon dynamically set color.

question: how can add gradient icon? eg color set "end" color of gradient, , start color "lighter"?

definition:

<imageview android:id="@id+/someicon" android:src="@android:drawable/ic_btn_speak_now" /> 

color set:

imageview icon = (imageview) view.findviewbyid(r.id.someicon) icon.setcolorfilter(color.parsecolor("#ff0000"), porterduff.mode.src_atop); 

android api 16.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -