@Test public void testSetIcon() { final ColorDrawable drawable = new ColorDrawable(Color.CYAN); IconMixin mixin = new IconMixin(mTemplateLayout, null, 0); mixin.setIcon(drawable); assertSame(drawable, mIconView.getDrawable()); 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();  }