MyApplication.java
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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);
}
}