package com.paint.trace.drawing.view;

import android.app.Application;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.util.Log;

import com.anythink.core.api.ATSDK;
import com.anythink.core.api.NetTrafficeCallback;
import com.paint.trace.drawing.db.ObjectBox;
import com.paint.trace.drawing.topon.AdManager;

public class MyApplication extends Application {
    public static String Key_ViewDir = "pre_dir";
    public static String Key_ISMAIN = "ismain";
    public static String Key_Camera = "camera_data";

    public static String TAG = "------------Drawing------";


    public static MyApplication app;

    private String APPId ="h67505d35951dc";

    private String AppKey ="a81d17e5cc10cd96a65fe75c0ffd15334";

    public static Typeface defaultFont;

    @Override
    public void onCreate() {
        super.onCreate();
        app = this;
        initSDk();
        AssetManager assets = getAssets();
        defaultFont = Typeface.createFromAsset(assets, "myfont.ttf");

        ObjectBox.init(this);

    }

    private void initSDk(){
        ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {

            @Override
            public void onResultCallback(boolean isEU) {
                if (isEU && ATSDK.getGDPRDataLevel(MyApplication.this) == ATSDK.UNKNOWN) {
                    ATSDK.showGdprAuth(MyApplication.this);
                }

            }

            @Override
            public void onErrorCallback(String errorMsg) {

            }
        });
        ATSDK.init( this, APPId, AppKey);
        AdManager.loadAllAd();
    }


}
