“Android Studio SetbackgroundColor Drawable” Respostas de código

Alterar cores desenhadas programaticamente android


//resource
Drawable unwrappedDrawable = AppCompatResources.getDrawable(context, R.drawable.my_drawable); 
Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
DrawableCompat.setTint(wrappedDrawable, Color.RED);    

//activity
Drawable unwrappedDrawable = tvContinue.getBackground();
Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
DrawableCompat.setTint(wrappedDrawable, (Color.parseColor(getPreferences().getString(Constant.SECOND_COLOR, Constant.SECONDARY_COLOR))));

//adapter
Drawable unwrappedDrawable = holder.tvOff.getBackground();
 Drawable wrappedDrawable = DrawableCompat.wrap(unwrappedDrawable);
 DrawableCompat.setTint(wrappedDrawable, (Color.parseColor(((BaseActivity) activity).getPreferences().getString(Constant.SECOND_COLOR, Constant.SECONDARY_COLOR))));


//

KushalCodes

Android Studio SetbackgroundColor Drawable

result.setBackgroundResource(R.drawable.your_drawable);
adreaskar

Como mudança colotes de fundo desenhado no Android

sdgfdjjk
KushalCodes

Respostas semelhantes a “Android Studio SetbackgroundColor Drawable”

Perguntas semelhantes a “Android Studio SetbackgroundColor Drawable”

Mais respostas relacionadas para “Android Studio SetbackgroundColor Drawable” em Java

Procure respostas de código populares por idioma

Procurar outros idiomas de código