From b1778e4f776360f7653856f22b4864b328499ebe Mon Sep 17 00:00:00 2001 From: fyf Date: Mon, 3 Jul 2023 17:20:20 +0800 Subject: [PATCH] =?UTF-8?q?diy=E5=8A=9F=E8=83=BD22?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/fragment/from/DiyActivity.java | 47 +++++++++- .../home/fragment/mode/fragment_gx.java | 1 + app/src/main/res/layout/activity_diy.xml | 94 +++++++++++-------- 3 files changed, 98 insertions(+), 44 deletions(-) diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java index bb61adba..5e9e3af4 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/DiyActivity.java @@ -18,11 +18,14 @@ import android.widget.Spinner; import com.bonait.bnframework.R; import com.bonait.bnframework.common.base.BaseActivity; +import com.bonait.bnframework.common.constant.MessageName; import com.bonait.bnframework.common.db.QueryDB; import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; import com.bonait.bnframework.common.db.mode.BPA_PROCESS; import com.bonait.bnframework.common.db.mode.BPA_PROCESSModel; import com.bonait.bnframework.common.helper.MyImage; +import com.bonait.bnframework.common.message.MessageManager; +import com.bonait.bnframework.common.utils.ToastUtils; import com.bonait.bnframework.modules.home.fragment.mode.fragment_gx; import com.bonait.bnframework.modules.home.fragment.mode.item_gx; import com.qmuiteam.qmui.widget.QMUITopBar; @@ -40,6 +43,7 @@ import java.util.Map; import butterknife.BindView; import butterknife.ButterKnife; +import butterknife.OnClick; public class DiyActivity extends BaseActivity { @BindView(R.id.topbar) @@ -55,7 +59,6 @@ public class DiyActivity extends BaseActivity { @BindView(R.id.gxchid) LinearLayout gxchid;//工序子集 - @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -90,7 +93,6 @@ public class DiyActivity extends BaseActivity { }); //3. } - /** * 根据选中工序id显示集合 * @param id @@ -132,7 +134,6 @@ public class DiyActivity extends BaseActivity { } } - private void initTopBar() { mTopBar.setTitle("DIY模式"); mTopBar.addLeftImageButton(R.mipmap.fanhui,R.id.topbar).setOnClickListener(new View.OnClickListener() { @@ -161,11 +162,49 @@ public class DiyActivity extends BaseActivity { //setImageLoader(一个实体类)用于加载图片到手机页面上显示 Banner_Main.setImages(Banner_list).setImageLoader(new MyImage()).start(); } + + /** + * 点击事件 + * @param view + */ + @OnClick({R.id.add_hrgx,R.id.update_gx,R.id.delete_gx,R.id.shangyi,R.id.xiayi,R.id.caozuomoshi,R.id.shengchengcaipu}) + public void onViewClicked(View view) { + switch (view.getId()) { + case R.id.add_hrgx://添加工序 + + ToastUtils.info("添加工序"); + break; + case R.id.update_gx://修改工序 + + ToastUtils.info("修改工序"); + break; + case R.id.delete_gx://删除工序 + + ToastUtils.info("删除工序"); + break; + case R.id.shangyi://上移 + + ToastUtils.info("上移"); + break; + case R.id.xiayi://下移 + + ToastUtils.info("下移"); + break; + case R.id.caozuomoshi://操作模式 + + ToastUtils.info("操作模式"); + break; + case R.id.shengchengcaipu://生成菜谱 + + ToastUtils.info("生成菜谱"); + break; + } + } + @Override public void onDestroy() { super.onDestroy(); } - @Override protected boolean canDragBack() { return false; diff --git a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_gx.java b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_gx.java index 679c0397..7d3f1d52 100644 --- a/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_gx.java +++ b/app/src/main/java/com/bonait/bnframework/modules/home/fragment/mode/fragment_gx.java @@ -56,6 +56,7 @@ public class fragment_gx extends LinearLayout { { check.setVisibility(View.GONE); } + check.setChecked(false); switch (model.datatype) { case 0://数字 diff --git a/app/src/main/res/layout/activity_diy.xml b/app/src/main/res/layout/activity_diy.xml index de559867..79edb7bc 100644 --- a/app/src/main/res/layout/activity_diy.xml +++ b/app/src/main/res/layout/activity_diy.xml @@ -121,6 +121,7 @@ android:layout_height="wrap_content" android:text="步骤:"/>