package com.ar.drawing;

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.ad.AdManager;
import com.ar.drawing.db.MyDb;

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

public class MyDraw 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 MyDraw app;


    public static Typeface defaultFont;

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

    }

    private void initSDk() {
        String APPId = "h67ad909a5e11c";

        String AppKey = "a9a5019e8c78dfe682dfefb31a49e74c3";
        ATSDK.checkIsEuTraffic(this, new NetTrafficeCallback() {

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

            }

            @Override
            public void onErrorCallback(String errorMsg) {

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

    public static String Class_Animals = "Animals";
    public static String Class_birds = "Birds";
    public static String Class_butterfly = "Butterfly";
    public static String Class_cafe = "Cafe";
    public static String Class_cartoons = "Cartoons";
    public static String Class_christmas = "Christmas";
    public static String Class_festivals = "Festivals";
    public static String Class_flowers = "Flowers";
    public static String Class_fruits = "Fruits";
    public static String Class_general = "General";

    public static String Class_mehndi = "Mehndi";
    public static String Class_nature = "Nature";
    public static String Class_properties = "Properties";
    public static String Class_rangoli = "Rangoli";
    public static String Class_sports = "Sports";
    public static String Class_vehicles = "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;


    }
}
