@Test public void testSetFont() { final FontApplier mockApplier = mock(FontApplier.class); final FontEditText widget = new FontEditText(context); widget.setFontApplier(mockApplier); final Font font = Font.create(FONT_PATH); widget.setFont(font); verify(mockApplier).applyFont(widget, font); }
@Override public void setFont(@NonNull final String fontPath) { this.fontApplier.applyFont(this, fontPath); }
FontEditText extends EditText implements FontApplierWidget { @Override public void setFont(@NonNull final String fontPath) { this.fontApplier.applyFont(this, fontPath); } }
FontEditText extends EditText implements FontApplierWidget { @Override public void setFont(@NonNull final String fontPath) { this.fontApplier.applyFont(this, fontPath); } FontEditText(@NonNull final Context context);  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs);  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr); @SuppressWarnings("unused") @TargetApi(Build.VERSION_CODES.LOLLIPOP)  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes); }
FontEditText extends EditText implements FontApplierWidget { @Override public void setFont(@NonNull final String fontPath) { this.fontApplier.applyFont(this, fontPath); } FontEditText(@NonNull final Context context);  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs);  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr); @SuppressWarnings("unused") @TargetApi(Build.VERSION_CODES.LOLLIPOP)  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes); @Override void setFontApplier(@NonNull final FontApplier applier); @Override void setFont(@NonNull final String fontPath); @Override void setFont(@NonNull final Font font); @SuppressWarnings("deprecation") @Override void setTextAppearance(@NonNull final Context context, @StyleRes final int resId); }
FontEditText extends EditText implements FontApplierWidget { @Override public void setFont(@NonNull final String fontPath) { this.fontApplier.applyFont(this, fontPath); } FontEditText(@NonNull final Context context);  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs);  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr); @SuppressWarnings("unused") @TargetApi(Build.VERSION_CODES.LOLLIPOP)  FontEditText(@NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes); @Override void setFontApplier(@NonNull final FontApplier applier); @Override void setFont(@NonNull final String fontPath); @Override void setFont(@NonNull final Font font); @SuppressWarnings("deprecation") @Override void setTextAppearance(@NonNull final Context context, @StyleRes final int resId);  }