| File was renamed from app/src/main/java/com/application/zhangshi_app_android/ui/function/CreateFamilyProjectActivityViewModel.java |
| | |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.manager.AppManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.UploadFileResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | |
| | | import okhttp3.MultipartBody; |
| | | import okhttp3.RequestBody; |
| | | |
| | | public class CreateFamilyProjectActivityViewModel extends BaseViewModel<DataRepository> { |
| | | public class FamilyMemorabiliaDetailActivityViewModel extends BaseViewModel<DataRepository> { |
| | | |
| | | private MutableLiveData<FamilyMemorabiliaBean> beanMutableLiveData; |
| | | private MutableLiveData<Boolean> typeLiveData;//true 编辑状态 false 展示状态 |
| | | public CreateFamilyProjectActivityViewModel(@NonNull Application application) { |
| | | public FamilyMemorabiliaDetailActivityViewModel(@NonNull Application application) { |
| | | super(application); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | messageLiveData.postValue("添加成功"); |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanMutableLiveData.getValue()); |
| | | messageLiveData.postValue("添加成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | messageLiveData.postValue("删除成功"); |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanMutableLiveData.getValue()); |
| | | messageLiveData.postValue("删除成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |
| | |
| | | @Override |
| | | public void onNext(ResultData<String> stringResultData) { |
| | | if (stringResultData.getCode() == CODE_SUCCESS){ |
| | | messageLiveData.postValue("修改成功"); |
| | | AppManager.getAppManager().finishCurrentActivity(); |
| | | RxBus.getInstance().post(beanMutableLiveData.getValue()); |
| | | messageLiveData.postValue("修改成功"); |
| | | }else { |
| | | messageLiveData.postValue(stringResultData.getMsg()); |
| | | } |