@@ -0,0 +1,180 @@ | |||||
package com.bonait.bnframework.Dialog; | |||||
import static com.bonait.bnframework.common.utils.AlertDialogUtils.getContext; | |||||
import android.app.Activity; | |||||
import android.content.Context; | |||||
import android.content.ContextWrapper; | |||||
import android.view.Gravity; | |||||
import android.view.View; | |||||
import android.widget.Button; | |||||
import android.widget.RelativeLayout; | |||||
import android.widget.TextView; | |||||
import androidx.annotation.NonNull; | |||||
import com.bonait.bnframework.R; | |||||
import com.bonait.bnframework.common.constant.ConfigName; | |||||
import com.bonait.bnframework.common.db.res.UserLogEnum; | |||||
import com.bonait.bnframework.common.helper.AlertDialogButton; | |||||
import com.bonait.bnframework.common.helper.I.IDialogAction; | |||||
import com.bonait.bnframework.common.helper.MessageLog; | |||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogBuilder; | |||||
public class DialogManager { | |||||
// private static volatile DialogManager mInstance = null; | |||||
// | |||||
// private DialogManager() { | |||||
// | |||||
// } | |||||
// | |||||
// public static DialogManager getInstance() { | |||||
// if (mInstance == null) { | |||||
// synchronized (DialogManager.class) { | |||||
// if (mInstance == null) { | |||||
// mInstance = new DialogManager(); | |||||
// } | |||||
// } | |||||
// } | |||||
// return mInstance; | |||||
// } | |||||
// public Activity activityMain=null; | |||||
// public DialogView initView(Context context, int layout) { | |||||
// return new DialogView(context, layout, R.style.CustomDialog, Gravity.CENTER); | |||||
// } | |||||
// | |||||
// public DialogView initView(Context context, int layout, int gravity,Activity activity) { | |||||
// activityMain=activity; | |||||
// return new DialogView(context, layout, R.style.mydialog, gravity); | |||||
// } | |||||
// 显示弹框 | |||||
// public void show(DialogView view) { | |||||
// if (view != null) { | |||||
// if (!view.isShowing()) { | |||||
// view.show(); | |||||
// } | |||||
// } | |||||
// } | |||||
// // 显示弹框 | |||||
// public void show(DialogView view, int closeId) { | |||||
// if (view != null) { | |||||
// if (!view.isShowing()) { | |||||
// if (!view.findViewById(closeId).hasOnClickListeners()) { | |||||
// view.findViewById(closeId).setOnClickListener(new View.OnClickListener() { | |||||
// @Override | |||||
// public void onClick(View view1) { | |||||
// hide(view); | |||||
// } | |||||
// }); | |||||
// } | |||||
// if (activityMain!=null && !activityMain.isFinishing()) { | |||||
// view.show(); | |||||
// } | |||||
// else | |||||
// { | |||||
// MessageLog.ShowUserMessage( UserLogEnum.订单处理日志 ,"弹框Active获取失败"); | |||||
// } | |||||
// } | |||||
// } | |||||
// } | |||||
private static DialogView dview; | |||||
private static Context mContext; | |||||
public static void setContext(Context _ct){ | |||||
mContext = _ct; | |||||
} | |||||
/** | |||||
* 对话框,自定义按钮,非阻塞 | |||||
* */ | |||||
private static void showDialog(String message, AlertDialogButton btn,DialogType dt, IDialogAction action) { | |||||
if(mContext==null) return; | |||||
if(dview==null)dview=new DialogView(mContext, R.layout.activity_dialog, R.style.custom_dialog2); | |||||
if (dview != null) { | |||||
if (!dview.isShowing()) { | |||||
String btnName1="确定"; | |||||
String btnName2="取消"; | |||||
if(btn==AlertDialogButton.YesNoCancel||btn==AlertDialogButton.YesNo){ | |||||
btnName1="是"; | |||||
btnName2="否"; | |||||
} | |||||
dview.setCanceledOnTouchOutside(false);//禁用触摸其它区域关闭弹框 | |||||
RelativeLayout rlTitle = (RelativeLayout) dview.findViewById(R.id.rl_title); | |||||
if(dt== DialogType.提示)rlTitle.setBackgroundResource(R.drawable.dialog_info_title_back); | |||||
if(dt== DialogType.警告)rlTitle.setBackgroundResource(R.drawable.dialog_warn_title_back); | |||||
if(dt== DialogType.错误)rlTitle.setBackgroundResource(R.drawable.dialog_error_title_back); | |||||
TextView Tv=(TextView)dview.findViewById(R.id.tv_Title); | |||||
TextView Info=(TextView)dview.findViewById(R.id.tv_Info); | |||||
Button ok = (Button)dview.findViewById(R.id.btn_ok); | |||||
Button cancel = (Button)dview.findViewById(R.id.btn_cancel); | |||||
Tv.setText(dt.toString()); | |||||
Info.setText(message); | |||||
ok.setText(btnName1); | |||||
cancel.setText(btnName2); | |||||
if(btn==AlertDialogButton.OK)cancel.setVisibility(View.GONE); | |||||
ok.setOnClickListener(view->{ | |||||
if(action!=null)action.ExitDialog(true); | |||||
hide(dview); | |||||
}); | |||||
cancel.setOnClickListener(view->{ | |||||
if(action!=null)action.ExitDialog(false); | |||||
hide(dview); | |||||
}); | |||||
dview.show(); | |||||
} | |||||
} | |||||
} | |||||
// 隐藏弹框 | |||||
private static void hide(DialogView view) { | |||||
if (view != null) { | |||||
if (view.isShowing()) { | |||||
view.dismiss(); | |||||
} | |||||
} | |||||
} | |||||
/** | |||||
* 信息提示框 | |||||
* @param message 提示信息 | |||||
* @param btn 显示按钮 | |||||
* @param action 执行回调 | |||||
*/ | |||||
public static void showInfo(String message, AlertDialogButton btn, IDialogAction action) { | |||||
showDialog(message,btn,DialogType.提示,action); | |||||
} | |||||
/** | |||||
* 警告提示框 | |||||
* @param message 警告信息 | |||||
* @param btn 显示按钮 | |||||
* @param action 执行回调 | |||||
*/ | |||||
public static void showWarn(String message, AlertDialogButton btn, IDialogAction action) { | |||||
showDialog(message,btn,DialogType.警告,action); | |||||
} | |||||
/** | |||||
* 错误提示框 | |||||
* @param message 错误信息 | |||||
* @param btn 显示按钮 | |||||
* @param action 执行回调 | |||||
*/ | |||||
public static void showError(String message, AlertDialogButton btn, IDialogAction action) { | |||||
showDialog(message,btn,DialogType.错误,action); | |||||
} | |||||
} | |||||
@@ -0,0 +1,7 @@ | |||||
package com.bonait.bnframework.Dialog; | |||||
public enum DialogType { | |||||
警告, | |||||
提示, | |||||
错误 | |||||
} |
@@ -0,0 +1,31 @@ | |||||
package com.bonait.bnframework.Dialog; | |||||
import android.app.Dialog; | |||||
import android.content.Context; | |||||
import android.view.Window; | |||||
import androidx.annotation.NonNull; | |||||
public class DialogView extends Dialog { | |||||
public DialogView(@NonNull Context context, int layout, int style, int gravity) { | |||||
super(context, style); | |||||
setContentView(layout); | |||||
Window mWindow = getWindow(); | |||||
// WindowManager.LayoutParams params = mWindow.getAttributes(); | |||||
// params.width = WindowManager.LayoutParams.MATCH_PARENT; | |||||
// params.height = WindowManager.LayoutParams.WRAP_CONTENT; | |||||
// params.gravity = gravity; | |||||
// mWindow.setAttributes(params); | |||||
} | |||||
public DialogView(@NonNull Context context, int layout, int style) { | |||||
super(context, style); | |||||
setContentView(layout); | |||||
Window mWindow = getWindow(); | |||||
// WindowManager.LayoutParams params = mWindow.getAttributes(); | |||||
// params.width = WindowManager.LayoutParams.MATCH_PARENT; | |||||
// params.height = WindowManager.LayoutParams.WRAP_CONTENT; | |||||
// params.gravity = gravity; | |||||
// mWindow.setAttributes(params); | |||||
} | |||||
} |
@@ -37,7 +37,7 @@ public class MainNavigateTabBar extends LinearLayout implements View.OnClickList | |||||
private ColorStateList mSelectedTextColor; | private ColorStateList mSelectedTextColor; | ||||
private ColorStateList mNormalTextColor; | private ColorStateList mNormalTextColor; | ||||
private float mTabTextSize; | private float mTabTextSize; | ||||
private int mDefaultSelectedTab = 2; | |||||
private int mDefaultSelectedTab = 3; | |||||
private int mCurrentSelectedTab; | private int mCurrentSelectedTab; | ||||
public MainNavigateTabBar(Context context) { | public MainNavigateTabBar(Context context) { | ||||
@@ -22,6 +22,7 @@ import com.bonait.bnframework.modules.home.adapter.FragmentAdapter; | |||||
import com.bonait.bnframework.modules.home.fragment.DingDanfragment; | import com.bonait.bnframework.modules.home.fragment.DingDanfragment; | ||||
import com.bonait.bnframework.modules.home.fragment.GongnengFragment; | import com.bonait.bnframework.modules.home.fragment.GongnengFragment; | ||||
import com.bonait.bnframework.modules.home.fragment.HandControlFragment; | import com.bonait.bnframework.modules.home.fragment.HandControlFragment; | ||||
import com.bonait.bnframework.modules.home.fragment.IoMonitorFragment; | |||||
import com.bonait.bnframework.modules.home.fragment.MakeGoodFragment; | import com.bonait.bnframework.modules.home.fragment.MakeGoodFragment; | ||||
import com.bonait.bnframework.modules.home.fragment.SheZhifragment; | import com.bonait.bnframework.modules.home.fragment.SheZhifragment; | ||||
import com.bonait.bnframework.modules.mine.fragment.MyFragment; | import com.bonait.bnframework.modules.mine.fragment.MyFragment; | ||||
@@ -81,7 +82,7 @@ public class BottomNavigationMainActivity extends BaseActivity { | |||||
fragmentList.add(new DingDanfragment()); | fragmentList.add(new DingDanfragment()); | ||||
fragmentList.add(new HandControlFragment()); | fragmentList.add(new HandControlFragment()); | ||||
fragmentList.add(new MakeGoodFragment()); | fragmentList.add(new MakeGoodFragment()); | ||||
fragmentList.add(new HandControlFragment()); | |||||
fragmentList.add(new IoMonitorFragment()); | |||||
fragmentList.add(new SheZhifragment()); | fragmentList.add(new SheZhifragment()); | ||||
fragmentList.add(new MyFragment()); | fragmentList.add(new MyFragment()); | ||||
ConfigName.getInstance().fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(), fragmentList); | ConfigName.getInstance().fragmentAdapter = new FragmentAdapter(getSupportFragmentManager(), fragmentList); | ||||
@@ -0,0 +1,15 @@ | |||||
package com.bonait.bnframework.modules.home.activity; | |||||
import android.os.Bundle; | |||||
import androidx.appcompat.app.AppCompatActivity; | |||||
import com.bonait.bnframework.R; | |||||
public class DialogActivity extends AppCompatActivity { | |||||
@Override | |||||
protected void onCreate(Bundle savedInstanceState) { | |||||
super.onCreate(savedInstanceState); | |||||
setContentView(R.layout.activity_dialog); | |||||
} | |||||
} |
@@ -22,6 +22,7 @@ import androidx.annotation.Nullable; | |||||
import androidx.recyclerview.widget.RecyclerView; | import androidx.recyclerview.widget.RecyclerView; | ||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager; | import androidx.recyclerview.widget.StaggeredGridLayoutManager; | ||||
import com.bonait.bnframework.Dialog.DialogManager; | |||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.business.ConfigData; | import com.bonait.bnframework.business.ConfigData; | ||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | import com.bonait.bnframework.business.ExecuteTheRecipe; | ||||
@@ -97,6 +98,7 @@ public class HandControlFragment extends BaseFragment { | |||||
ExecuteTheRecipe.mainContext=context; | ExecuteTheRecipe.mainContext=context; | ||||
ExecuteTheRecipe.mainActivity=activity; | ExecuteTheRecipe.mainActivity=activity; | ||||
AlertDialogUtils.getContext=context; | AlertDialogUtils.getContext=context; | ||||
DialogManager.setContext(context); | |||||
NotifyProp(); | NotifyProp(); | ||||
Init_弹窗(); | Init_弹窗(); | ||||
StatusOrMakeGoodThread(); | StatusOrMakeGoodThread(); | ||||
@@ -288,7 +290,8 @@ public class HandControlFragment extends BaseFragment { | |||||
switch (view.getId()) { | switch (view.getId()) { | ||||
case R.id.button_出料: | case R.id.button_出料: | ||||
if (!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()) { | if (!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()) { | ||||
AlertDialogUtils.showDialog(context, "提示", "系统未启动,请启动后重试!"); | |||||
// AlertDialogUtils.showDialog(context, "提示", "系统未启动,请启动后重试!"); | |||||
DialogManager.showWarn("系统未启动,请启动后重试!",AlertDialogButton.OK,null); | |||||
return ; | return ; | ||||
} | } | ||||
Convert.TryToFloat(edit_设定重量.getText()).OnSource((s)-> | Convert.TryToFloat(edit_设定重量.getText()).OnSource((s)-> | ||||
@@ -299,12 +302,14 @@ public class HandControlFragment extends BaseFragment { | |||||
ExecuteTheRecipe.showlog("手动设定提前量:"+t.Content); | ExecuteTheRecipe.showlog("手动设定提前量:"+t.Content); | ||||
ExecuteTheRecipe.DischargeControlAsync(s.Content,t.Content); | ExecuteTheRecipe.DischargeControlAsync(s.Content,t.Content); | ||||
}).OnFailed(p->{ | }).OnFailed(p->{ | ||||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
// AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
DialogManager.showError("输入的数据格式不匹配,请重试!",AlertDialogButton.OK,null); | |||||
edit_提前量.setText("0.0"); | edit_提前量.setText("0.0"); | ||||
}); | }); | ||||
}).OnFailed(f->{ | }).OnFailed(f->{ | ||||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
// AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
DialogManager.showError("输入的数据格式不匹配,请重试!",AlertDialogButton.OK,null); | |||||
edit_设定重量.setText("0.0"); | edit_设定重量.setText("0.0"); | ||||
}); | }); | ||||
break; | break; | ||||
@@ -318,7 +323,8 @@ public class HandControlFragment extends BaseFragment { | |||||
ExecuteTheRecipe.showlog("手动设置温度修正值:"+s.Content); | ExecuteTheRecipe.showlog("手动设置温度修正值:"+s.Content); | ||||
ExecuteTheRecipe.WriteAsync("炒锅温度修正",s.Content); | ExecuteTheRecipe.WriteAsync("炒锅温度修正",s.Content); | ||||
}).OnFailed(f->{ | }).OnFailed(f->{ | ||||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
// AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
DialogManager.showError("输入的数据格式不匹配,请重试!",AlertDialogButton.OK,null); | |||||
edit_温度修正.setText("0.0"); | edit_温度修正.setText("0.0"); | ||||
}); | }); | ||||
Convert.TryToFloat(edit_温度上限.getText()).OnSource((s)-> | Convert.TryToFloat(edit_温度上限.getText()).OnSource((s)-> | ||||
@@ -326,7 +332,8 @@ public class HandControlFragment extends BaseFragment { | |||||
ExecuteTheRecipe.showlog("手动设置温度上限值:"+s.Content); | ExecuteTheRecipe.showlog("手动设置温度上限值:"+s.Content); | ||||
ExecuteTheRecipe.WriteAsync("炒锅温度上限设置",s.Content); | ExecuteTheRecipe.WriteAsync("炒锅温度上限设置",s.Content); | ||||
}).OnFailed(p->{ | }).OnFailed(p->{ | ||||
AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
// AlertDialogUtils.showDialog(context, "提示", "输入的数据格式不匹配,请重试!"); | |||||
DialogManager.showError("输入的数据格式不匹配,请重试!",AlertDialogButton.OK,null); | |||||
edit_温度上限.setText("0.0"); | edit_温度上限.setText("0.0"); | ||||
}); | }); | ||||
break; | break; | ||||
@@ -370,7 +377,8 @@ public class HandControlFragment extends BaseFragment { | |||||
if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | ||||
if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){ | if(motionEvent.getAction() == MotionEvent.ACTION_DOWN){ | ||||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,(s)->{}); | |||||
// AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,(s)->{}); | |||||
DialogManager.showWarn("系统未启动,请启动后重试!",AlertDialogButton.OK,null); | |||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
@@ -550,7 +558,8 @@ public class HandControlFragment extends BaseFragment { | |||||
private void DeviceControl(boolean isChecked,String name){ | private void DeviceControl(boolean isChecked,String name){ | ||||
if(isChecked&&!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | if(isChecked&&!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | ||||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||||
// AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||||
DialogManager.showWarn("系统未启动,请启动后重试!",AlertDialogButton.OK,null); | |||||
} | } | ||||
ExecuteTheRecipe.showlog("手动操作-"+name+",值:"+isChecked); | ExecuteTheRecipe.showlog("手动操作-"+name+",值:"+isChecked); | ||||
ExecuteTheRecipe.WriteAsync(name,isChecked); | ExecuteTheRecipe.WriteAsync(name,isChecked); | ||||
@@ -577,7 +586,8 @@ public class HandControlFragment extends BaseFragment { | |||||
boolean temp=!ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.getValue(); | boolean temp=!ExecuteTheRecipe.getDeviceData.StirControlStatusNotify.getValue(); | ||||
if (temp) { | if (temp) { | ||||
if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | if(!ExecuteTheRecipe.getDeviceData.SystemStartStopStatusNotify.getValue()){ | ||||
AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||||
// AlertDialogUtils.showDialog("系统未启动,请启动后重试!", AlertDialogButton.OK,null); | |||||
DialogManager.showWarn("系统未启动,请启动后重试!",AlertDialogButton.OK,null); | |||||
} | } | ||||
ExecuteTheRecipe.showlog("手动启动搅拌"); | ExecuteTheRecipe.showlog("手动启动搅拌"); | ||||
ExecuteTheRecipe.BottomClickAsync("搅拌启动开关"); | ExecuteTheRecipe.BottomClickAsync("搅拌启动开关"); | ||||
@@ -0,0 +1,62 @@ | |||||
package com.bonait.bnframework.modules.home.fragment; | |||||
import android.app.Activity; | |||||
import android.content.Context; | |||||
import android.os.Bundle; | |||||
import android.view.LayoutInflater; | |||||
import android.view.MotionEvent; | |||||
import android.view.View; | |||||
import android.widget.Button; | |||||
import android.widget.EditText; | |||||
import android.widget.ImageView; | |||||
import android.widget.RadioButton; | |||||
import android.widget.TextView; | |||||
import androidx.annotation.NonNull; | |||||
import androidx.annotation.Nullable; | |||||
import com.bonait.bnframework.Dialog.DialogManager; | |||||
import com.bonait.bnframework.R; | |||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||||
import com.bonait.bnframework.common.base.BaseFragment; | |||||
import com.bonait.bnframework.common.db.QueryDB; | |||||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||||
import com.bonait.bnframework.common.db.res.StatusMode; | |||||
import com.bonait.bnframework.common.helper.AlertDialogButton; | |||||
import com.bonait.bnframework.common.helper.Convert; | |||||
import com.bonait.bnframework.common.helper.CountDownTimerExt; | |||||
import com.bonait.bnframework.common.helper.I.IThread; | |||||
import com.bonait.bnframework.common.helper.MessageLog; | |||||
import com.bonait.bnframework.common.helper.ThreadManager; | |||||
import com.bonait.bnframework.common.modbus.s7.CommHelper; | |||||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||||
import com.bonait.bnframework.common.utils.ToastUtils; | |||||
import com.bonait.bnframework.modules.home.adapter.devicestatus_adapter; | |||||
import com.litao.slider.NiftySlider; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import butterknife.BindView; | |||||
import butterknife.ButterKnife; | |||||
import butterknife.OnClick; | |||||
public class IoMonitorFragment extends BaseFragment { | |||||
public IoMonitorFragment() { | |||||
} | |||||
@Override | |||||
protected View onCreateView() { | |||||
View root = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_io_monitor, null); | |||||
ButterKnife.bind(this, root); | |||||
return root; | |||||
} | |||||
@Override | |||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { | |||||
super.onViewCreated(view, savedInstanceState); | |||||
} | |||||
} |
@@ -26,6 +26,8 @@ import android.widget.RelativeLayout; | |||||
import android.widget.Spinner; | import android.widget.Spinner; | ||||
import android.widget.TextView; | import android.widget.TextView; | ||||
import com.bonait.bnframework.Dialog.DialogManager; | |||||
import com.bonait.bnframework.Dialog.DialogType; | |||||
import com.bonait.bnframework.R; | import com.bonait.bnframework.R; | ||||
import com.bonait.bnframework.business.ConfigData; | import com.bonait.bnframework.business.ConfigData; | ||||
import com.bonait.bnframework.business.ExecuteTheRecipe; | import com.bonait.bnframework.business.ExecuteTheRecipe; | ||||
@@ -166,6 +168,7 @@ public class MakeGoodFragment extends BaseFragment { | |||||
NotifyProp(); | NotifyProp(); | ||||
initTopBar(); | initTopBar(); | ||||
Initdata(); | Initdata(); | ||||
DialogManager.setContext(context); | |||||
CommHelper.get().ConnectOk = new IRun() { | CommHelper.get().ConnectOk = new IRun() { | ||||
@Override | @Override | ||||
public void Run() { | public void Run() { | ||||
@@ -407,9 +410,14 @@ public class MakeGoodFragment extends BaseFragment { | |||||
switch (view.getId()) { | switch (view.getId()) { | ||||
case R.id.xzcp://选择菜谱按钮点击 | case R.id.xzcp://选择菜谱按钮点击 | ||||
skipToActivity(CpxzActivity.class); | skipToActivity(CpxzActivity.class); | ||||
break; | break; | ||||
case R.id.btn_xtkz: | case R.id.btn_xtkz: | ||||
SetVisibility(1); | |||||
// SetVisibility(1); | |||||
break; | break; | ||||
// case R.id.btn_hlkz: | // case R.id.btn_hlkz: | ||||
// SetVisibility(2); | // SetVisibility(2); | ||||
@@ -683,7 +691,7 @@ public class MakeGoodFragment extends BaseFragment { | |||||
public void onRecordStop() { | public void onRecordStop() { | ||||
getActivity().runOnUiThread(()->{ | getActivity().runOnUiThread(()->{ | ||||
if (good != null) { | if (good != null) { | ||||
startbutton.setText("开始烹饪"); | |||||
startbutton.setText("开始炒制"); | |||||
startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected); | startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected); | ||||
xzcp.setVisibility(View.VISIBLE); | xzcp.setVisibility(View.VISIBLE); | ||||
@@ -967,7 +975,7 @@ public class MakeGoodFragment extends BaseFragment { | |||||
InitStatusdata(); | InitStatusdata(); | ||||
//2. | //2. | ||||
SetProcesssUI(0); | SetProcesssUI(0); | ||||
startbutton.setText("开始烹饪"); | |||||
startbutton.setText("开始炒制"); | |||||
startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected); | startbutton.setBackgroundResource(R.drawable.bg_btn_login_selected); | ||||
SetVisibility(0); | SetVisibility(0); | ||||
SetProcessDescription("等待开始..."); | SetProcessDescription("等待开始..."); | ||||
@@ -38,12 +38,12 @@ public class SystemParameterActivity extends BaseActivity { | |||||
EditText edittext1; | EditText edittext1; | ||||
@BindView(R.id.edittext2) | @BindView(R.id.edittext2) | ||||
EditText edittext2; | EditText edittext2; | ||||
@BindView(R.id.edittext3) | |||||
EditText edittext3; | |||||
@BindView(R.id.edittext4) | |||||
EditText edittext4; | |||||
// @BindView(R.id.edittext3) | |||||
// EditText edittext3; | |||||
// @BindView(R.id.edittext4) | |||||
// EditText edittext4; | |||||
// @BindView(R.id.environment) | // @BindView(R.id.environment) | ||||
Spinner environment; | |||||
// Spinner environment; | |||||
@BindView(R.id.versionselection) | @BindView(R.id.versionselection) | ||||
Spinner versionselection; | Spinner versionselection; | ||||
@@ -88,8 +88,8 @@ public class SystemParameterActivity extends BaseActivity { | |||||
private void initData() { | private void initData() { | ||||
editTextLists.add(edittext1); | editTextLists.add(edittext1); | ||||
editTextLists.add(edittext2); | editTextLists.add(edittext2); | ||||
editTextLists.add(edittext3); | |||||
editTextLists.add(edittext4); | |||||
// editTextLists.add(edittext3); | |||||
// editTextLists.add(edittext4); | |||||
material_map.put("开发环境", 0); | material_map.put("开发环境", 0); | ||||
material_map.put("测试环境", 1); | material_map.put("测试环境", 1); | ||||
@@ -102,7 +102,7 @@ public class SystemParameterActivity extends BaseActivity { | |||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map.keySet())); | ArrayAdapter<String> adapter = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map.keySet())); | ||||
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | ||||
environment.setAdapter(adapter); | |||||
// environment.setAdapter(adapter); | |||||
ArrayAdapter<String> adapter1 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map_vis.keySet())); | ArrayAdapter<String> adapter1 = new ArrayAdapter<>(context, R.layout.spinner_text_item, new ArrayList<>(material_map_vis.keySet())); | ||||
adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); | adapter1.setDropDownViewResource(R.layout.spinner_dropdown_item); | ||||
@@ -118,7 +118,7 @@ public class SystemParameterActivity extends BaseActivity { | |||||
break; | break; | ||||
case -99: | case -99: | ||||
ConfigName.getInstance().Environment = item.value; | ConfigName.getInstance().Environment = item.value; | ||||
environment.setSelection(material_map.get(item.value)); | |||||
// environment.setSelection(material_map.get(item.value)); | |||||
break; | break; | ||||
case 1: | case 1: | ||||
ConfigName.getInstance().Address = item.value; | ConfigName.getInstance().Address = item.value; | ||||
@@ -130,11 +130,11 @@ public class SystemParameterActivity extends BaseActivity { | |||||
break; | break; | ||||
case 3: | case 3: | ||||
ConfigName.getInstance().ClientAutoKey = item.value; | ConfigName.getInstance().ClientAutoKey = item.value; | ||||
edittext3.setText(item.value); | |||||
// edittext3.setText(item.value); | |||||
break; | break; | ||||
case 4: | case 4: | ||||
ConfigName.getInstance().DeviceAutoKey = item.value; | ConfigName.getInstance().DeviceAutoKey = item.value; | ||||
edittext4.setText(item.value); | |||||
// edittext4.setText(item.value); | |||||
break; | break; | ||||
} | } | ||||
@@ -155,10 +155,10 @@ public class SystemParameterActivity extends BaseActivity { | |||||
case R.id.StartButton://保存按钮 | case R.id.StartButton://保存按钮 | ||||
ConfigName.getInstance().Address = edittext1.getText().toString(); | ConfigName.getInstance().Address = edittext1.getText().toString(); | ||||
ConfigName.getInstance().Post = Integer.parseInt(edittext2.getText().toString()); | ConfigName.getInstance().Post = Integer.parseInt(edittext2.getText().toString()); | ||||
ConfigName.getInstance().ClientAutoKey = edittext3.getText().toString(); | |||||
ConfigName.getInstance().DeviceAutoKey = edittext4.getText().toString(); | |||||
// ConfigName.getInstance().ClientAutoKey = edittext3.getText().toString(); | |||||
// ConfigName.getInstance().DeviceAutoKey = edittext4.getText().toString(); | |||||
ConfigName.getInstance().Environment = environment.getSelectedItem().toString(); | |||||
// ConfigName.getInstance().Environment = environment.getSelectedItem().toString(); | |||||
boolean isgb = false; | boolean isgb = false; | ||||
if (!ConfigName.getInstance().versionSelectionEnum.equals(versionselection.getSelectedItem().toString())) { | if (!ConfigName.getInstance().versionSelectionEnum.equals(versionselection.getSelectedItem().toString())) { | ||||
@@ -180,7 +180,7 @@ public class SystemParameterActivity extends BaseActivity { | |||||
} | } | ||||
BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | BPA_SYSTEMSET set = new BPA_SYSTEMSET(); | ||||
set.type = -99; | set.type = -99; | ||||
set.value = environment.getSelectedItem().toString(); | |||||
// set.value = environment.getSelectedItem().toString(); | |||||
set.deviceID = ConfigName.getInstance().DeviceId; | set.deviceID = ConfigName.getInstance().DeviceId; | ||||
set.userID = ConfigName.getInstance().user.userID; | set.userID = ConfigName.getInstance().user.userID; | ||||
QueryDB.AddSystemset(set); | QueryDB.AddSystemset(set); | ||||
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<corners android:radius="10dp"/> | |||||
<solid android:color="#ffffff"/> | |||||
</shape> |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp"/> | |||||
<solid android:color="#ff6d61"/> | |||||
</shape> |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp"/> | |||||
<solid android:color="#00a8b3"/> | |||||
</shape> |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |||||
<corners android:topLeftRadius="10dp" android:topRightRadius="10dp"/> | |||||
<solid android:color="#feb322"/> | |||||
</shape> |
@@ -0,0 +1,89 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||||
xmlns:tools="http://schemas.android.com/tools" | |||||
android:layout_width="500dp" | |||||
android:layout_height="300dp" | |||||
android:columnCount="1" | |||||
android:rowCount="3" | |||||
android:orientation="vertical" | |||||
android:background="@drawable/dialog_back" | |||||
tools:context=".modules.home.activity.DialogActivity"> | |||||
<RelativeLayout | |||||
android:id="@+id/rl_title" | |||||
android:layout_width="match_parent" | |||||
android:layout_row="0" | |||||
android:background="@drawable/dialog_info_title_back" | |||||
android:layout_height="50dp"> | |||||
<TextView | |||||
android:id="@+id/tv_Title" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="match_parent" | |||||
android:layout_marginLeft="10dp" | |||||
android:gravity="center" | |||||
android:textColor="@color/white" | |||||
android:text="标题" | |||||
android:textSize="30sp"/> | |||||
<!-- <Button--> | |||||
<!-- android:layout_width="match_parent"--> | |||||
<!-- android:layout_alignParentBottom="true"--> | |||||
<!-- android:background="@color/gray"--> | |||||
<!-- android:enabled="false"--> | |||||
<!-- android:layout_height="1dp"/>--> | |||||
</RelativeLayout> | |||||
<TextView | |||||
android:id="@+id/tv_Info" | |||||
android:layout_margin="10dp" | |||||
android:layout_row="1" | |||||
android:layout_rowWeight="1" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="wrap_content" | |||||
android:textColor="@color/color4" | |||||
android:text="提示信息" | |||||
android:textSize="@dimen/textSize"/> | |||||
<RelativeLayout | |||||
android:layout_width="match_parent" | |||||
android:layout_row="2" | |||||
android:layout_marginBottom="20dp" | |||||
android:layout_height="50dp"> | |||||
<LinearLayout | |||||
android:layout_width="match_parent" | |||||
android:orientation="horizontal" | |||||
android:layout_marginRight="20dp" | |||||
android:gravity="right" | |||||
android:layout_height="match_parent"> | |||||
<Button | |||||
android:id="@+id/btn_ok" | |||||
android:layout_width="120dp" | |||||
android:layout_marginRight="10dp" | |||||
android:textColor="@color/white" | |||||
android:background="@drawable/bg_btn_login_selected" | |||||
android:text="确认" | |||||
android:textSize="@dimen/textSize" | |||||
android:layout_height="match_parent"/> | |||||
<Button | |||||
android:id="@+id/btn_cancel" | |||||
android:layout_width="120dp" | |||||
android:text="取消" | |||||
android:layout_marginLeft="10dp" | |||||
android:background="#c1c1c1" | |||||
android:textColor="@color/white" | |||||
android:padding="0dp" | |||||
android:textSize="@dimen/textSize" | |||||
android:layout_height="match_parent"/> | |||||
</LinearLayout> | |||||
</RelativeLayout> | |||||
</GridLayout> |
@@ -328,7 +328,7 @@ | |||||
android:layout_width="match_parent" | android:layout_width="match_parent" | ||||
android:layout_height="45dp" | android:layout_height="45dp" | ||||
android:background="@drawable/bg_btn_login_selected" | android:background="@drawable/bg_btn_login_selected" | ||||
android:text="生成菜谱" | |||||
android:text="生成配方" | |||||
tools:ignore="TouchTargetSizeCheck" | tools:ignore="TouchTargetSizeCheck" | ||||
android:textColor="@color/white" | android:textColor="@color/white" | ||||
android:textSize="@dimen/textSize" /> | android:textSize="@dimen/textSize" /> | ||||
@@ -0,0 +1,21 @@ | |||||
<?xml version="1.0" encoding="utf-8"?> | |||||
<com.qmuiteam.qmui.widget.QMUIWindowInsetLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
xmlns:app="http://schemas.android.com/apk/res-auto" | |||||
xmlns:tools="http://schemas.android.com/tools" | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:layout_marginTop="?attr/qmui_topbar_height" | |||||
android:background="@color/main_background"> | |||||
<TextView | |||||
android:layout_width="match_parent" | |||||
android:layout_height="match_parent" | |||||
android:text="开发中" | |||||
android:textSize="50dp"/> | |||||
<!-- <com.qmuiteam.qmui.widget.QMUITopBarLayout--> | |||||
<!-- android:id="@+id/topbar"--> | |||||
<!-- android:layout_width="match_parent"--> | |||||
<!-- android:layout_height="wrap_content"--> | |||||
<!-- android:background="@color/app_color_blue" />--> | |||||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -244,7 +244,7 @@ | |||||
android:layout_width="120dp" | android:layout_width="120dp" | ||||
android:layout_height="45dp" | android:layout_height="45dp" | ||||
android:background="@drawable/bg_btn_login_selected" | android:background="@drawable/bg_btn_login_selected" | ||||
android:text="选择菜品" | |||||
android:text="选择配方" | |||||
android:textColor="@color/white" | android:textColor="@color/white" | ||||
android:textSize="18sp" /> | android:textSize="18sp" /> | ||||
<Button | <Button | ||||
@@ -23,4 +23,30 @@ | |||||
<attr name="app_skin_span_normal_bg_color" format="color"/> | <attr name="app_skin_span_normal_bg_color" format="color"/> | ||||
<attr name="app_skin_span_pressed_bg_color" format="color"/> | <attr name="app_skin_span_pressed_bg_color" format="color"/> | ||||
<attr name="app_skin_alpha_test" format="float"/> | <attr name="app_skin_alpha_test" format="float"/> | ||||
<!--自定义dialog背景全透明无边框theme --> | |||||
<style name="CustomDialog" parent="android:style/Theme.Dialog"> | |||||
<!--背景颜色及和透明程度--> | |||||
<item name="android:windowBackground">@android:color/transparent</item> | |||||
<!--是否去除标题 --> | |||||
<item name="android:windowNoTitle">true</item> | |||||
<!--是否去除边框--> | |||||
<item name="android:windowFrame">@null</item> | |||||
<!--是否浮现在activity之上--> | |||||
<item name="android:windowIsFloating">true</item> | |||||
<!--是否模糊--> | |||||
<item name="android:backgroundDimEnabled">true</item> | |||||
</style> | |||||
<!--自定义dialog背景弹框设置--> | |||||
<style name="mydialog" parent="android:style/Theme.Dialog"> | |||||
<!-- 背景透明,设置圆角对话框必须设置背景透明,否则四角会有背景色小块--> | |||||
<item name="android:windowBackground">@android:color/transparent</item> | |||||
<!-- 没有标题 --> | |||||
<item name="android:windowNoTitle">true</item> | |||||
<!-- 背景模糊 --> | |||||
<item name="android:backgroundDimEnabled">true</item> | |||||
</style> | |||||
</resources> | </resources> |