lmw
2023-06-07 f9dd2cdac746d308d5c4bcfdbea389ab67a66b12
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
package com.luck.picture.lib.app;
 
import android.content.Context;
 
/**
 * @author:luck
 * @date:2019-12-03 15:12
 * @describe:获取一些全局所需参数
 */
public class PictureAppMaster implements IApp {
 
 
    @Override
    public Context getAppContext() {
        if (app == null) {
            return null;
        }
        return app.getAppContext();
    }
 
 
    private PictureAppMaster() {
    }
 
    private static PictureAppMaster mInstance;
 
    public static PictureAppMaster getInstance() {
        if (mInstance == null) {
            synchronized (PictureAppMaster.class) {
                if (mInstance == null) {
                    mInstance = new PictureAppMaster();
                }
            }
        }
        return mInstance;
    }
 
    private IApp app;
 
    public void setApp(IApp app) {
        this.app = app;
    }
 
    public IApp getApp() {
        return app;
    }
}