@Test(expected = IllegalArgumentException.class) public void testCreateFromEmptyPath() { Font.create(""); }
@Nullable public static Font create( @NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes ) { final Resources.Theme theme = context.getTheme(); final TypedArray attributes = theme.obtainStyledAttributes(attrs, new int[]{R.attr.uiFont}, defStyleAttr, defStyleRes); final String filePath = attributes.getString(0); attributes.recycle(); return TextUtils.isEmpty(filePath) ? null : create(filePath); }
Font { @Nullable public static Font create( @NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes ) { final Resources.Theme theme = context.getTheme(); final TypedArray attributes = theme.obtainStyledAttributes(attrs, new int[]{R.attr.uiFont}, defStyleAttr, defStyleRes); final String filePath = attributes.getString(0); attributes.recycle(); return TextUtils.isEmpty(filePath) ? null : create(filePath); } }
Font { @Nullable public static Font create( @NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes ) { final Resources.Theme theme = context.getTheme(); final TypedArray attributes = theme.obtainStyledAttributes(attrs, new int[]{R.attr.uiFont}, defStyleAttr, defStyleRes); final String filePath = attributes.getString(0); attributes.recycle(); return TextUtils.isEmpty(filePath) ? null : create(filePath); } Font(@NonNull final String filePath); }
Font { @Nullable public static Font create( @NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes ) { final Resources.Theme theme = context.getTheme(); final TypedArray attributes = theme.obtainStyledAttributes(attrs, new int[]{R.attr.uiFont}, defStyleAttr, defStyleRes); final String filePath = attributes.getString(0); attributes.recycle(); return TextUtils.isEmpty(filePath) ? null : create(filePath); } Font(@NonNull final String filePath); static void setLogLevel(final int level); static void setBasePath(@Nullable final String basePath); @Nullable static Font create(
			@NonNull final Context context,
			@Nullable final AttributeSet attrs,
			@AttrRes final int defStyleAttr,
			@StyleRes final int defStyleRes
	); @Nullable static Font create(@NonNull final Context context, @StyleRes final int style); @NonNull static Font create(@NonNull final String filePath); static void clearCache(); @NonNull String getFilePath(); @NonNull Typeface getTypeface(@NonNull final Context context); }
Font { @Nullable public static Font create( @NonNull final Context context, @Nullable final AttributeSet attrs, @AttrRes final int defStyleAttr, @StyleRes final int defStyleRes ) { final Resources.Theme theme = context.getTheme(); final TypedArray attributes = theme.obtainStyledAttributes(attrs, new int[]{R.attr.uiFont}, defStyleAttr, defStyleRes); final String filePath = attributes.getString(0); attributes.recycle(); return TextUtils.isEmpty(filePath) ? null : create(filePath); } Font(@NonNull final String filePath); static void setLogLevel(final int level); static void setBasePath(@Nullable final String basePath); @Nullable static Font create(
			@NonNull final Context context,
			@Nullable final AttributeSet attrs,
			@AttrRes final int defStyleAttr,
			@StyleRes final int defStyleRes
	); @Nullable static Font create(@NonNull final Context context, @StyleRes final int style); @NonNull static Font create(@NonNull final String filePath); static void clearCache(); @NonNull String getFilePath(); @NonNull Typeface getTypeface(@NonNull final Context context); static final String TTF_SUFFIX; static final String FONT_DIR; }