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 { private MutableLiveData isSpouseExpendedLiveData; private MutableLiveData isPredecessorExpendedLiveData; private MutableLiveData isProcreateExpendedLiveData; public MarriageActivityViewModel(@NonNull Application application) { super(application); } @Override protected DataRepository initModel() { return DataRepository.getInstance(); } public MutableLiveData getIsSpouseExpendedLiveData() { if (isSpouseExpendedLiveData == null){ isSpouseExpendedLiveData = new MutableLiveData<>(); isSpouseExpendedLiveData.setValue(false); } return isSpouseExpendedLiveData; } public void setIsSpouseExpendedLiveData(MutableLiveData isSpouseExpendedLiveData) { this.isSpouseExpendedLiveData = isSpouseExpendedLiveData; } public MutableLiveData getIsPredecessorExpendedLiveData() { if (isPredecessorExpendedLiveData == null){ isPredecessorExpendedLiveData = new MutableLiveData<>(); isPredecessorExpendedLiveData.setValue(false); } return isPredecessorExpendedLiveData; } public void setIsPredecessorExpendedLiveData(MutableLiveData isPredecessorExpendedLiveData) { this.isPredecessorExpendedLiveData = isPredecessorExpendedLiveData; } public MutableLiveData getIsProcreateExpendedLiveData() { if (isProcreateExpendedLiveData == null){ isProcreateExpendedLiveData = new MutableLiveData<>(); isProcreateExpendedLiveData.setValue(false); } return isProcreateExpendedLiveData; } public void setIsProcreateExpendedLiveData(MutableLiveData isProcreateExpendedLiveData) { this.isProcreateExpendedLiveData = isProcreateExpendedLiveData; } }