use of android.graphics.drawable.ColorDrawable in project xabber-android by redsolution.
the class AvatarManager method getDefaultAvatarDrawable.
private Drawable getDefaultAvatarDrawable(BaseAvatarSet.DefaultAvatar defaultAvatar) {
Drawable[] layers = new Drawable[2];
layers[0] = new ColorDrawable(defaultAvatar.getBackgroundColor());
layers[1] = application.getResources().getDrawable(defaultAvatar.getIconResource());
return new LayerDrawable(layers);
}
use of android.graphics.drawable.ColorDrawable in project xabber-android by redsolution.
the class AvatarManager method getDefaultAccountAvatar.
@NonNull
public Drawable getDefaultAccountAvatar(String account) {
Drawable[] layers = new Drawable[2];
layers[0] = new ColorDrawable(ColorManager.getInstance().getAccountPainter().getAccountMainColor(account));
layers[1] = application.getResources().getDrawable(R.drawable.ic_avatar_1);
return new LayerDrawable(layers);
}
use of android.graphics.drawable.ColorDrawable in project robolectric by robolectric.
the class ShadowResourcesTest method testGetColorDrawable.
@Test
public void testGetColorDrawable() {
Drawable drawable = resources.getDrawable(R.color.color_with_alpha);
assertThat(drawable).isInstanceOf(ColorDrawable.class);
assertThat(((ColorDrawable) drawable).getColor()).isEqualTo(0x802C76AD);
}
use of android.graphics.drawable.ColorDrawable in project robolectric by robolectric.
the class ShadowThemeTest method whenNotSetOnActivityInManifest_activityGetsThemeFromApplicationInManifest.
@Test
public void whenNotSetOnActivityInManifest_activityGetsThemeFromApplicationInManifest() throws Exception {
TestActivity activity = buildActivity(TestActivity.class).create().get();
Button theButton = (Button) activity.findViewById(R.id.button);
ColorDrawable background = (ColorDrawable) theButton.getBackground();
assertThat(background.getColor()).isEqualTo(0xff00ff00);
}
use of android.graphics.drawable.ColorDrawable in project MyDiary by erttyy8821.
the class SettingActivity method setThemeColor.
private void setThemeColor() {
IV_setting_theme_main_color.setImageDrawable(new ColorDrawable(themeManager.getThemeMainColor(this)));
IV_setting_theme_dark_color.setImageDrawable(new ColorDrawable(themeManager.getThemeDarkColor(this)));
}
Aggregations