排程编辑更新
This commit is contained in:
@@ -118,9 +118,31 @@ public class AddWaterPlanActivity extends BaseActivity<AddWaterPlanLayoutBinding
|
||||
if (!configFragment.checkConfigFinish()) {
|
||||
ToastUtil.showShort(mContext, "请完成配置");
|
||||
return;
|
||||
}else{
|
||||
if(!configFragment.isConfigSave || configFragment.isConfigChanged()){
|
||||
showDialogtext(mContext.getResources().getDrawable(R.mipmap.img_location), false, false,true,
|
||||
}
|
||||
|
||||
// 编辑模式下,检查配置是否有变化
|
||||
if (mIsEditMode) {
|
||||
if (configFragment.isConfigChanged()) {
|
||||
showDialogtext(mContext.getResources().getDrawable(R.mipmap.img_location), false, false, true,
|
||||
"提示", "配置已修改,是否保存?",
|
||||
"取消", "保存", new BaseFragment.OnDialogClick() {
|
||||
@Override
|
||||
public void onCancelClick() {
|
||||
selectTabBind(mEditEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirmClick() {
|
||||
configFragment.commitConfig();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
selectTabBind(mEditEntity);
|
||||
}
|
||||
} else {
|
||||
// 新增模式,检查配置是否已保存
|
||||
if (!configFragment.isConfigSave || configFragment.isConfigChanged()) {
|
||||
showDialogtext(mContext.getResources().getDrawable(R.mipmap.img_location), false, false, true,
|
||||
"提示", "关联设备需要保存排程配置,是否继续?",
|
||||
"取消", "继续", new BaseFragment.OnDialogClick() {
|
||||
@Override
|
||||
@@ -132,30 +154,28 @@ public class AddWaterPlanActivity extends BaseActivity<AddWaterPlanLayoutBinding
|
||||
configFragment.commitConfig();
|
||||
}
|
||||
});
|
||||
}else{
|
||||
selectTabBind();
|
||||
} else {
|
||||
selectTabBind(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void selectTabBind() {
|
||||
private void selectTabBind(WaterPlanWeekEntity entity) {
|
||||
viewBinding.tvConfig.setSelected(false);
|
||||
viewBinding.tvBind.setSelected(true);
|
||||
viewBinding.viewpage.setCurrentItem(1);
|
||||
|
||||
// 传递排程数据给 BindDeviceFragment
|
||||
BindDeviceFragment bindDeviceFragment = (BindDeviceFragment) mFragmentList.get(1);
|
||||
bindDeviceFragment.setPlanEntity(entity);
|
||||
}
|
||||
|
||||
public void onConfigSaved(WaterPlanWeekEntity entity) {
|
||||
selectTabBind();
|
||||
// 传递 WaterPlanWeekEntity 给 BindDeviceFragment
|
||||
BindDeviceFragment bindDeviceFragment = (BindDeviceFragment) mFragmentList.get(1);
|
||||
bindDeviceFragment.setPlanEntity(entity);
|
||||
selectTabBind(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user