package com.hikapro.backpack;

import android.app.Application;
import android.content.Context;
import android.graphics.Typeface;

import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;

/**
 * Created by tariel on 27/04/16.
 */
public class App extends Application {

    private static Context context;
    private static Typeface mainFace;
    private static Tracker tracker;

    @Override
    public void onCreate() {
        super.onCreate();
        App.context = getApplicationContext();
        App.mainFace = Typeface.createFromAsset(App.context.getAssets(), "fonts/Ubuntu-B.ttf");
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        tracker = analytics.newTracker(R.xml.global_tracker);
    }

    public static Context getAppContext() {
        return App.context;
    }

    public static Typeface getMainFace() {
        return App.mainFace;
    }

    synchronized public static Tracker getDefaultTracker() {
        return App.tracker;
    }
}
