package com.ar.drawing.assistant.paint.utils;

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

import com.anythink.core.api.ATSDK;
import com.anythink.core.api.NetTrafficeCallback;
import com.ar.drawing.assistant.paint.ad.AdManager;
import com.ar.drawing.assistant.paint.tooldb.DbManager;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class MyApp 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 = "=============";


    public static MyApp app;

//    private String APPId ="h67505d35951dc";
//
//    private String AppKey ="a81d17e5cc10cd96a65fe75c0ffd15334";

    public static Typeface defaultFont;

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

    }

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

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

            }

            @Override
            public void onErrorCallback(String errorMsg) {

            }
        });
        String APPId = "h67d2b184775c9";
        String AppKey = "aa03c7f638642c6e3621bdbfb88bf6ad5";
        ATSDK.init( this, APPId, AppKey);
        ATSDK.setNetworkLogDebug(true);
        AdManager.loadAllAd();

    }

    public static String Class_Animals = "res_Animals";
    public static String Class_birds = "res_Birds";
    public static String Class_butterfly = "res_Butterfly";
    public static String Class_cafe = "res_Cafe";
    public static String Class_cartoons = "res_Cartoons";
    public static String Class_christmas = "res_Christmas";
    public static String Class_festivals = "res_Festivals";
    public static String Class_flowers = "res_Flowers";
    public static String Class_fruits = "res_Fruits";
    public static String Class_general = "res_General";

    public static String Class_mehndi = "res_Mehndi";
    public static String Class_nature = "res_Nature";
    public static String Class_properties = "res_Properties";
    public static String Class_rangoli = "res_Rangoli";
    public static String Class_sports = "res_Sports";
    public static String Class_vehicles = "res_Vehicles";

    public static List<String> getAllDir() {
        ArrayList<String> list = new ArrayList<>();
        list.add(Class_Animals);
        list.add(Class_birds);
        list.add(Class_butterfly);
        list.add(Class_cafe);
        list.add(Class_cartoons);
        list.add(Class_christmas);
        list.add(Class_festivals);
        list.add(Class_flowers);
        list.add(Class_fruits);
        list.add(Class_general);
        list.add(Class_mehndi);
        list.add(Class_nature);
        list.add(Class_properties);
        list.add(Class_rangoli);
        list.add(Class_sports);
        list.add(Class_vehicles);
        Collections.shuffle(list);
        return list;


    }
}
