Linjiajia
2023-04-24 fcdddf8b9b34f9930bec454b5fffe41c0e33ba3c
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
56
57
58
59
60
61
62
63
64
65
package com.application.zhangshi_app_android.ui.function;
 
import android.app.Application;
 
import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;
 
import com.android.app_base.base.viewmodel.BaseViewModel;
import com.application.zhangshi_app_android.data.DataRepository;
 
/**
 * @author Ljj
 * @date 2023.04.23. 23:24
 * @desc 婚姻状况 ViewModel
 */
public class MarriageActivityViewModel extends BaseViewModel<DataRepository> {
    private MutableLiveData<Boolean> isSpouseExpendedLiveData;
    private MutableLiveData<Boolean> isPredecessorExpendedLiveData;
    private MutableLiveData<Boolean> isProcreateExpendedLiveData;
 
    public MarriageActivityViewModel(@NonNull Application application) {
        super(application);
    }
 
    @Override
    protected DataRepository initModel() {
        return DataRepository.getInstance();
    }
 
    public MutableLiveData<Boolean> getIsSpouseExpendedLiveData() {
        if (isSpouseExpendedLiveData == null){
            isSpouseExpendedLiveData = new MutableLiveData<>();
            isSpouseExpendedLiveData.setValue(false);
        }
        return isSpouseExpendedLiveData;
    }
 
    public void setIsSpouseExpendedLiveData(MutableLiveData<Boolean> isSpouseExpendedLiveData) {
        this.isSpouseExpendedLiveData = isSpouseExpendedLiveData;
    }
 
    public MutableLiveData<Boolean> getIsPredecessorExpendedLiveData() {
        if (isPredecessorExpendedLiveData == null){
            isPredecessorExpendedLiveData = new MutableLiveData<>();
            isPredecessorExpendedLiveData.setValue(false);
        }
        return isPredecessorExpendedLiveData;
    }
 
    public void setIsPredecessorExpendedLiveData(MutableLiveData<Boolean> isPredecessorExpendedLiveData) {
        this.isPredecessorExpendedLiveData = isPredecessorExpendedLiveData;
    }
 
    public MutableLiveData<Boolean> getIsProcreateExpendedLiveData() {
        if (isProcreateExpendedLiveData == null){
            isProcreateExpendedLiveData = new MutableLiveData<>();
            isProcreateExpendedLiveData.setValue(false);
        }
        return isProcreateExpendedLiveData;
    }
 
    public void setIsProcreateExpendedLiveData(MutableLiveData<Boolean> isProcreateExpendedLiveData) {
        this.isProcreateExpendedLiveData = isProcreateExpendedLiveData;
    }
}