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.bean.PrivacyBean;
|
import com.application.zhangshi_app_android.data.DataRepository;
|
|
import java.util.ArrayList;
|
import java.util.List;
|
|
/**
|
* @author Ljj
|
* @date 2023.04.28. 20:30
|
* @desc
|
*/
|
public class PrivacyActivityViewModel extends BaseViewModel<DataRepository> {
|
private MutableLiveData<List<PrivacyBean>> dataListLiveData;
|
|
public PrivacyActivityViewModel(@NonNull Application application) {
|
super(application);
|
}
|
|
@Override
|
protected DataRepository initModel() {
|
return DataRepository.getInstance();
|
}
|
|
public MutableLiveData<List<PrivacyBean>> getDataListLiveData() {
|
if (dataListLiveData == null) {
|
dataListLiveData = new MutableLiveData<>();
|
}
|
return dataListLiveData;
|
}
|
|
public void setDataListLiveData(MutableLiveData<List<PrivacyBean>> dataListLiveData) {
|
this.dataListLiveData = dataListLiveData;
|
}
|
|
/**
|
* 获取年度健康情况
|
*/
|
public void getPrivacy() {
|
List<PrivacyBean> beans = new ArrayList<>();
|
for (int i = 0; i < 10; i++) {
|
PrivacyBean bean = new PrivacyBean();
|
bean.setType("QQ号");
|
bean.setTime("2020-01-01");
|
bean.setAccount("12345678");
|
bean.setPassword("000000");
|
bean.setEffectiveTime("2030-01-01");
|
bean.setIsFace(0);
|
bean.setIsFingerprint(0);
|
bean.setIsPublic(1);
|
bean.setLocation("————");
|
bean.setRemark("我的QQ号");
|
beans.add(bean);
|
}
|
dataListLiveData.setValue(beans);
|
}
|
}
|