Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;

import android.graphics.Typeface;

public class Main {
    private static Typeface robotoRegular;
    private static Typeface robotoMedium;

    private static void initFonts(Context context) {
        if (robotoRegular == null) {
            robotoRegular = Typeface.createFromAsset(context.getAssets(), "Roboto-Regular.ttf");
        }
        if (robotoMedium == null) {
            robotoMedium = Typeface.createFromAsset(context.getAssets(), "Roboto-Medium.ttf");
        }
    }
}