rk
昨天 4a8ff39b0fab0627ef8f7459587d514cc01c3676
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
package com.example.datalibrary.utils;
 
import android.content.Context;
 
/**
 * Created by l on 2017/8/14.
 */
 
public class PreferencesManager extends BasePreferencesManager {
 
 
    private static final String RGB_DEPTH = "rgbDepth";
    private static final String RGB_NIR_DEPTH = "rgbNirDepth";
    private static final String TYPE = "type";
 
    private static PreferencesManager instance = null;
 
    protected PreferencesManager(Context context) {
        super(context);
    }
 
    public static synchronized PreferencesManager getInstance(Context context) {
        if (instance == null) {
            instance = new PreferencesManager(context);
        }
        return instance;
    }
 
    public void setType(int type) {
        setInt(TYPE, "type", type);
    }
 
    public int getType() {
        return getInt(TYPE, "type", 0);
    }
 
    public void setRgbDepth(int rgbDepth) {
        setInt(RGB_DEPTH, "rgbDepth", rgbDepth);
    }
 
    public int getRgbDepth() {
        return getInt(RGB_DEPTH, "rgbDepth", 0);
    }
 
    public void setRgbNirDepth(int rgbNirDepth) {
        setInt(RGB_NIR_DEPTH, "rgbNirDepth", rgbNirDepth);
    }
 
    public int getRgbNirDepth() {
        return getInt(RGB_NIR_DEPTH, "rgbNirDepth", 0);
    }
 
}