change drawable color programmatically android

Solutions on MaxInterview for change drawable color programmatically android by the best coders in the world

showing results for - "change drawable color programmatically android"
Davide
08 Sep 2016
1
2//resource
3Drawable unwrappedDrawable = AppCompatResources.getDrawable(context, R.drawable.my_drawable); 
4Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
5DrawableCompat.setTint(wrappedDrawable, Color.RED);    
6
7//activity
8Drawable unwrappedDrawable = tvContinue.getBackground();
9Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
10DrawableCompat.setTint(wrappedDrawable, (Color.parseColor(getPreferences().getString(Constant.SECOND_COLOR, Constant.SECONDARY_COLOR))));
11
12//adapter
13Drawable unwrappedDrawable = holder.tvOff.getBackground();
14 Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
15 DrawableCompat.setTint(wrappedDrawable, (Color.parseColor(((BaseActivity) activity).getPreferences().getString(Constant.SECOND_COLOR, Constant.SECONDARY_COLOR))));
16
17
18//
19
20
Jan
12 Apr 2016
1Drawable unwrappedDrawable = AppCompatResources.getDrawable(context, R.drawable.my_drawable); 
2Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
3DrawableCompat.setTint(wrappedDrawable, Color.RED);  
Niklas
14 May 2019
1 Drawable unwrappedDrawable = tvContinueShopping.getBackground();
2        Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
3        DrawableCompat.setTint(wrappedDrawable, (Color.parseColor(getPreferences().getString(Constant.SECOND_COLOR, Constant.SECONDARY_COLOR))));
4
queries leading to this page
android drawable change colorandroid change color of shape drawable programmaticallyandroid change icon color programmatiquellyset background tint drawable androidpass color to a drawable android studiohow to reference color using attr in drawable file in androidget color from drawable androidandroid studio change drawable from black to whiteandroid programmatically change drawable tintchange color of drawable programmatically androidandroid change background drawable color programmaticallyhow to change drawable icon color in android programmaticallyandroid define drawable colorchange drawable color programmatically android kotlincolor drawable in androidset left drawable color androidsettintlist from drawable colorandroid change icon color programmaticallycolor to drawable androidchange drawable color programmatically androidhow to change drawable end tint color programmatically in androidandroid drawable set background colorchange colored pixels of drawable androidhow to convert color to drawable in androidandroid create color drawable programmatically from colorhow to set background color in drawable android studioandroid drawable to colorandroid drawable colorsdrawable to text color android android drawable color programmaticallyandroid studio drawable colorhow to change color of a drawable in android programmaticallyandroid create drawable from color intget color as drawable program androidhow to set drawable right tint color programmatically in androidhow to set font colour in android drawablesandroid how to change drawablestart colorset color for drawable androidandroid set drawable color programmaticallychange drawable color in xml androidcolor filter drawable androidandroid drawable color from black to whitehow to set drawable end tint color programmatically in androidandroid color to drawablehow to make color from drawable android xmlchange drawable icon tint runtime androidchange only colored pixels of drawable androidhow to create drawable color in androidhow to change drawable color dynamically in androiditem android drawable colorchange color to drawable androidchange a drawable color programmatically androidchange drawable solid color programmatically androidhow to change background drawable color in android programmaticallyconvert color code to drawable android studioandroid drawable fill colorshift color of drawable androidsetbackground tint to drawable androidhow to change the color of a drawable programmaticallyandroid drawable to detcolorchange colour of 40android 3adrawable 2fedit box backgroundset color programmatically android from drawableandroid studio change drawable color programmaticallyhow to create drawable with 2 colors in androidhow to change color of drawwable resource in adapterset background colour using drawables in androidset background drawable tint programmatically androidcolor drawable android studiohow to create color xml in drawable android studioandroid compound drawable change color programmaticallyhow to change drawableleft color in android programmaticallyandroid studio color drawablechange color of drawable androidhow to change drawable icon color in textview android programmaticallycolors drawable kotlin with shadeshow to change drawable color programmatically in androidchanging drawable color androidandroid drawable change text colordrawable only set color android studiohow to set background color of a drawable in android programmaticallyandroid drawable with different colorandroid set background drawable color programmaticallyandroid studio change drawable image colorandroid get color as drawablecolor drawable androidandroid 3adrawable 3d 22 40android 3acolor 2fwhite 22 colorshow to set color as drawable in android programmaticallychange color of android drawaleandroid change drawable shape color programmaticallydrawable from color androiddrawable change color programmaticallyandroid layer drawable change colorandroid how to change drawable colorset drawable color programmatically androidandroid how to get color drawablechange drawable color by id programmatically android kotlinandroid studio change background color to drawable programmaticallyandroid color drawablekotlin change drawable colorset drawable tint programmatically androiddrawable android colorhow to change drawable color in android programmaticallyandroid tint background drawablehow to set dynamic color in android drawable filedrawable to color androidhow to dynamically set color of drawable xml androidandroid how to change drawable solid color programaticallyandroid programmatically change drawable colorhow to change drawable file background color in android programmaticallychange background color of drawable androidandroid studio change color of drawablechange color of shape drawable androidandroid drawable change color when themeandroid fab drawable colorhow to change colour of progress bar in androidhow to set drawable tint color programmatically in androidget color of drawable androidandroid change drawable color programmaticallyhow to change drawable shape color in android programmaticallyset drawable color androiddynamic color gives in drawable androidchanging color of a drawable programmicallyandroid imageview drawable change colordrawable color androidhow to get color from drawable androidchange color button in android studio using drawablechnage the stroke color of drawable in androidhow to change color of drawable image in android studiodrawable change color programmatically kotlinandroid create color drawable programmaticallyhow to change icon tint programmatically androidchange drawable color android programmaticallydrawable apply color androidhow to change color of drawable in androiddrawable color to text color androiddrawable tint programmaticallyandroid drawable dynamic colorandroid color drawable programmaticallychange color of drawable android programmaticallyset drawable tintcolor primary drawable androidset colorfilter kotlinhow to make color from drawable androidget drawable from color androidhow to change drawable end tint color in android programmaticallyandroid drawable coleruse color in drawable android xmlchange drawable image color in androidhow to change text drawable tint color in android programmaticallyhow to get drawable strok color in androidandroid change drawable image color xmlhow to set in drawable dynamic color in androidandroid studio change color of all drawableshow to change tint of a drawable in androidhow to change drawable tint color in android programmaticallyandroid get color drawable programmaticallychange drawable icon runtime androidandroid drawable use directly colorandroid change textview drawable color programmaticallychange drawable color programmaticallyandroid drawable background colorset drawable background color programmatically androidandroid change drawable coloruse color in drawable androidhow to change vector drawable color in androidkotlin set color filterchange drawable tint color programmatically androidandroid set color drawabledrawable image color androidchange drawable color programmatically android