@@ -45,7 +45,7 @@ public class ExecuteTheRecipe { | |||
/** | |||
* 等待超时时间 | |||
*/ | |||
public static int whileTime = 40; | |||
public static int whileTime = 5; | |||
/** | |||
* 监听变量值 | |||
@@ -72,6 +72,15 @@ public class ExecuteTheRecipe { | |||
* 当前工序的index | |||
*/ | |||
static int Index_select=0; | |||
/** | |||
* 是否启动 | |||
*/ | |||
public static boolean IsStart = false; | |||
/** | |||
* 是否暂停 | |||
*/ | |||
public static boolean IsPause = false; | |||
//endregion | |||
//region 强制结束 | |||
@@ -0,0 +1,175 @@ | |||
package com.bonait.bnframework.common.myprogress; | |||
import android.content.Context; | |||
import android.graphics.Bitmap; | |||
import android.graphics.Canvas; | |||
import android.graphics.Color; | |||
import android.graphics.Paint; | |||
import android.graphics.Path; | |||
import android.graphics.PorterDuff; | |||
import android.graphics.PorterDuffXfermode; | |||
import android.graphics.drawable.BitmapDrawable; | |||
import android.graphics.drawable.Drawable; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.util.AttributeSet; | |||
import android.view.View; | |||
public class WaveProgressView extends View { | |||
private int width; | |||
private int height; | |||
private Bitmap backgroundBitmap; | |||
private Path mPath; | |||
private Paint mPathPaint; | |||
private float mWaveHight = 30f; | |||
private float mWaveWidth = 100f; | |||
private String mWaveColor = "#FF49C12E"; | |||
private int mWaveSpeed = 30; | |||
private Paint mTextPaint; | |||
private String currentText = "10%"; | |||
private String mTextColor = "#BEAA6A"; | |||
private int mTextSize = 35; | |||
private int maxProgress = 100; | |||
private int currentProgress = 10; | |||
private float currentY; | |||
private float distance = 0; | |||
private int RefreshGap = 10; | |||
private static final int INVALIDATE = 0X777; | |||
private Handler handler = new Handler() { | |||
@Override | |||
public void handleMessage(Message msg) { | |||
super.handleMessage(msg); | |||
switch (msg.what) { | |||
case INVALIDATE: | |||
invalidate(); | |||
sendEmptyMessageDelayed(INVALIDATE,RefreshGap); | |||
break; | |||
} | |||
} | |||
}; | |||
public WaveProgressView(Context context) { | |||
this(context,null,0); | |||
} | |||
public WaveProgressView(Context context, AttributeSet attrs) { | |||
this(context, attrs, 0); | |||
} | |||
public WaveProgressView(Context context, AttributeSet attrs, int defStyle) { | |||
super(context, attrs, defStyle); | |||
init(); | |||
} | |||
public void setCurrent(int currentProgress,String currentText) { | |||
this.currentProgress = currentProgress; | |||
this.currentText = currentText; | |||
} | |||
public void setWaveColor(String mWaveColor){ | |||
this.mWaveColor = mWaveColor; | |||
} | |||
private void init() { | |||
if(null==getBackground()){ | |||
throw new IllegalArgumentException(String.format("background is null.")); | |||
}else{ | |||
backgroundBitmap = getBitmapFromDrawable(getBackground()); | |||
} | |||
mPath = new Path(); | |||
mPathPaint = new Paint(); | |||
mPathPaint.setAntiAlias(true); | |||
mPathPaint.setStyle(Paint.Style.FILL); | |||
mTextPaint = new Paint(); | |||
mTextPaint.setAntiAlias(true); | |||
mTextPaint.setTextAlign(Paint.Align.CENTER); | |||
handler.sendEmptyMessageDelayed(INVALIDATE,100); | |||
} | |||
@Override | |||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |||
width = MeasureSpec.getSize(widthMeasureSpec); | |||
currentY = height = MeasureSpec.getSize(heightMeasureSpec); | |||
} | |||
@Override | |||
protected void onDraw(Canvas canvas) { | |||
if(backgroundBitmap!=null){ | |||
canvas.drawBitmap(createImage(), 0, 0, null); | |||
} | |||
} | |||
private Bitmap createImage() | |||
{ | |||
mPathPaint.setColor(Color.parseColor(mWaveColor)); | |||
mTextPaint.setColor(Color.parseColor(mTextColor)); | |||
mTextPaint.setTextSize(mTextSize); | |||
mPathPaint.setColor(Color.parseColor(mWaveColor)); | |||
Paint paint = new Paint(); | |||
paint.setAntiAlias(true); | |||
Bitmap bmp = Bitmap.createBitmap(width,height, Bitmap.Config.ARGB_8888); | |||
Canvas canvas = new Canvas(bmp); | |||
float currentMidY = height*(maxProgress-currentProgress)/maxProgress; | |||
if(currentY>currentMidY){ | |||
currentY = currentY - (currentY-currentMidY)/10; | |||
} | |||
mPath.reset(); | |||
//之所以0-distance是因为有原点向上增加的 | |||
mPath.moveTo(0-distance,currentY); | |||
//显示的区域内的水波纹的数量 | |||
int waveNum = width/((int)mWaveWidth); | |||
int num = 0; | |||
for(int i =0;i<waveNum;i++){ | |||
mPath.quadTo(mWaveWidth*(num+1)-distance,currentY-mWaveHight,mWaveWidth*(num+2)-distance,currentY); | |||
mPath.quadTo(mWaveWidth*(num+3)-distance,currentY+mWaveHight,mWaveWidth*(num+4)-distance,currentY); | |||
num+=4; | |||
} | |||
distance +=mWaveWidth/mWaveSpeed; | |||
distance = distance%(mWaveWidth*4); | |||
mPath.lineTo(width,height); | |||
mPath.lineTo(0,height); | |||
mPath.close(); | |||
canvas.drawPath(mPath, mPathPaint); | |||
int min = Math.min(width,height); | |||
backgroundBitmap = Bitmap.createScaledBitmap(backgroundBitmap,min,min,false); | |||
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_ATOP)); | |||
canvas.drawBitmap(backgroundBitmap,0,0,paint); | |||
canvas.drawText(currentText, width/2, height/2, mTextPaint); | |||
return bmp; | |||
} | |||
private Bitmap getBitmapFromDrawable(Drawable drawable) { | |||
if (drawable == null) { | |||
return null; | |||
} | |||
if (drawable instanceof BitmapDrawable) { | |||
return ((BitmapDrawable) drawable).getBitmap(); | |||
} | |||
try { | |||
Bitmap bitmap; | |||
bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),Bitmap.Config.ARGB_8888); | |||
Canvas canvas = new Canvas(bitmap); | |||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight()); | |||
drawable.draw(canvas); | |||
return bitmap; | |||
} catch (OutOfMemoryError e) { | |||
return null; | |||
} | |||
} | |||
} |
@@ -0,0 +1,126 @@ | |||
package com.bonait.bnframework.common.myprogress; | |||
import android.content.Context; | |||
import android.graphics.Bitmap; | |||
import android.graphics.Canvas; | |||
import android.graphics.Color; | |||
import android.graphics.Paint; | |||
import android.graphics.Path; | |||
import android.graphics.PorterDuff; | |||
import android.graphics.PorterDuffXfermode; | |||
import android.graphics.drawable.BitmapDrawable; | |||
import android.graphics.drawable.Drawable; | |||
import android.os.Handler; | |||
import android.os.Message; | |||
import android.util.AttributeSet; | |||
import android.view.View; | |||
/** | |||
* Created by ytx on 2017/2/15. | |||
*/ | |||
public class WaveView extends View { | |||
private int width; | |||
private int height; | |||
private Path mPath; | |||
private Paint mPathPaint; | |||
private float mWaveHight = 30f; | |||
private float mWaveWidth = 100f;//水波纹的宽度 | |||
private String mWaveColor = "#FFFFFF"; | |||
private int mWaveSpeed = 30; | |||
private int maxProgress = 100; | |||
private int currentProgress = 0; | |||
private float currentY; | |||
private float distance = 0; | |||
private int RefreshGap = 10; | |||
private static final int INVALIDATE = 0X777; | |||
private Handler handler = new Handler() { | |||
@Override | |||
public void handleMessage(Message msg) { | |||
super.handleMessage(msg); | |||
switch (msg.what) { | |||
case INVALIDATE: | |||
invalidate(); | |||
sendEmptyMessageDelayed(INVALIDATE,RefreshGap); | |||
break; | |||
} | |||
} | |||
}; | |||
public WaveView(Context context) { | |||
this(context,null,0); | |||
} | |||
public WaveView(Context context, AttributeSet attrs) { | |||
this(context, attrs, 0); | |||
} | |||
public WaveView(Context context, AttributeSet attrs, int defStyle) { | |||
super(context, attrs, defStyle); | |||
init(); | |||
} | |||
public void setCurrent(int currentProgress,String currentText) { | |||
this.currentProgress = currentProgress; | |||
} | |||
public void setWaveColor(String mWaveColor){ | |||
this.mWaveColor = mWaveColor; | |||
} | |||
private void init() { | |||
mPath = new Path(); | |||
mPathPaint = new Paint(); | |||
mPathPaint.setAntiAlias(true); | |||
mPathPaint.setStyle(Paint.Style.FILL); | |||
handler.sendEmptyMessageDelayed(INVALIDATE,100); | |||
} | |||
@Override | |||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |||
super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |||
width = MeasureSpec.getSize(widthMeasureSpec); | |||
currentY = height = MeasureSpec.getSize(heightMeasureSpec); | |||
} | |||
@Override | |||
protected void onDraw(Canvas canvas) { | |||
canvas.drawBitmap(createImage(), 0, 0, null); | |||
} | |||
private Bitmap createImage() | |||
{ | |||
mPathPaint.setColor(Color.parseColor(mWaveColor)); | |||
Paint paint = new Paint(); | |||
paint.setAntiAlias(true); | |||
Bitmap bmp = Bitmap.createBitmap(width,height, Bitmap.Config.ARGB_8888); | |||
Canvas canvas = new Canvas(bmp); | |||
float currentMidY = height*(maxProgress-currentProgress)/maxProgress; | |||
if(currentY>currentMidY){ | |||
currentY = currentY - (currentY-currentMidY)/10; | |||
} | |||
mPath.reset(); | |||
//之所以0-distance是因为有原点向上增加的 | |||
mPath.moveTo(0-distance,currentY); | |||
//显示的区域内的水波纹的数量 | |||
int waveNum = width/((int)mWaveWidth); | |||
int num = 0; | |||
for(int i =0;i<waveNum;i++){ | |||
mPath.quadTo(mWaveWidth*(num+1)-distance,currentY-mWaveHight,mWaveWidth*(num+2)-distance,currentY); | |||
mPath.quadTo(mWaveWidth*(num+3)-distance,currentY+mWaveHight,mWaveWidth*(num+4)-distance,currentY); | |||
num+=4; | |||
} | |||
distance +=mWaveWidth/mWaveSpeed; | |||
distance = distance%(mWaveWidth*4); | |||
mPath.lineTo(width,height); | |||
mPath.lineTo(0,height); | |||
mPath.close(); | |||
canvas.drawPath(mPath, mPathPaint); | |||
return bmp; | |||
} | |||
} |
@@ -10,12 +10,18 @@ import android.view.KeyEvent; | |||
import android.view.MenuItem; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.MessageName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.helper.CountDownTimerExt; | |||
import com.bonait.bnframework.common.helper.I.IThread; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.helper.MessageLog; | |||
@@ -39,12 +45,16 @@ import com.google.android.material.bottomnavigation.BottomNavigationView; | |||
import com.lzy.okgo.OkGo; | |||
import com.qmuiteam.qmui.widget.QMUIViewPager; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class BottomNavigationNewActivity extends BaseActivity { | |||
//region 变量 | |||
@BindView(R.id.navigation) | |||
BottomNavigationBar bottomNavigationView; | |||
@@ -57,6 +67,9 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
@BindView(R.id.penrenzhong) | |||
LinearLayout penrenzhong; | |||
@BindView(R.id.penrenzhongtext) | |||
TextView penrenzhongtext; | |||
//endregion | |||
//region 界面私立 | |||
@@ -87,7 +100,6 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
}; | |||
viewPager.setCurrentItem(1); | |||
} | |||
@Override | |||
protected void onDestroy() { | |||
ConfigData.getInstance().ColsePLC(); | |||
@@ -119,6 +131,8 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
if (msg != null) { | |||
int index = (int) msg; | |||
viewPager.setCurrentItem(index); | |||
cooking.setVisibility(View.GONE); | |||
ShowMakeLoading(); | |||
} | |||
} | |||
}); | |||
@@ -129,12 +143,12 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
public void onMessage(Object msg) { | |||
if (msg != null) { | |||
String id = (String) msg; | |||
cooking.initData(id, activity, myClickListener); | |||
goods = QueryDB.GetGoodsId(id); | |||
cooking.initData(goods, activity, myClickListener); | |||
cooking.setVisibility(View.VISIBLE); | |||
} | |||
} | |||
}); | |||
} | |||
/** | |||
@@ -176,10 +190,39 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
} | |||
return super.onKeyDown(keyCode, event); | |||
} | |||
/** | |||
* 点击事件 | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.penrenzhong | |||
}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.penrenzhong: | |||
if (goods != null) { | |||
cooking.setVisibility(View.VISIBLE); | |||
penrenzhong.setVisibility(View.GONE); | |||
} | |||
break; | |||
} | |||
} | |||
//endregion | |||
//region 公共函数 | |||
/** | |||
* 是否显示制作中, 看菜谱 商品制作开始 商品制作结束 | |||
*/ | |||
public void ShowMakeLoading() { | |||
if (cooking.getVisibility() == View.GONE && ExecuteTheRecipe.IsStart) { | |||
penrenzhong.setVisibility(View.VISIBLE); | |||
} else { | |||
penrenzhong.setVisibility(View.GONE); | |||
} | |||
} | |||
/** | |||
* 初始化 | |||
*/ | |||
@@ -192,6 +235,8 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
ConfigData.getInstance().ToggleEnvironment(); | |||
//2.初始化PLC | |||
ReconnectModbus(); | |||
//制作线程 | |||
MakeThread(); | |||
//初始化阿里云连接 | |||
//AliyunIOTManager.getInstance().OpenDev(this); | |||
} | |||
@@ -241,8 +286,176 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
//endregion | |||
//region 制作 | |||
public boolean IsStart = false;//是否启动 | |||
public boolean IsPause = false;//是否暂停 | |||
int gongxuIndex = 10000; | |||
ArrayList<BPA_GOODSRECIPE> goodsrecipesL = null; | |||
BPA_GOODSRECIPE MakeCipe = null; | |||
//商品 | |||
public BPA_GOODS goods = null; | |||
/** | |||
* 商品制作线程 | |||
*/ | |||
public void MakeThread() { | |||
ExecuteTheRecipe.context = this; | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
while (true) { | |||
try { | |||
if (ExecuteTheRecipe.IsStart && goods != null) { | |||
try { | |||
//获取工艺 | |||
ArrayList<BPA_GOODSRECIPE> goodsrecipes = QueryDB.GetGoodsSrecipeID(goods.id); | |||
goodsrecipesL = goodsrecipes; | |||
gongxuIndex = 1; | |||
int m = 0; | |||
for (BPA_GOODSRECIPE item : goodsrecipes) { | |||
MakeCipe = item; | |||
gongxuIndex++; | |||
runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
cooking.SetMiaoShu("正在执行:" + item.processms); | |||
} | |||
}); | |||
boolean status = ExecuteTheRecipe.Execute(item, goodsrecipes, m); | |||
m++; | |||
} | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} finally { | |||
ExecuteTheRecipe.WritePLC("搅拌", false, null); | |||
ExecuteTheRecipe.WritePLC("加热", false, null); | |||
ConfigName.getInstance().IsOpenHuoLi = false; | |||
ExecuteTheRecipe.BottomClick("平移-去1号位"); | |||
gongxuIndex = 10000; | |||
MakeCipe = null; | |||
goodsrecipesL = null; | |||
ExecuteTheRecipe.IsStart = false; | |||
runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
onRecordStop(); | |||
if (ExecuteTheRecipe.IsForcedEnd)//强制结束 | |||
{ | |||
ToastUtils.info("客官,当前菜品已强制结束!!!"); | |||
//初始化 | |||
ExecuteTheRecipe.BottomClick("初始化"); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
Thread.sleep(1000); | |||
} catch (InterruptedException e) { | |||
ToastUtils.info("异常信息:" + e.getMessage()); | |||
} | |||
} | |||
} | |||
}).start(); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
while (true) { | |||
try { | |||
if (ExecuteTheRecipe.IsStart && goods != null && gongxuIndex != 10000 && goodsrecipesL != null && MakeCipe != null) { | |||
try { | |||
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒自动投料版本") || ConfigName.getInstance().versionSelectionEnum.equals("小炒版本")) { | |||
//获取工艺 | |||
int k = 1; | |||
ArrayList<BPA_GOODSRECIPE> goodsrecipes = goodsrecipesL; | |||
BPA_GOODSRECIPE recipe = null; | |||
for (BPA_GOODSRECIPE item : goodsrecipes) { | |||
k++; | |||
if (k > gongxuIndex) { | |||
if (item.processname.contains("主料") && !MakeCipe.processname.equals("主料") && recipe == null) { | |||
recipe = item; | |||
} | |||
} | |||
} | |||
if (recipe != null) { | |||
HashMap<String, String> formulation = new HashMap<>(); | |||
String text = recipe.processvalue; | |||
//region 获取仓号和值 | |||
List<String> data = new ArrayList<>(); | |||
if (text.contains("|")) { | |||
String[] res = text.split("[|]"); | |||
for (int i = 0; i < res.length; i++) { | |||
data.add(res[i]); | |||
} | |||
} else { | |||
data.add(text); | |||
} | |||
for (String item : data) { | |||
if (!item.isEmpty() && item.contains(",")) { | |||
String[] wl = item.split("[,]"); | |||
if (wl != null && wl.length == 2) { | |||
String name = wl[0]; | |||
String val = wl[1]; | |||
formulation.put(name, val); | |||
} | |||
} | |||
} | |||
//endregion | |||
boolean ishand = true; | |||
//region 判断是否手动 | |||
if (ConfigName.getInstance().versionSelectionEnum.equals("大炒版本")) { | |||
ishand = true; | |||
} else { | |||
for (HashMap.Entry<String, String> entry : formulation.entrySet()) { | |||
String key = entry.getKey(); | |||
String value = entry.getValue(); | |||
if (key.contains("投料动作")) { | |||
if (value.contains("手动投料")) { | |||
ishand = true; | |||
} else { | |||
ishand = false; | |||
} | |||
} | |||
} | |||
} | |||
//endregion | |||
if (!ishand) { | |||
String writeValue = "1号位"; | |||
for (HashMap.Entry<String, String> entry : formulation.entrySet()) { | |||
String key = entry.getKey(); | |||
String value = entry.getValue(); | |||
if (key.contains("主料位置")) { | |||
writeValue = value; | |||
} | |||
} | |||
ExecuteTheRecipe.BottomClick("平移-去" + writeValue); | |||
Log.d("移动去", writeValue); | |||
} else { | |||
ExecuteTheRecipe.BottomClick("平移-去1号位"); | |||
Log.d("移动去", "1号位"); | |||
} | |||
} else { | |||
if (!MakeCipe.processname.equals("主料")) { | |||
ExecuteTheRecipe.BottomClick("平移-去1号位"); | |||
Log.d("移动去", "1号位"); | |||
} | |||
} | |||
} | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} | |||
} | |||
Thread.sleep(3000); | |||
} catch (InterruptedException e) { | |||
ToastUtils.info("异常信息:" + e.getMessage()); | |||
} | |||
} | |||
} | |||
}).start(); | |||
} | |||
/** | |||
* 点击事件 | |||
@@ -253,20 +466,19 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
boolean Status = (boolean) data; | |||
switch (v.getId()) { | |||
case R.id.start_goodmake://启动按钮 | |||
IsStart = Status; | |||
IsPause = false; | |||
ExecuteTheRecipe.IsPause = false; | |||
if (Status) { | |||
cooking.onRecordStart(); | |||
onRecordStart(); | |||
} else { | |||
cooking.onRecordStop(); | |||
onRecordStop(); | |||
} | |||
break; | |||
case R.id.zanting_goodmake://暂停按钮 | |||
IsPause = Status; | |||
ExecuteTheRecipe.IsPause = Status; | |||
if (Status) { | |||
cooking.onRecordPause(); | |||
onRecordPause(); | |||
} else { | |||
cooking.onRecordPauseStart(); | |||
onRecordPauseStart(); | |||
} | |||
break; | |||
} | |||
@@ -277,5 +489,105 @@ public class BottomNavigationNewActivity extends BaseActivity { | |||
} | |||
}; | |||
private CountDownTimerExt countDownTimer = null;//计时器 | |||
/** | |||
* 启动 | |||
*/ | |||
public void onRecordStart() { | |||
if (goods != null) { | |||
cooking.SetReset(); | |||
int time = goods.maketime; | |||
SetProcess(time, 0); | |||
if (countDownTimer == null) { | |||
countDownTimer = new CountDownTimerExt(time * 1000, 1000) { | |||
@Override | |||
public void onTimerTick(long value) { | |||
int overtime = (int) ((value) / 1000);//剩余时间 | |||
SetProcess(time, time - overtime); | |||
} | |||
@Override | |||
public void onTimerFinish() { | |||
SetProcess(time, time); | |||
} | |||
}; | |||
} | |||
countDownTimer.start(); | |||
ExecuteTheRecipe.IsStart = true; | |||
} | |||
} | |||
/** | |||
* 停止 | |||
*/ | |||
public void onRecordStop() { | |||
if (goods != null) { | |||
cooking.SetReset(); | |||
cooking.SetRest1(); | |||
SetProcess(goods.maketime, 0); | |||
if (countDownTimer != null) { | |||
countDownTimer.stop(); | |||
countDownTimer = null; | |||
} | |||
ExecuteTheRecipe.IsStart = false; | |||
} | |||
} | |||
/** | |||
* 暂停 | |||
*/ | |||
public void onRecordPause() { | |||
countDownTimer.pause(); | |||
} | |||
/** | |||
* 继续 | |||
*/ | |||
public void onRecordPauseStart() { | |||
countDownTimer.resume(); | |||
} | |||
/** | |||
* 设置进度条 | |||
* | |||
* @param | |||
*/ | |||
public void SetProcess(int alltime, int usertime) { | |||
try { | |||
penrenzhongtext.setText(formatTime((alltime - usertime))); | |||
cooking.SetProcess(alltime, usertime); | |||
} catch (Exception ex) { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} | |||
} | |||
/** | |||
* 将毫秒转化为 分钟:秒 的格式 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; | |||
} | |||
} | |||
} | |||
//endregion | |||
} |
@@ -499,7 +499,6 @@ public class Home1Fragment extends BaseFragment { | |||
public void MakeThread() { | |||
ExecuteTheRecipe.context = context; | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
@@ -25,6 +25,7 @@ import android.widget.TextView; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ConfigData; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseFragment; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.DataBus; | |||
@@ -74,7 +75,7 @@ public class HomeFragmentPR extends BaseFragment { | |||
SearchView search_view;//查询框 | |||
@BindView(R.id.qupenren) | |||
add_qupenren qupenren;//查询框 | |||
add_qupenren qupenren;//确认烹饪弹窗 | |||
/** | |||
* 选中行 | |||
@@ -235,7 +236,15 @@ public class HomeFragmentPR extends BaseFragment { | |||
qupenren.setVisibility(View.VISIBLE); | |||
break; | |||
case 5: //打开制作窗体 | |||
MessageManager.getInstance().sendMessage(MessageName.GetOrganize, goodid); | |||
//判断是否正在制作 | |||
if(ExecuteTheRecipe.IsStart) | |||
{ | |||
ToastUtils.warning("请耐心等待商品制作结束!!!"); | |||
}else | |||
{ | |||
MessageManager.getInstance().sendMessage(MessageName.OpenMakeGoodFrom, goodid); | |||
qupenren.setVisibility(View.GONE); | |||
} | |||
break; | |||
case 0://关闭窗体 | |||
qupenren.setVisibility(View.GONE); | |||
@@ -9,10 +9,21 @@ import android.view.View; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOS; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import com.bonait.bnframework.modules.home.fragment.mode.jingdutiao1; | |||
import com.qmuiteam.qmui.widget.QMUITopBarLayout; | |||
import java.util.ArrayList; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class BunkerSetupActivity extends BaseActivity { | |||
@@ -20,7 +31,19 @@ public class BunkerSetupActivity extends BaseActivity { | |||
@BindView(R.id.topbar) | |||
QMUITopBarLayout mTopBar; | |||
@BindView(R.id.silos1) | |||
jingdutiao1 silos1; | |||
@BindView(R.id.silos2) | |||
jingdutiao1 silos2; | |||
@BindView(R.id.silos3) | |||
jingdutiao1 silos3; | |||
public Context context; | |||
public ArrayList<lcMode> silos=new ArrayList<>(); | |||
//endregion | |||
//region 界面实例 | |||
@@ -31,7 +54,7 @@ public class BunkerSetupActivity extends BaseActivity { | |||
ButterKnife.bind(this); | |||
context = this; | |||
initTopBar(); | |||
InitData(); | |||
} | |||
//endregion | |||
@@ -51,20 +74,80 @@ public class BunkerSetupActivity extends BaseActivity { | |||
}); | |||
} | |||
/** | |||
* 初始化数据 | |||
*/ | |||
public void InitData() | |||
{ | |||
ArrayList<BPA_SILOS> bpa_silos = QueryDB.GetSilosALL(); | |||
//加载materials数据 | |||
if (bpa_silos.size() > 0) { | |||
for (BPA_SILOS silo : bpa_silos) { | |||
List<BPA_MATERIAL> m = QueryDB.GetMaterialBySilosID(silo.id); | |||
if (m.size() > 0) { | |||
silos.add(new lcMode(silo.id, silo.num, m.get(0).name, silo.silosmargin, silo.siloszl, m.get(0).id,m.get(0).type, silo.warningValue, silo.thrsoleValue)); | |||
} else { | |||
silos.add(new lcMode(silo.id, silo.num, "未设置", silo.silosmargin, silo.siloszl, "",0, silo.warningValue, silo.thrsoleValue)); | |||
} | |||
} | |||
} | |||
for (lcMode item:silos) | |||
{ | |||
if(item.num==1) | |||
{ | |||
silos1.SetValue(item,myClickListener); | |||
}else if(item.num==2) | |||
{ | |||
silos2.SetValue(item,myClickListener); | |||
}else if(item.num==3) | |||
{ | |||
silos3.SetValue(item,myClickListener); | |||
} | |||
} | |||
} | |||
/** | |||
* 内部点击事件 | |||
*/ | |||
public MyClickListener myClickListener=new MyClickListener() { | |||
@Override | |||
public void clickListener(View v, Object data) { | |||
if(data!=null) | |||
{ | |||
lcMode mode=(lcMode)data; | |||
} | |||
} | |||
@Override | |||
public void clickListenerNew(View v, int k, Object data) { | |||
} | |||
}; | |||
/** | |||
* 点击事件 | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.quanliaobuchong, | |||
R.id.quanchangqingxi}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.quanliaobuchong: | |||
for (lcMode item:silos) | |||
{ | |||
QueryDB.UpdateYL(item.id,item.siloszl); | |||
} | |||
InitData(); | |||
ToastUtils.info("补充完成!"); | |||
break; | |||
case R.id.quanchangqingxi: | |||
// /** | |||
// * 点击事件 | |||
// * | |||
// * @param view | |||
// */ | |||
// @OnClick({R.id.kancaipu}) | |||
// public void onViewClicked(View view) { | |||
// switch (view.getId()) { | |||
// case R.id.kancaipu://看菜谱 | |||
// | |||
// break; | |||
// } | |||
// } | |||
break; | |||
} | |||
} | |||
//endregion | |||
//region 公共方法 | |||
@@ -24,11 +24,13 @@ import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.base.BaseActivity; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.constant.MessageName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODS; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.helper.CountDownTimerExt; | |||
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.modules.home.fragment.mode.imagebuttom; | |||
import com.bonait.bnframework.modules.home.fragment.mode.jingdutiao; | |||
@@ -68,14 +70,12 @@ public class CookingActivity extends LinearLayout { | |||
//当前需要执行的工艺配方 | |||
public ArrayList<BPA_GOODSRECIPE> goodsrecipes=new ArrayList<>(); | |||
//商品 | |||
public BPA_GOODS goods=new BPA_GOODS(); | |||
public ArrayList<BPA_GOODSRECIPE> goodsrecipes = new ArrayList<>(); | |||
private Context contextMian; | |||
private View root; | |||
public Activity activity=null; | |||
public Activity activity = null; | |||
//endregion | |||
//region 界面实例 | |||
@@ -91,76 +91,26 @@ public class CookingActivity extends LinearLayout { | |||
//endregion | |||
//region 公共方法 | |||
/** | |||
* 初始化数据 | |||
*/ | |||
public void initData(String id,Activity ac,MyClickListener listener) { | |||
public void initData(BPA_GOODS goods, Activity ac, MyClickListener listener) { | |||
//根据商品id查询 | |||
activity=ac; | |||
goods=QueryDB.GetGoodsId(id); | |||
goodname.setText(goods.name+""); | |||
gongxumiaoshu.setText("等待开始..."); | |||
runtime.setText(formatTime(goods.maketime)); | |||
//获取工艺 | |||
goodsrecipes = QueryDB.GetGoodsSrecipeID(id); | |||
start_goodmake.mListener=listener; | |||
zanting_goodmake.mListener=listener; | |||
} | |||
private CountDownTimerExt countDownTimer = null;//计时器 | |||
/** | |||
* 启动 | |||
*/ | |||
public void onRecordStart() { | |||
zanting_goodmake.SetStatus(false); | |||
zanting_goodmake.setVisibility(View.VISIBLE); | |||
SetProcess(goods.maketime, 0); | |||
if (countDownTimer == null) { | |||
countDownTimer = new CountDownTimerExt(goods.maketime * 1000, 1000) { | |||
@Override | |||
public void onTimerTick(long value) { | |||
int overtime = (int) ((value) / 1000);//剩余时间 | |||
SetProcess(goods.maketime, goods.maketime - overtime); | |||
} | |||
activity = ac; | |||
@Override | |||
public void onTimerFinish() { | |||
} | |||
}; | |||
} | |||
countDownTimer.start(); | |||
} | |||
/** | |||
* 停止 | |||
*/ | |||
public void onRecordStop() { | |||
zanting_goodmake.SetStatus(false); | |||
zanting_goodmake.setVisibility(View.GONE); | |||
//获取工艺 | |||
goodsrecipes = QueryDB.GetGoodsSrecipeID(goods.id); | |||
goodname.setText(goods.name + ""); | |||
start_goodmake.mListener = listener; | |||
zanting_goodmake.mListener = listener; | |||
SetReset(); | |||
SetRest1(); | |||
SetProcess(goods.maketime, 0); | |||
countDownTimer.stop(); | |||
} | |||
/** | |||
* 暂停 | |||
*/ | |||
public void onRecordPause() { | |||
countDownTimer.pause(); | |||
} | |||
/** | |||
* 继续 | |||
*/ | |||
public void onRecordPauseStart() { | |||
countDownTimer.resume(); | |||
SetMiaoShu("等待开始..."); | |||
runtime.setText(formatTime(goods.maketime)); | |||
} | |||
// private long recordingTime = 0;// 记录下来的总时间 | |||
// /** | |||
// * 启动定时器 | |||
@@ -193,12 +143,21 @@ public class CookingActivity extends LinearLayout { | |||
// return time; | |||
// } | |||
/** | |||
* 设置描述 | |||
* | |||
* @param text | |||
*/ | |||
public void SetMiaoShu(String text) { | |||
gongxumiaoshu.setText(text + ""); | |||
} | |||
/** | |||
* 设置进度条 | |||
* | |||
* @param | |||
*/ | |||
public void SetProcess(int alltime, int usertime) | |||
{ | |||
public void SetProcess(int alltime, int usertime) { | |||
try { | |||
t_jindu.SetValue((usertime * 100) / alltime); | |||
runtime.setText(formatTime((alltime - usertime))); | |||
@@ -206,9 +165,24 @@ public class CookingActivity extends LinearLayout { | |||
ToastUtils.error("异常信息:" + ex.getMessage()); | |||
} | |||
} | |||
/** | |||
* 复位 | |||
*/ | |||
public void SetReset() { | |||
SetMiaoShu("等待开始..."); | |||
zanting_goodmake.SetStatus(false); | |||
zanting_goodmake.setVisibility(View.GONE); | |||
} | |||
public void SetRest1() { | |||
start_goodmake.SetStatus(false); | |||
} | |||
//endregion | |||
//region 私有方法 | |||
/** | |||
* 将毫秒转化为 分钟:秒 的格式 100* 1000 | |||
* | |||
@@ -222,15 +196,15 @@ public class CookingActivity extends LinearLayout { | |||
second = (int) ((millisecond / 1) % 60); | |||
if (minute < 10) { | |||
if (second < 10) { | |||
return "0" + minute + ":" + "0" + second; | |||
return "0" + minute + " : " + "0" + second; | |||
} else { | |||
return "0" + minute + ":" + second; | |||
return "0" + minute + " : " + second; | |||
} | |||
}else { | |||
} else { | |||
if (second < 10) { | |||
return minute + ":" + "0" + second; | |||
return minute + " : " + "0" + second; | |||
} else { | |||
return minute + ":" + second; | |||
return minute + " : " + second; | |||
} | |||
} | |||
} | |||
@@ -244,6 +218,10 @@ public class CookingActivity extends LinearLayout { | |||
mTopBar.addLeftImageButton(R.mipmap.fanhui, R.id.topbar).setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View view) { | |||
if (ExecuteTheRecipe.IsStart) { | |||
ToastUtils.warning("请等待制作完成后退出..."); | |||
return; | |||
} | |||
setVisibility(View.GONE); | |||
} | |||
}); | |||
@@ -258,7 +236,7 @@ public class CookingActivity extends LinearLayout { | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.kancaipu://看菜谱 | |||
MessageManager.getInstance().sendMessage(MessageName.SelectZY, 0); | |||
break; | |||
} | |||
} | |||
@@ -272,8 +250,7 @@ public class CookingActivity extends LinearLayout { | |||
public void run() { | |||
while (true) { | |||
try { | |||
if(activity!=null && getVisibility()==View.VISIBLE) | |||
{ | |||
if (activity != null && getVisibility() == View.VISIBLE) { | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
@@ -0,0 +1,257 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.app.Activity; | |||
import android.content.Context; | |||
import android.util.AttributeSet; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.ArrayAdapter; | |||
import android.widget.Button; | |||
import android.widget.EditText; | |||
import android.widget.LinearLayout; | |||
import android.widget.RelativeLayout; | |||
import android.widget.Spinner; | |||
import android.widget.TextView; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.constant.ConfigName; | |||
import com.bonait.bnframework.common.db.QueryDB; | |||
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE; | |||
import com.bonait.bnframework.common.db.mode.BPA_MATERIAL; | |||
import com.bonait.bnframework.common.db.mode.BPA_SILOSANDMATERIAL; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.ToastUtils; | |||
import java.util.ArrayList; | |||
import java.util.HashMap; | |||
import java.util.List; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class add_silos_message extends LinearLayout { | |||
@BindView(R.id.close_from) | |||
Button close_from; | |||
@BindView(R.id.silosname) | |||
TextView silosname;// | |||
@BindView(R.id.xuhao) | |||
TextView xuhao;//1号 | |||
@BindView(R.id.t_text) | |||
TextView t_text;//1号 | |||
@BindView(R.id.zongliang) | |||
EditText zongliang; | |||
@BindView(R.id.gaojingrongliang) | |||
EditText gaojingrongliang; | |||
@BindView(R.id.tiaoliaobiaoding) | |||
EditText tiaoliaobiaoding; | |||
@BindView(R.id.editsp_wl) | |||
Spinner editsp_wl; | |||
/** | |||
* 点击事件 | |||
*/ | |||
public MyClickListener mListener = null; | |||
private View root; | |||
private Context contextMian; | |||
public add_silos_message(Context context, @Nullable AttributeSet attrs) { | |||
super(context, attrs); | |||
contextMian = context; | |||
root = LayoutInflater.from(context).inflate(R.layout.dialog_silos_message, this); | |||
ButterKnife.bind(this, root); | |||
Init(); | |||
} | |||
public void Init() { | |||
//初始化界面控件的事件 | |||
initEvent(); | |||
} | |||
private void initData() { | |||
xuhao.setText(GetNum(mode.num)+""); | |||
silosname.setText(mode.materialName+""); | |||
int bfb=0; | |||
int yl=mode.silosmargin; | |||
int zl=mode.siloszl; | |||
if(zl==0) | |||
{ | |||
bfb=0; | |||
}else | |||
{ | |||
bfb=((yl*100)/zl)>=100?100:((yl*100)/zl); | |||
} | |||
t_text.setText(bfb+"%"); | |||
zongliang.setText(mode.siloszl+""); | |||
zongliang.setText(mode.warningValue+""); | |||
int index = 0; | |||
int count = 0; | |||
for (BPA_MATERIAL item : materials) { | |||
if (item.name.equals(mode.materialName)) { | |||
index = count; | |||
} | |||
count++; | |||
} | |||
final int checkIndex = index; | |||
editsp_wl.setSelection(checkIndex); | |||
} | |||
public String GetNum(int num) | |||
{ | |||
if(num==1) | |||
{ | |||
return "①"; | |||
}else if(num==2) | |||
{ | |||
return "②"; | |||
}else if(num==3) | |||
{ | |||
return "③"; | |||
}else | |||
{ | |||
return "①"; | |||
} | |||
} | |||
public lcMode mode=null; | |||
public ArrayList<BPA_MATERIAL> materials = new ArrayList<>(); | |||
List<String> names = new ArrayList<>(); | |||
/** | |||
* 设置数据 | |||
* | |||
* @param | |||
*/ | |||
public void SetData(lcMode data, MyClickListener listener, Activity activity) { | |||
try { | |||
mListener=listener; | |||
mode = data; | |||
materials.clear(); | |||
List<BPA_MATERIAL> bpa_materials = QueryDB.GetMaterialALL(); | |||
for (BPA_MATERIAL item : bpa_materials) { | |||
materials.add(item); | |||
} | |||
BPA_MATERIAL wsz = new BPA_MATERIAL(); | |||
wsz.name = "未设置"; | |||
wsz.id = ""; | |||
materials.add(wsz); | |||
names.clear(); | |||
for (BPA_MATERIAL item : materials) { | |||
names.add(item.name); | |||
} | |||
SetAdapter(editsp_wl, names); | |||
new Thread(new Runnable() { | |||
@Override | |||
public void run() { | |||
String jzz="0.0"; | |||
Object obj1= ExecuteTheRecipe.ReadPLC("料仓"+mode.num+"校准值"); | |||
if(obj1!=null) | |||
{ | |||
String s = String.valueOf(obj1); | |||
jzz = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
}else | |||
{ | |||
String s = String.valueOf(0); | |||
jzz = String.format("%.1f", (Double.parseDouble(s) / 10)); | |||
} | |||
String finalJzz = jzz; | |||
activity.runOnUiThread(new Runnable() { | |||
@Override | |||
public void run() { | |||
tiaoliaobiaoding.setText(finalJzz); | |||
} | |||
}); | |||
} | |||
}); | |||
initData(); | |||
} catch (Exception ex) { | |||
} | |||
} | |||
/** | |||
* | |||
*/ | |||
public void RefreshData() | |||
{ | |||
initData(); | |||
} | |||
private void initEvent() { | |||
close_from.setOnClickListener(new View.OnClickListener() { | |||
@Override | |||
public void onClick(View v) { | |||
if (mListener != null) { | |||
mListener.clickListenerNew(v, 0, mode); | |||
} | |||
} | |||
}); | |||
} | |||
/** | |||
* 点击事件 | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.save_rlsz,R.id.save_ghtl, | |||
R.id.save_tlbd}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.save_rlsz: | |||
QueryDB.UpdateSilosBJZ(mode.id,mode.siloszl); | |||
QueryDB.UpdateSilosZL(mode.id,mode.siloszl); | |||
ToastUtils.info("容量保存成功!"); | |||
break; | |||
case R.id.save_tlbd: | |||
break; | |||
case R.id.save_ghtl: | |||
BPA_SILOSANDMATERIAL item = new BPA_SILOSANDMATERIAL(); | |||
BPA_MATERIAL material = materials.get(editsp_wl.getSelectedItemPosition()); | |||
item.silosID = mode.id; | |||
item.materialID = material.id; | |||
//更新 | |||
if (QueryDB.UpdateSilosAndMaterial(item)) { | |||
mode.materialId = material.id; | |||
mode.materialName = material.name; | |||
} | |||
initData(); | |||
ToastUtils.info("更换物料成功!"); | |||
break; | |||
case R.id.click_dcbl: | |||
QueryDB.UpdateYL(mode.id,mode.siloszl); | |||
mode.silosmargin=mode.siloszl; | |||
initData(); | |||
ToastUtils.info("补料成功!"); | |||
break; | |||
case R.id.click_dcqx: | |||
break; | |||
} | |||
} | |||
public void SetAdapter(Spinner spinner, List<String> map) { | |||
ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), R.layout.spinner_text_item, map); | |||
adapter.setDropDownViewResource(R.layout.spinner_dropdown_item); | |||
spinner.setAdapter(adapter); | |||
} | |||
} |
@@ -13,7 +13,11 @@ import android.widget.TextView; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.business.ExecuteTheRecipe; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import com.bonait.bnframework.common.utils.AlertDialogUtils; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialog; | |||
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
@@ -71,14 +75,51 @@ public class imagebuttom extends LinearLayout { | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.image_u: | |||
Status=!Status; | |||
SetStatus(Status); | |||
if(ks_ys==R.mipmap.zhizuo_ks) | |||
{ | |||
if(Status) | |||
{ | |||
String title = "停止操作提示!"; | |||
String message = "请问客官确定要停止制作吗,小菠萝会生气的,啊啊啊啊啊啊啊...我的饭饭?"; | |||
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
//强制结束 | |||
ExecuteTheRecipe.SetForcedEnd(); | |||
dialog.dismiss(); | |||
} | |||
}); | |||
}else | |||
{ | |||
String title = "开始操作提示!"; | |||
String message = "请问客官确定要开始制作吗,小菠萝好开心呀,马上就有好吃的耶?"; | |||
AlertDialogUtils.showDialog(getContext(), title, message, new QMUIDialogAction.ActionListener() { | |||
@Override | |||
public void onClick(QMUIDialog dialog, int index) { | |||
ExecuteTheRecipe.StopForcedEnd(); | |||
Status=!Status; | |||
SetStatus(Status); | |||
if(mListener!=null) | |||
{ | |||
mListener.clickListener(root,Status); | |||
} | |||
dialog.dismiss(); | |||
} | |||
}); | |||
} | |||
}else | |||
{ | |||
Status=!Status; | |||
SetStatus(Status); | |||
if(mListener!=null) | |||
{ | |||
mListener.clickListener(root,Status); | |||
} | |||
} | |||
break; | |||
} | |||
if(mListener!=null) | |||
{ | |||
mListener.clickListener(root,Status); | |||
} | |||
} | |||
@@ -0,0 +1,127 @@ | |||
package com.bonait.bnframework.modules.home.fragment.mode; | |||
import android.content.Context; | |||
import android.util.AttributeSet; | |||
import android.view.LayoutInflater; | |||
import android.view.View; | |||
import android.widget.LinearLayout; | |||
import android.widget.ProgressBar; | |||
import android.widget.RelativeLayout; | |||
import android.widget.TextView; | |||
import androidx.annotation.Nullable; | |||
import com.bonait.bnframework.R; | |||
import com.bonait.bnframework.common.db.res.lcMode; | |||
import com.bonait.bnframework.common.helper.I.MyClickListener; | |||
import butterknife.BindView; | |||
import butterknife.ButterKnife; | |||
import butterknife.OnClick; | |||
public class jingdutiao1 extends LinearLayout { | |||
@BindView(R.id.t_progressBar) | |||
ProgressBar t_progressBar; | |||
@BindView(R.id.t_text) | |||
TextView t_text; | |||
@BindView(R.id.xuhao) | |||
TextView xuhao; | |||
@BindView(R.id.silosname) | |||
TextView silosname; | |||
@BindView(R.id.silos_sz) | |||
RelativeLayout silos_sz; | |||
public MyClickListener listener=null; | |||
/** | |||
* 当前进度 | |||
*/ | |||
public int value=0; | |||
private View root; | |||
public jingdutiao1(Context context, @Nullable AttributeSet attrs) { | |||
super(context, attrs); | |||
root= LayoutInflater.from(context).inflate(R.layout.item_jingdutiao1, this); | |||
ButterKnife.bind(this, root); | |||
Init(); | |||
} | |||
public void Init() | |||
{ | |||
SetValue(60); | |||
} | |||
/** | |||
* 点击事件 | |||
* | |||
* @param view | |||
*/ | |||
@OnClick({R.id.silos_sz}) | |||
public void onViewClicked(View view) { | |||
switch (view.getId()) { | |||
case R.id.silos_sz:// | |||
if(listener!=null) | |||
{ | |||
listener.clickListener(view,mode); | |||
} | |||
break; | |||
} | |||
} | |||
/** | |||
* 设置级别 | |||
* @param | |||
*/ | |||
public void SetValue(int data) | |||
{ | |||
String str= this.getTag().toString(); | |||
String str1= this.getContentDescription().toString(); | |||
xuhao.setText(str1+""); | |||
silosname.setText(str+""); | |||
value=data; | |||
t_progressBar.setProgress(data); | |||
t_text.setText(data+"%"); | |||
} | |||
public lcMode mode=null; | |||
/** | |||
* 设置级别 | |||
* @param | |||
*/ | |||
public void SetValue(lcMode data,MyClickListener _listener) | |||
{ | |||
mode=data; | |||
listener=_listener; | |||
xuhao.setText(GetNum(data.num)+""); | |||
silosname.setText(data.materialName+""); | |||
int bfb=0; | |||
int yl=data.silosmargin; | |||
int zl=data.siloszl; | |||
if(zl==0) | |||
{ | |||
bfb=0; | |||
}else | |||
{ | |||
bfb=((yl*100)/zl)>=100?100:((yl*100)/zl); | |||
} | |||
value=bfb; | |||
t_progressBar.setProgress(bfb); | |||
t_text.setText(data+"%"); | |||
} | |||
public String GetNum(int num) | |||
{ | |||
if(num==1) | |||
{ | |||
return "①"; | |||
}else if(num==2) | |||
{ | |||
return "②"; | |||
}else if(num==3) | |||
{ | |||
return "③"; | |||
}else | |||
{ | |||
return "①"; | |||
} | |||
} | |||
} |
@@ -359,7 +359,7 @@ public class LoginActivity extends BaseActivity implements Validator.ValidationL | |||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); | |||
startActivity(intent); | |||
} | |||
ToastUtils.info("登录成功!"); | |||
// 结束所有Activity | |||
ActivityLifecycleManager.get().finishAllActivity(); | |||
} | |||
@@ -0,0 +1,29 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |||
<!-- <item android:id="@android:id/background">//id对应控件属性,不可删除和修改,此属性对应背景颜色--> | |||
<!-- <shape android:shape="rectangle">--> | |||
<!-- //渐变设置--> | |||
<!-- <gradient android:type="linear" android:angle="270" android:centerY="0.75" android:startColor="@color/progress_background" android:endColor="@color/progress_background"/>--> | |||
<!-- //还可以设置角度--> | |||
<!-- <corners android:radius="20dp"/>--> | |||
<!-- </shape>--> | |||
<!-- </item>--> | |||
<item android:id="@android:id/progress">//进度条 | |||
<clip android:gravity="bottom" | |||
android:clipOrientation="vertical">//此属性限定为竖向 | |||
<shape android:shape="rectangle"> | |||
<gradient android:type="linear" android:angle="90" android:centerY="0.75" android:startColor="#567722" android:centerColor="#567722" android:endColor="#567722"/> | |||
<corners android:radius="10dp"/> | |||
</shape> | |||
</clip> | |||
//第二进度条,可选性添加 | |||
<!-- <scale android:scaleHeight="100%"--> | |||
<!-- android:scaleGravity="bottom">--> | |||
<!-- <shape android:shape="rectangle">--> | |||
<!-- <gradient android:type="linear" android:angle="136" android:centerY="0.75" android:startColor="#05F3CE" android:centerColor="#03DC9E" android:endColor="#04CBB7"/>--> | |||
<!-- <corners android:radius="20dp"/>--> | |||
<!-- </shape>--> | |||
<!-- </scale>--> | |||
</item> | |||
</layer-list> |
@@ -0,0 +1,17 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:shape="rectangle"> | |||
<!-- rectangle 表示为矩形 --> | |||
<!-- 填充的颜色 --> | |||
<solid android:color="@color/qmui_config_color_white"/> | |||
<!-- 边框的颜色和粗细 --> | |||
<stroke | |||
android:width="20px" | |||
android:color="@color/radiusImageView_border_color"/> | |||
<!-- android:radius 圆角的半径 --> | |||
<corners android:radius="10dp"/> | |||
</shape> |
@@ -51,24 +51,42 @@ | |||
<LinearLayout | |||
android:id="@+id/penrenzhong" | |||
android:visibility="gone" | |||
android:layout_gravity="right|bottom" | |||
android:layout_marginBottom="80dp" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<ImageView | |||
android:orientation="vertical" | |||
android:visibility="gone"> | |||
<RelativeLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/penrenzhong"/> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:text="01:00" | |||
android:textAlignment="center" | |||
android:textSize="19dp" | |||
android:textColor="#567722"/> | |||
android:layout_height="wrap_content"> | |||
<ImageView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/penrenzhong"/> | |||
<TextView | |||
android:id="@+id/penrenzhongtext" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:layout_marginTop="@dimen/dp_10" | |||
android:text="01:00" | |||
android:textAlignment="center" | |||
android:textColor="@color/white" | |||
android:textSize="20dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginTop="38dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:text="烹饪中" | |||
android:textAlignment="center" | |||
android:textColor="@color/white" | |||
android:textSize="12dp" | |||
android:textStyle="bold" /> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</com.qmuiteam.qmui.widget.QMUIWindowInsetLayout> |
@@ -13,15 +13,142 @@ | |||
android:layout_height="match_parent" | |||
android:layout_marginTop="?attr/qmui_topbar_height" | |||
android:background="@color/qmui_config_color_white"> | |||
<!-- 其他 --> | |||
<LinearLayout | |||
<RelativeLayout | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginRight="10dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:orientation="horizontal"> | |||
<LinearLayout | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="2" | |||
android:orientation="vertical"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="1"> | |||
<ImageView | |||
android:id="@+id/quanliaobuchong" | |||
android:layout_marginLeft="40dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/qcbc" | |||
android:layout_alignParentBottom="true" | |||
android:layout_marginBottom="9dp"/> | |||
<ImageView | |||
android:id="@+id/quanchangqingxi" | |||
android:layout_marginLeft="200dp" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/qcqx" | |||
android:layout_alignParentBottom="true"/> | |||
</RelativeLayout> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="0dp" | |||
android:layout_weight="3"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_alignParentBottom="true" | |||
android:scaleType="centerCrop" | |||
android:src="@mipmap/device2" /> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:layout_alignParentBottom="true" | |||
android:layout_marginRight="40dp" | |||
android:layout_marginBottom="45dp" | |||
android:orientation="vertical"> | |||
<TextView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_marginBottom="20dp" | |||
android:text="料仓" | |||
android:textAlignment="center" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" | |||
android:textStyle="bold"> | |||
</TextView> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="90dp" | |||
android:background="@mipmap/silos1" | |||
/> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="90dp" | |||
android:background="@mipmap/silos2" | |||
/> | |||
<RelativeLayout | |||
android:layout_width="120dp" | |||
android:layout_height="90dp" | |||
android:background="@mipmap/silos3" | |||
/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_width="0dp" | |||
android:layout_height="match_parent" | |||
android:layout_weight="1" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical" | |||
android:layout_marginBottom="40dp" | |||
android:layout_alignParentBottom="true"> | |||
<com.bonait.bnframework.modules.home.fragment.mode.jingdutiao1 | |||
android:id="@+id/silos1" | |||
android:layout_marginTop="0dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="200dp" | |||
android:contentDescription="①" | |||
android:tag="调和油"/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.jingdutiao1 | |||
android:id="@+id/silos2" | |||
android:layout_marginTop="80dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="200dp" | |||
android:contentDescription="②" | |||
android:tag="复合料"/> | |||
<com.bonait.bnframework.modules.home.fragment.mode.jingdutiao1 | |||
android:id="@+id/silos3" | |||
android:layout_marginTop="80dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="200dp" | |||
android:contentDescription="③" | |||
android:tag="酱油"/> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> | |||
<com.qmuiteam.qmui.widget.QMUITopBarLayout | |||
@@ -58,13 +58,6 @@ | |||
android:layout_height="wrap_content" | |||
android:layout_marginTop="@dimen/dp_10"> | |||
<com.qmuiteam.qmui.widget.textview.QMUILinkTextView | |||
android:id="@+id/shengyushijian" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:text="预计剩余时间:300s" /> | |||
<TextView | |||
android:id="@+id/runtime" | |||
android:layout_width="wrap_content" | |||
@@ -46,12 +46,12 @@ | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
android:layout_height="90dp" | |||
android:src="@mipmap/home_kspr" /> | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="40dp" | |||
android:src="@mipmap/home_kspr1" /> | |||
</LinearLayout> | |||
@@ -64,12 +64,12 @@ | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
android:layout_height="90dp" | |||
android:src="@mipmap/home_sbkz" /> | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:src="@mipmap/home_sbkz1" /> | |||
@@ -90,12 +90,12 @@ | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
android:layout_height="90dp" | |||
android:src="@mipmap/home_lcsz" /> | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="40dp" | |||
android:src="@mipmap/home_lcsz1" /> | |||
</LinearLayout> | |||
@@ -108,12 +108,12 @@ | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="100dp" | |||
android:layout_height="90dp" | |||
android:src="@mipmap/home_cpyf" /> | |||
<ImageView | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:layout_height="40dp" | |||
android:layout_marginLeft="10dp" | |||
android:src="@mipmap/home_cpyf1" /> | |||
@@ -0,0 +1,215 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@color/dialogbj"> | |||
<RelativeLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_centerInParent="true" | |||
android:layout_margin="50dp" | |||
android:background="@drawable/silosbj"> | |||
<Button | |||
android:id="@+id/close_from" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:layout_alignParentTop="true" | |||
android:layout_alignParentRight="true" | |||
android:layout_marginTop="20dp" | |||
android:layout_marginRight="@dimen/dp_10" | |||
android:background="@mipmap/fanhui1" | |||
android:textColor="@color/white" | |||
android:textSize="14dp" /> | |||
<LinearLayout | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_marginLeft="20dp" | |||
android:layout_marginTop="60dp" | |||
android:layout_marginRight="20dp" | |||
android:layout_marginBottom="160dp" | |||
android:orientation="vertical"> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:orientation="horizontal"> | |||
<TextView | |||
android:id="@+id/xuhao" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:fontFamily="@font/fz2" | |||
android:shadowColor="#65000000" | |||
android:shadowDx="0.0" | |||
android:shadowDy="5.0" | |||
android:shadowRadius="2.0" | |||
android:text="①" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:fontFamily="@font/fz2" | |||
android:shadowColor="#65000000" | |||
android:shadowDx="0.0" | |||
android:shadowDy="5.0" | |||
android:shadowRadius="2.0" | |||
android:text=" 号料仓" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/silosname" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:layout_marginLeft="30dp" | |||
android:fontFamily="@font/fz2" | |||
android:shadowColor="#65000000" | |||
android:shadowDx="0.0" | |||
android:shadowDy="5.0" | |||
android:shadowRadius="2.0" | |||
android:text="复合料" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" /> | |||
<TextView | |||
android:id="@+id/t_text" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="30dp" | |||
android:fontFamily="@font/zkgdh" | |||
android:text="50%" | |||
android:textColor="@color/topbj1" | |||
android:textSize="50dp" | |||
android:textStyle="bold" /> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@mipmap/rongliangshezhi"> | |||
<LinearLayout | |||
android:layout_marginTop="60dp" | |||
android:layout_marginLeft="120dp" | |||
android:layout_marginRight="140dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:orientation="vertical"> | |||
<EditText | |||
android:id="@+id/zongliang" | |||
android:layout_width="match_parent" | |||
android:layout_height="35dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入制作时长" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="19dp" | |||
android:text="0"/> | |||
<EditText | |||
android:id="@+id/gaojingrongliang" | |||
android:layout_width="match_parent" | |||
android:layout_height="35dp" | |||
android:layout_marginTop="10dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入制作时长" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="19dp" | |||
android:text="0"/> | |||
</LinearLayout> | |||
<RelativeLayout | |||
android:id="@+id/save_rlsz" | |||
android:layout_marginTop="54dp" | |||
android:layout_marginRight="30dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:background="@mipmap/save22"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@mipmap/tiaoliaobiaoding"> | |||
<EditText | |||
android:id="@+id/tiaoliaobiaoding" | |||
android:layout_width="match_parent" | |||
android:layout_height="35dp" | |||
android:layout_marginTop="80dp" | |||
android:layout_marginLeft="120dp" | |||
android:layout_marginRight="140dp" | |||
android:background="@drawable/input_bj" | |||
android:hint="请输入制作时长" | |||
android:inputType="number" | |||
android:maxLines="1" | |||
android:padding="3dp" | |||
android:textSize="19dp" | |||
android:text="0"/> | |||
<RelativeLayout | |||
android:id="@+id/save_tlbd" | |||
android:layout_marginTop="70dp" | |||
android:layout_marginRight="30dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:background="@mipmap/save11"/> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:layout_marginTop="20dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="wrap_content" | |||
android:background="@mipmap/genghuanwuliao"> | |||
<Spinner | |||
android:id="@+id/editsp_wl" | |||
style="@style/commonSpinnerStyle" | |||
android:layout_width="match_parent" | |||
android:layout_height="35dp" | |||
android:layout_marginTop="80dp" | |||
android:layout_marginLeft="120dp" | |||
android:layout_marginRight="140dp"/> | |||
<RelativeLayout | |||
android:id="@+id/save_ghtl" | |||
android:layout_marginTop="70dp" | |||
android:layout_marginRight="30dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:background="@mipmap/save11"/> | |||
</RelativeLayout> | |||
</LinearLayout> | |||
<LinearLayout | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentBottom="true" | |||
android:layout_centerHorizontal="true" | |||
android:layout_marginBottom="30dp"> | |||
<ImageView | |||
android:id="@+id/click_dcbl" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:src="@mipmap/dcbl" /> | |||
<ImageView | |||
android:id="@+id/click_dcqx" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="60dp" | |||
android:src="@mipmap/dcqx" /> | |||
</LinearLayout> | |||
</RelativeLayout> | |||
</RelativeLayout> |
@@ -0,0 +1,76 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
> | |||
<RelativeLayout | |||
android:layout_marginTop="16dp" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:background="@mipmap/juzheng"> | |||
<ProgressBar | |||
android:id="@+id/t_progressBar" | |||
style="@style/ProgressBar" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_margin="10dp" | |||
android:max="100" | |||
android:min="0" | |||
android:progress="10" | |||
android:progressDrawable="@drawable/layer_list_progress_vertical_high" /> | |||
<TextView | |||
android:id="@+id/xuhao" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_marginLeft="10dp" | |||
android:layout_marginTop="10dp" | |||
android:fontFamily="@font/fz2" | |||
android:shadowColor="#65000000" | |||
android:shadowDx="0.0" | |||
android:shadowDy="5.0" | |||
android:shadowRadius="2.0" | |||
android:text="①" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" | |||
android:textStyle="bold" /> | |||
<TextView | |||
android:id="@+id/silosname" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_centerInParent="true" | |||
android:fontFamily="@font/fz2" | |||
android:shadowColor="#65000000" | |||
android:shadowDx="0.0" | |||
android:shadowDy="5.0" | |||
android:shadowRadius="2.0" | |||
android:text="复合料" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" /> | |||
<TextView | |||
android:id="@+id/t_text" | |||
android:layout_width="wrap_content" | |||
android:layout_height="wrap_content" | |||
android:layout_alignParentRight="true" | |||
android:layout_alignParentBottom="true" | |||
android:layout_marginBottom="10dp" | |||
android:layout_marginRight="10dp" | |||
android:fontFamily="@font/zkgdh" | |||
android:text="50%" | |||
android:textColor="@color/topbj1" | |||
android:textSize="30dp" | |||
android:textStyle="bold" /> | |||
</RelativeLayout> | |||
<RelativeLayout | |||
android:id="@+id/silos_sz" | |||
android:layout_marginRight="-2dp" | |||
android:layout_alignParentRight="true" | |||
android:layout_width="60dp" | |||
android:layout_height="40dp" | |||
android:background="@mipmap/silos_sz"/> | |||
</RelativeLayout> |