package com.photo.keyboard.themes

import android.app.Application
import android.graphics.Typeface
import com.photo.keyboard.themes.data.Parent
import com.photo.keyboard.themes.manager.FileDeal

class App : Application() {

    override fun onCreate() {
        super.onCreate()
        instance = this

        FileDeal.getFileStr(assets.open("themes.json")) {
            if (it != null) {
                requireNotNull(it.isNotEmpty())
                data = FileDeal.getDataBean(it)
            }
        }
        font = Typeface.createFromAsset(assets, "myfont.ttf")
        com.photo.keyboard.themes.manager.DbManager.init(this)


    }

    companion object {
        var data: List<Parent> = mutableListOf()
        lateinit var instance: App

        lateinit var font: Typeface
    }
}