Browse Source

修改

桌面小炒机
liup 7 months ago
parent
commit
18a2d6a1a8
3 changed files with 509 additions and 12 deletions
  1. +338
    -0
      app/src/main/java/com/bonait/bnframework/ui/activity/CookingActivity.java
  2. +171
    -0
      app/src/main/res/layout/activity_cook.xml
  3. +0
    -12
      app/src/main/res/layout/fragment_home_foods.xml

+ 338
- 0
app/src/main/java/com/bonait/bnframework/ui/activity/CookingActivity.java View File

@@ -0,0 +1,338 @@
//package com.bonait.bnframework.ui.activity;
//
//import android.app.Activity;
//import android.content.Context;
//import android.content.Intent;
//import android.os.Bundle;
//import android.view.View;
//
//import androidx.annotation.Nullable;
//import androidx.core.content.ContextCompat;
//
//import com.apkfuns.logutils.LogUtils;
//import com.bonait.bnframework.HBL.Interface.IRunT;
//import com.bonait.bnframework.R;
//import com.bonait.bnframework.ViewModel.CustomView.imagebuttom3;
//import com.bonait.bnframework.business.ExecuteTheRecipe;
//import com.bonait.bnframework.common.base.BaseActivity;
//import com.bonait.bnframework.common.constant.MessageName;
//import com.bonait.bnframework.common.db.mode.BPA_GOODS;
//import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
//import com.bonait.bnframework.common.db.util.GoodsDBUtil;
//import com.bonait.bnframework.common.db.util.SubAttributeGroupDBUtil;
//import com.bonait.bnframework.common.helper.I.MyClickListener;
//import com.bonait.bnframework.common.message.MessageManager;
//import com.bonait.bnframework.common.utils.ToastUtils;
//import com.bonait.bnframework.databinding.ActivityCookBinding;
//
//import butterknife.ButterKnife;
//import butterknife.OnClick;
//
//public class CookingActivity extends BaseActivity {
//
// private ActivityCookBinding viewBinding;
//
// private Context contextMian;
// private View root;
// private StringBuffer stringBuffer1 = new StringBuffer();
// /**
// * 商品id
// */
// private String goodId = "";
// /**
// * 子属性组合id 属性组合名称
// */
// private String subAttributeGroupId = "";
// private String subAttributeGroupName = "";
// private BPA_GOODS goods;
// private BPA_GOODS_SUBATTRIBUTE_GROUP goodsSubattributeGroup;
//
//
// @Override
// protected void onCreate(@Nullable Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
//
// viewBinding = ActivityCookBinding.inflate(getLayoutInflater());
// setContentView(viewBinding.getRoot());
// ButterKnife.bind(this);
// initTopBar();
// SxUIThread();
// Intent intent = new Intent();
// goodId = intent.getStringExtra("goodId");
// subAttributeGroupId = intent.getStringExtra("subAttributeGroupId");
// subAttributeGroupName = intent.getStringExtra("subAttributeGroupName");
// goods = GoodsDBUtil.getById(goodId);
// goodsSubattributeGroup = SubAttributeGroupDBUtil.getByGoodIdAndListId(goodId,subAttributeGroupId);
// initData();
// }
//
// //region 公共方法
//
// /**
// * 初始化数据
// */
// public void initData( MyClickListener listener) {
// String name = subAttributeGroupName.isEmpty()?goods.name:(goods.name+"-"+subAttributeGroupName);
// viewBinding.goodname.setText(name);
// viewBinding.startGoodmake.mListener = listener;
// SetReset();
// SetRest1();
// SetProcess(goods.maketime, 0);
// SetMiaoShu("等待开始...");
// LogUtils.d("制作时长goods.maketime="+goods.maketime);
// viewBinding.runtime.setText(formatTime(goods.maketime));
//
//// if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) {
//// touliao_k.setVisibility(View.GONE);
//// touliao_m.setVisibility(View.GONE);
//// device_image.setImageResource(R.mipmap.device00);
//// }else
//// {
//// touliao_k.setVisibility(View.VISIBLE);
//// touliao_m.setVisibility(View.VISIBLE);
//// device_image.setImageResource(R.mipmap.device1);
//// }
// }
//
// /**
// * 设置描述
// *
// * @param text
// */
// public void SetMiaoShu(String text) {
// gongxumiaoshu.setText(text + "");
// stringBuffer1.append(" \n工序:"+text);
// text1.setText(stringBuffer1+"");
// }
//
// /**
// * 设置进度条
// *
// * @param
// */
// public void SetProcess(int alltime, int usertime) {
// try {
// if(alltime!=0){
// t_jindu.SetValue((usertime * 100) / alltime);
// }
// runtime.setText(formatTime((alltime - usertime)));
// } catch (Exception ex) {
// LogUtils.d("异常信息:" + ex.getMessage());
// ToastUtils.error("异常信息:" + ex.getMessage());
// }
// }
//
// /**
// * 复位
// */
// public void SetReset() {
// SetMiaoShu("等待开始...");
// stringBuffer1 = new StringBuffer();
//// zanting_goodmake.SetStatus(false);
//// zanting_goodmake.setVisibility(View.GONE);
// }
//
// /**
// * 复位
// */
// public void SetZanTing(boolean data) {
//// zanting_goodmake.setVisibility(data ? View.VISIBLE : View.GONE);
// }
//
// public void SetRest1() {
// stringBuffer1 = new StringBuffer();
// start_goodmake.SetStatus(false);
// if(flicker_buttom!=null)
// {
// flicker_buttom.setVisibility(View.VISIBLE);
// flicker_buttom.SetStatusKK(false);
// flicker_buttom=null;
// }
//// huoli.SetLevel(0);
// }
// //endregion
//
// //region 私有方法
//
// /**
// * 将毫秒转化为 分钟:秒 的格式 100* 1000
// *
// * @param millisecond 毫秒
// * @return
// */
// public String formatTime(long millisecond) {
// int minute;//分钟
// int second;//秒数
// minute = (int) ((millisecond / 1) / 60);
// second = (int) ((millisecond / 1) % 60);
// if (minute < 10) {
// if (second < 10) {
// return "0" + minute + " : " + "0" + second;
// } else {
// return "0" + minute + " : " + second;
// }
// } else {
// if (second < 10) {
// return minute + " : " + "0" + second;
// } else {
// return minute + " : " + second;
// }
// }
// }
//
// /**
// * 初始化顶部弹框
// */
// private void initTopBar() {
// mTopBar.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.topbj1));
// mTopBar.setTitle("菜谱烹饪");
// mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new OnClickListener() {
// @Override
// public void onClick(View view) {
// if (ExecuteTheRecipe.IsStart) {
// ToastUtils.warning("请等待制作完成后退出...");
// return;
// }
// setVisibility(View.GONE);
// }
// });
// }
//
// /**
// * 点击事件
// *
// * @param view
// */
// @OnClick({R.id.kancaipu})
// public void onViewClicked(View view) {
// switch (view.getId()) {
// case R.id.kancaipu://看菜谱
// MessageManager.getInstance().sendMessage(MessageName.SelectZY, 0);
// break;
// }
// }
//
// /**
// * 闪烁buttom
// */
// public imagebuttom3 flicker_buttom=null;
// /**
// * 刷新UI界面
// */
// public void SxUIThread() {
// new Thread(new Runnable() {
// @Override
// public void run() {
//
// while (true) {
// try {
// if (activity != null && getVisibility() == View.VISIBLE) {
// activity.runOnUiThread(new Runnable() {
// @Override
// public void run() {
// Object val_wd = ExecuteTheRecipe.getListingValue("当前锅底温度");
// if (val_wd != null) {
//// chaoguo_wendu.setText(val_wd + "°C");
// } else {
//// chaoguo_wendu.setText("??°C");
// }
//
// //闪烁
// if (flicker_buttom != null) {
// flicker_buttom.setVisibility(flicker_buttom.getVisibility() == View.VISIBLE ? View.INVISIBLE : View.VISIBLE);
// }
// }
// });
// }
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// LogUtils.d("异常信息:" + e.getMessage());
// ToastUtils.info("异常信息:" + e.getMessage());
// }
// }
// }
// }).start();
//
// ExecuteTheRecipe.ExecuteCurrentOperation=new IRunT() {
// @Override
// public void Run(Object o) {
// String data=(String)o;
// if (activity != null && getVisibility() == View.VISIBLE) {
// activity.runOnUiThread(new Runnable() {
// @Override
// public void run() {
// if(data.contains("|"))
// {
// String[] K= data.split("[|]");
// if (K.length>=2)
// {
// String name=K[0];
// String val=K[1];
// if(flicker_buttom!=null)
// {
// flicker_buttom.setVisibility(View.VISIBLE);
// flicker_buttom.SetStatusKK(false);
// }
// flicker_buttom=null;
//// switch (name) {
//// case "搅拌":
//// flicker_buttom=fanchaoshudu;
//// flicker_buttom.SetStatusKK(true);
//// break;
//// case "位置":
//// flicker_buttom=guokoucaoxiang;
//// flicker_buttom.SetStatusKK(true);
//// break;
//// case "加热":
//// huoli.SetLevel(Integer.parseInt(val));
//// break;
//// case "主料":
//// if(val.equals("1号位"))
//// {
//// flicker_buttom=touliao1;
//// }else if(val.equals("2号位"))
//// {
//// flicker_buttom=touliao2;
//// }else if(val.equals("3号位"))
//// {
//// flicker_buttom=touliao3;
//// }else if(val.equals("4号位"))
//// {
//// flicker_buttom=touliao4;
//// }
//// flicker_buttom.SetStatusKK(true);
//// break;
//// case "加水":
//// flicker_buttom=chushui;
//// flicker_buttom.SetStatusKK(true);
//// break;
//// case "液体料":
//// if(val.equals("1"))
//// {
//// flicker_buttom=yeliao1;
//// flicker_buttom.SetStatusKK(true);
//// }else if(val.equals("2"))
//// {
//// flicker_buttom=yeliao2;
//// flicker_buttom.SetStatusKK(true);
//// }else if(val.equals("3"))
//// {
//// flicker_buttom=yeliao3;
//// flicker_buttom.SetStatusKK(true);
//// }
//// break;
//// }
// }
// }
// }
// });
// }
// }
// };
// }
// //endregion
//
// //region 外部调用
// //endregion
//
//}

+ 171
- 0
app/src/main/res/layout/activity_cook.xml View File

@@ -0,0 +1,171 @@
<?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:background="@color/red_primary"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context=".ViewModel.ActivityViewModel.CookingNewActivity">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="?attr/qmui_topbar_height"
android:background="@color/qmui_config_color_white">

<!-- 其他 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="20dp"
android:layout_weight="1.2">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView
android:id="@+id/goodname"
android:layout_width="340dp"
android:layout_height="wrap_content"
android:fontFamily="@font/fz2"
android:shadowColor="#65000000"
android:shadowDx="0.0"
android:shadowDy="10.0"
android:shadowRadius="6.0"
android:text="爆炒鱼香肉丝"
android:textColor="@color/black"
android:textSize="45dp" />

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10">

<TextView
android:id="@+id/runtime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/ziti0"
android:text="00 : 00"
android:textColor="@color/black"
android:textSize="50dp"
android:textStyle="bold" />

<com.bonait.bnframework.ViewModel.CustomView.imagebuttom
android:id="@+id/zanting_goodmake"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:contentDescription="111"
android:visibility="gone"
app:imagesrc_ks="@mipmap/zhizuo_zt"
app:imagesrc_tz="@mipmap/zhizuo_jx" />
</RelativeLayout>
</LinearLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">

<com.bonait.bnframework.ViewModel.CustomView.jingdutiao
android:id="@+id/t_jindu"
android:layout_width="match_parent"
android:layout_height="45dp" />
</RelativeLayout>


</LinearLayout>

<TextView
android:id="@+id/gongxumiaoshu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="步骤1 加油50g"
android:textColor="#797373"
android:layout_alignParentBottom="true"
android:layout_marginRight="@dimen/dp_110"
android:textSize="32sp" />

<com.bonait.bnframework.ViewModel.CustomView.imagebuttom
android:id="@+id/start_goodmake"
android:layout_width="wrap_content"
android:layout_height="110dp"
android:layout_alignParentRight="true"
android:layout_marginTop="5dp"
app:imagesrc_ks="@mipmap/zhizuo_ks"
app:imagesrc_tz="@mipmap/zhizuo_js" />

<ImageView
android:id="@+id/kancaipu"
android:layout_width="190dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_50"
android:layout_marginRight="-80dp"
android:src="@mipmap/yy_h1" />

</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2">

<ImageView
android:id="@+id/device_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:scaleY="1.5"
android:scaleX="1.5"
android:src="@mipmap/device_normal" />
<TextView
android:id="@+id/test1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
tools:text="88888888"
android:ellipsize="start"
android:textSize="@dimen/sp_24"
/>
<TextView
android:id="@+id/test2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/test1"
tools:text="88888888\nsssssssssss\ns"
android:ellipsize="start"
android:textColor="@color/color3"
android:textSize="@dimen/sp_24"
/>

</RelativeLayout>
</LinearLayout>


</RelativeLayout>

<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>

+ 0
- 12
app/src/main/res/layout/fragment_home_foods.xml View File

@@ -7,18 +7,6 @@
android:id="@+id/topbar"
android:layout_width="match_parent"
android:layout_height="?attr/qmui_topbar_height" >
<TextView
android:id="@+id/back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textColor="@color/white"
android:textSize="@dimen/sp_32"
android:text="返回"
android:drawableLeft="@mipmap/fanhui"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:drawablePadding="@dimen/dp_5"
/>
</com.qmuiteam.qmui.widget.QMUITopBarLayout>

<RelativeLayout


Loading…
Cancel
Save