MyApplication.java 2.0 KB
package com.yinhebairong.clasmanage.base;

import android.app.Application;
import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.guoxiaoxing.phoenix.core.listener.ImageLoader;
import com.guoxiaoxing.phoenix.picker.Phoenix;
import com.kongzue.dialog.util.DialogSettings;
import com.tencent.bugly.crashreport.CrashReport;

import cn.jpush.android.api.JPushInterface;

public class MyApplication extends Application {

    private static MyApplication application;

    @Override
    public void onCreate() {
        super.onCreate();
        application = this;
        //初始化bugly
        CrashReport.initCrashReport(getApplicationContext(), "21d3932c42", false);
        //初始化极光sdk
        JPushInterface.setDebugMode(true);//正式版的时候设置false,关闭调试
        JPushInterface.init(this);
        Phoenix.config()
                .imageLoader(new ImageLoader() {
                    @Override
                    public void loadImage(Context mContext, ImageView imageView
                            , String imagePath, int type) {
                        Glide.with(mContext)
                                .load(imagePath)
                                .into(imageView);
                    }
                });
        DialogSettings.isUseBlur = (true);               //是否开启模糊效果,默认关闭
        DialogSettings.style = (DialogSettings.STYLE.STYLE_IOS);      //全局主题风格,提供三种可选风格,STYLE_MATERIAL, STYLE_KONGZUE, STYLE_IOS
        DialogSettings.cancelable = (false);              //全局对话框默认是否可以点击外围遮罩区域或返回键关闭,此开关不影响提示框(TipDialog)以及等待框(TipDialog)
    }

    public static synchronized MyApplication getInstance() {
        return application;
    }


    @Override

    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);

    }

}