Use custom colors and fonts

Customize the look and field of your Android app

Custom colors

VFColors colors = new VFColors(
    ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary),
    ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryLight),
    Color.BLACK);
VFSettings vfSettings = new VFSettings(colors);
val colors = VFColors(
    ContextCompat.getColor(getApplicationContext(), R.color.colorPrimary),
    ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryLight),
    Color.BLACK
)
val vfSettings = VFSettings(colors)
colorPrimary
colorPrimaryLight
colorBackground
colorSeparator

Custom fonts

Typeface regularFont = ResourcesCompat.getFont(ArticleActivity.this, R.font.inter_regular);
Typeface mediumFont = ResourcesCompat.getFont(ArticleActivity.this, R.font.inter_medium);
Typeface boldFont = ResourcesCompat.getFont(ArticleActivity.this, R.font.inter_bold);
VFFonts fonts = new VFFonts(regularFont, mediumFont, boldFont, null, null);
VFSettings vfSettings = new VFSettings(colors, fonts);
val regularFont = ResourcesCompat.getFont([email protected], R.font.inter_regular)
val mediumFont = ResourcesCompat.getFont([email protected], R.font.inter_medium)
val boldFont = ResourcesCompat.getFont([email protected], R.font.inter_bold)
val fonts = VFFonts(regularFont, mediumFont, boldFont, null, null)
val vfSettings = VFSettings(colors, fonts)

If a certain font is not specified, the default Viafoura font will be used.

fontRegular
fontMedium
fontBold
fontLight
fontSemibold

What’s Next