@Test public void setIcon_resourceId_shouldSetIcon() { int icon = android.R.drawable.ic_menu_add; IconMixin mixin = new IconMixin(mTemplateLayout, null, 0); mixin.setIcon(icon); Drawable drawable = mIconView.getDrawable(); assertThat(drawable).isInstanceOf(BitmapDrawable.class); assertEquals(View.VISIBLE, mIconView.getVisibility()); }
public void setIcon(Drawable icon) { final ImageView iconView = getView(); if (iconView != null) { iconView.setImageDrawable(icon); iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); } }
IconMixin implements Mixin { public void setIcon(Drawable icon) { final ImageView iconView = getView(); if (iconView != null) { iconView.setImageDrawable(icon); iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); } } }
IconMixin implements Mixin { public void setIcon(Drawable icon) { final ImageView iconView = getView(); if (iconView != null) { iconView.setImageDrawable(icon); iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); } } IconMixin(TemplateLayout layout, AttributeSet attrs, int defStyleAttr); }
IconMixin implements Mixin { public void setIcon(Drawable icon) { final ImageView iconView = getView(); if (iconView != null) { iconView.setImageDrawable(icon); iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); } } IconMixin(TemplateLayout layout, AttributeSet attrs, int defStyleAttr); void setIcon(Drawable icon); void setIcon(@DrawableRes int icon); Drawable getIcon(); void setContentDescription(CharSequence description); CharSequence getContentDescription(); }
IconMixin implements Mixin { public void setIcon(Drawable icon) { final ImageView iconView = getView(); if (iconView != null) { iconView.setImageDrawable(icon); iconView.setVisibility(icon != null ? View.VISIBLE : View.GONE); } } IconMixin(TemplateLayout layout, AttributeSet attrs, int defStyleAttr); void setIcon(Drawable icon); void setIcon(@DrawableRes int icon); Drawable getIcon(); void setContentDescription(CharSequence description); CharSequence getContentDescription();  }