Commit bed8a038 by wjg

.

parent 91eb4c73
...@@ -69,7 +69,8 @@ dependencies { ...@@ -69,7 +69,8 @@ dependencies {
// 引入极光 SDK // 引入极光 SDK
implementation project(':library_jiguang') implementation project(':library_jiguang')
implementation 'com.umeng.umsdk:common:9.5.0'// 版本号(必选) implementation 'com.umeng.umsdk:common:9.5.0'// 版本号(必选)
implementation 'com.umeng.umsdk:asms:1.6.3'// asms包依赖(必选) implementation 'com.umeng.umsdk:asms:1.6.3'// asms包依赖(必选)
implementation 'com.umeng.umsdk:apm:1.6.2'// U-APM产品包依赖(必选) implementation 'com.umeng.umsdk:apm:1.6.2'// U-APM产品包依赖(必选)
implementation 'io.socket:socket.io-client:1.0.0'
} }
\ No newline at end of file
package com.ihaoin.hooloo.device.component;
import android.content.Context;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import io.socket.client.Ack;
import io.socket.client.IO;
import io.socket.client.Socket;
/** Linux通信 KDS 菜单屏 */
public class InteractionSocket extends Thread {
private Context mContext;
private Socket mSocket;
private static final String mUrl = "localhost:8000";
private static final String mNamespace = "interaction";
private String tag = "[HL_CLIENT]";
public InteractionSocket(Context context) {
this.mContext = context;
}
@Override
public void run() {
connectSocket();
}
private void connectSocket() {
try {
// IO.Options opts = new IO.Options();
// opts.query = "notice";
mSocket = IO.socket(mUrl + "/" + mNamespace);
mSocket.on("reply", args -> {
if (CollectionUtils.isEmpty(args)) {
Utils.i("reply args empty");
return;
}
String content = args[0].toString();
if (StringUtils.isEmpty(content)) {
Utils.i("reply content empty");
return;
}
InteractionMsg msg = JsonUtils.readValue(content, InteractionMsg.class);
if (msg == null) {
Utils.i("reply msg empty");
return;
}
Utils.sendInteractionMsgBroadcast(mContext, msg);
});
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
public void close() {
try {
if (mSocket != null) {
mSocket.disconnect();
mSocket.close();
mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
public void sendMessage(String content) {
if (mSocket == null) {
Utils.i("socket未连接");
return;
}
try {
mSocket.emit("notice", content, (Ack) args -> {
});
} catch (Exception e) {
Utils.i("发送消息失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
}
package com.ihaoin.hooloo.device.component;
import android.content.Context;
import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import io.socket.client.Ack;
import io.socket.client.IO;
import io.socket.client.Socket;
/** Linux通信 KDS 菜单屏 */
public class KDSSocket extends Thread {
private Context mContext;
private Socket mSocket;
private static final String mUrl = "localhost:8000";
private static final String mNamespace = "kds";
private String tag = "[HL_CLIENT]";
public KDSSocket(Context context) {
this.mContext = context;
}
@Override
public void run() {
connectSocket();
}
private void connectSocket() {
try {
// IO.Options opts = new IO.Options();
// opts.query = "notice";
mSocket = IO.socket(mUrl + "/" + mNamespace);
mSocket.on("reply", args -> {
if (CollectionUtils.isEmpty(args)) {
Utils.i("reply args empty");
return;
}
String content = args[0].toString();
if (StringUtils.isEmpty(content)) {
Utils.i("reply content empty");
return;
}
KDSMsg msg = JsonUtils.readValue(content, KDSMsg.class);
if (msg == null) {
Utils.i("reply msg empty");
return;
}
Utils.sendKdsMsgBroadcast(mContext, msg);
});
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
public void close() {
try {
if (mSocket != null) {
mSocket.disconnect();
mSocket.close();
mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
public void sendMessage(String content) {
if (mSocket == null) {
Utils.i("socket未连接");
return;
}
try {
mSocket.emit("notice", content, (Ack) args -> {
});
} catch (Exception e) {
Utils.i("发送消息失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
}
package com.ihaoin.hooloo.device.component;
import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.enums.PresentState;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
/** Linux通信 TCP */
public class SocketClient extends Thread {
private Context mContext;
private Socket mSocket;
private static int mPort = 45450;
private static String mHost = "192.168.8.134";
// private String mHost = "127.0.0.1";
private String tag = "[HL_CLIENT]";
public SocketClient(Context context) {
this.mContext = context;
if (PresentState.MENU.getName().equals(SharedPreferencesUtils.getPresentation(mContext))) {
mPort = 45450;
} else {
mPort = 45451;
}
this.registerReceiver();
}
@Override
public void run() {
try {
mSocket = new Socket(mHost, mPort);
log("连接server成功");
startReceiverHandler.sendEmptyMessage(0);
} catch (Exception e) {
log("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
public void close() {
try {
if (mSocket != null) {
mSocket.close();
mSocket = null;
}
} catch (Exception e) {
log("close失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
this.unregistReceiver();
}
public void sendMessage(String content) {
if (mSocket == null) {
log("socket未连接");
return;
}
try {
OutputStream outputStream = mSocket.getOutputStream();
outputStream.write(content.getBytes(StandardCharsets.UTF_8));
outputStream.close();
} catch (Exception e) {
log("发送消息失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
private Handler startReceiverHandler = new Handler() {
@SuppressLint("HandlerLeak")
@Override
public void handleMessage(@NonNull Message msg) {
try {
new SocketReceiver(mContext, mSocket).start();
} catch (Exception e) {
log("启动receiver失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
};
private SenderReceiver senderReceiver = null;
private void registerReceiver() {
senderReceiver = new SenderReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_SOCKET_GET_MACHINE_CODE);
filter.addAction(Base.BROADCAST_SOCKET_GET_MACHINE_STATE);
filter.addAction(Base.BROADCAST_SOCKET_GET_PRODUCTION_PROGRESS);
mContext.registerReceiver(senderReceiver, filter);
}
private void unregistReceiver() {
if (senderReceiver != null) {
mContext.unregisterReceiver(senderReceiver);
senderReceiver = null;
}
}
private class SenderReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String content = "";
switch (intent.getAction()) {
case Base.BROADCAST_SOCKET_GET_MACHINE_CODE:
break;
case Base.BROADCAST_SOCKET_GET_MACHINE_STATE:
break;
case Base.BROADCAST_SOCKET_GET_PRODUCTION_PROGRESS:
break;
}
sendMessage(content);
}
}
private void log(String str) {
Utils.i(tag + str);
Message msg = handler.obtainMessage();
msg.obj = str;
handler.sendMessage(msg);
}
private Handler handler = new Handler() {
@SuppressLint("HandlerLeak")
@Override
public void handleMessage(@NonNull Message msg) {
if (msg.obj == null) {
Utils.showToast(mContext, "接收内容为空");
return;
}
String str = msg.obj.toString();
if (StringUtils.isEmpty(str)) {
Utils.showToast(mContext, "接收内容为空");
return;
}
Utils.showToast(mContext, str);
}
};
}
package com.ihaoin.hooloo.device.component;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.io.InputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
/** Linux通信 信息接收器 */
public class SocketReceiver extends Thread {
private Context mContext;
private boolean isExit = true;
private Socket mSocket;
private InputStream mInputStream;
private String tag = "[HL_CLIENT]";
public SocketReceiver(Context context, Socket socket) {
this.mContext = context;
this.mSocket = socket;
try {
mInputStream = mSocket.getInputStream();
isExit = false;
} catch (Exception e) {
sendMsg("获取数据流server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
@Override
public void run() {
try {
while (!isExit) {
byte[] buffer = new byte[1024 * 8];
int length = mInputStream.read(buffer);
if (length <= 0) {
Thread.sleep(100);
continue;
}
String str = new String(buffer, 0, length, StandardCharsets.UTF_8).trim();
sendMsg(str);
}
} catch (Exception e) {
sendMsg("获取数据失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
public void stopThread() {
isExit = true;
}
private void sendMsg(String str) {
Utils.i(tag + str);
Message msg = handler.obtainMessage();
msg.obj = str;
handler.sendMessage(msg);
}
private Handler handler = new Handler() {
@SuppressLint("HandlerLeak")
@Override
public void handleMessage(@NonNull Message msg) {
if (msg.obj == null) {
Utils.showToast(mContext, "接收内容为空");
return;
}
String str = msg.obj.toString();
if (StringUtils.isEmpty(str)) {
Utils.showToast(mContext, "接收内容为空");
return;
}
Utils.showToast(mContext, str);
SharedPreferencesUtils.setMachineCode(mContext, "SN0091290001");
Utils.fastBroadcast(mContext, Base.BROADCAST_ACTION_MACHINE_CODE_CHANGED);
}
};
}
package com.ihaoin.hooloo.device.component;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Handler;
import android.os.Message;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
public class SocketServerTest implements Runnable {
private Context mContext;
private int mPort = 45450;
private boolean isExit = true;
private ServerSocket mServerSocket;
private String tag = "[hlserver]";
public SocketServerTest(Context context) {
this.mContext = context;
try {
mServerSocket = new ServerSocket(mPort);
isExit = false;
String str = tag + "创建server成功";
Utils.i(str);
sendMsg(str);
} catch (Exception e) {
String str = tag + "创建server失败,错误原因:" + e.getMessage();
Utils.i(str);
sendMsg(str);
}
}
@Override
public void run() {
try {
while (!isExit) {
Socket socket = mServerSocket.accept();
String str = tag + "socket连接成功";
Utils.i(str);
sendMsg(str);
OutputStream outputStream = socket.getOutputStream();
outputStream.write("你好,我是服务器".getBytes(StandardCharsets.UTF_8));
outputStream.close();
socket.close();
str = tag + "写入数据成功";
Utils.i(str);
sendMsg(str);
}
} catch (Exception e) {
String str = tag + "获取数据失败,错误原因:" + e.getMessage();
Utils.i(str);
sendMsg(str);
}
}
public void stopThread() {
isExit = true;
}
private void sendMsg(String str) {
Message msg = handler.obtainMessage();
msg.obj = str;
handler.sendMessage(msg);
}
private Handler handler = new Handler() {
@SuppressLint("HandlerLeak")
@Override
public void handleMessage(@NonNull Message msg) {
if (msg.obj == null) {
Utils.showToast(mContext, tag + "接收内容为空");
return;
}
String str = msg.obj.toString();
if (StringUtils.isEmpty(str)) {
Utils.showToast(mContext, tag + "接收内容为空");
return;
}
Utils.showToast(mContext, str);
}
};
}
...@@ -3,7 +3,7 @@ package com.ihaoin.hooloo.device.config; ...@@ -3,7 +3,7 @@ package com.ihaoin.hooloo.device.config;
import com.ihaoin.hooloo.device.data.enums.PresentState; import com.ihaoin.hooloo.device.data.enums.PresentState;
public class AppConfig { public class AppConfig {
public static Boolean DEBUG = true; // TODO 编译环境 public static Boolean DEBUG = false; // TODO 编译环境
/** 点单屏编码 */ /** 点单屏编码 */
public static String DEFAULT_SCREEN_NO = "1"; // TODO 编译点单屏编码 public static String DEFAULT_SCREEN_NO = "1"; // TODO 编译点单屏编码
/** 副屏内容 */ /** 副屏内容 */
......
...@@ -21,12 +21,7 @@ public class Base { ...@@ -21,12 +21,7 @@ public class Base {
public static final String BROADCAST_ACTION_LOGCAT_STATE_CHANGED = "ACTION_LOGCAT_STATE_CHANGED"; public static final String BROADCAST_ACTION_LOGCAT_STATE_CHANGED = "ACTION_LOGCAT_STATE_CHANGED";
public static final String BROADCAST_ACTION_TOUCH_EVENT = "ACTION_TOUCH_EVENT"; public static final String BROADCAST_ACTION_TOUCH_EVENT = "ACTION_TOUCH_EVENT";
public static final String BROADCAST_ACTION_TIMEOUT = "ACTION_TIMEOUT"; public static final String BROADCAST_ACTION_TIMEOUT = "ACTION_TIMEOUT";
public static final String BROADCAST_ACTION_MACHINE_STATE_CHANGED = "ACTION_MACHINE_STATE_CHANGED";
public static final String BROADCAST_ACTION_PRODUCTION_PROGRESS_CHANGED = "ACTION_PRODUCTION_PROGRESS_CHANGED";
public static final String BROADCAST_ACTION_DETECTION_BODY = "ACTION_DETECTION_BODY"; // 检测状态发现人
public static final String BROADCAST_ACTION_DETECTION_NONE = "ACTION_DETECTION_NONE"; // 检测状态没人
public static final String BROADCAST_SOCKET_GET_MACHINE_CODE = "BROADCAST_SOCKET_GET_MACHINE_CODE"; public static final String BROADCAST_ACTION_KDS_INFO = "ACTION_KDS_INFO";
public static final String BROADCAST_SOCKET_GET_MACHINE_STATE = "BROADCAST_SOCKET_GET_MACHINE_STATE"; public static final String BROADCAST_ACTION_INTERACTION_INFO = "ACTION_INTERACTION_INFO";
public static final String BROADCAST_SOCKET_GET_PRODUCTION_PROGRESS = "BROADCAST_SOCKET_GET_PRODUCTION_PROGRESS";
} }
package com.ihaoin.hooloo.device.data.enums;
public enum Gender {
UNKNOW(1, "未知"),
MALE(2, "男"),
FEMALE(3, "女");
private Integer code;
private String name;
Gender(Integer code, String name) {
this.code = code;
this.name = name;
}
public static Gender get(Integer code) {
for (Gender gender : Gender.values()) {
if (gender.getCode().equals(code)) {
return gender;
}
}
return null;
}
public Integer getCode() {
return code;
}
public String getName() {
return name;
}
}
package com.ihaoin.hooloo.device.data.enums;
public enum PersonNamed {
BOY(1, "小朋友", Gender.MALE.getCode()),
GIRL(2, "小朋友", Gender.FEMALE.getCode()),
YOUNG_BOY(3, "小弟弟", Gender.MALE.getCode()),
YOUNG_GIRL(4, "小妹妹", Gender.FEMALE.getCode()),
YOUNG_MALE(5, "小哥哥", Gender.MALE.getCode()),
YOUNG_FEMALE(6, "小姐姐", Gender.FEMALE.getCode()),
MAN(7, "大哥哥", Gender.MALE.getCode()),
WOMAN(8, "大姐姐", Gender.FEMALE.getCode()),
OLD_MAN(9, "老爷爷", Gender.MALE.getCode()),
OLD_WOMAN(10, "老奶奶", Gender.FEMALE.getCode());
private Integer code;
private String name;
private Integer gender;
PersonNamed(Integer code, String name, Integer gender) {
this.code = code;
this.name = name;
this.gender = gender;
}
public static PersonNamed get(Integer time) {
for (PersonNamed o : PersonNamed.values()) {
// if (time >= o.getStart() && time < o.getEnd()) {
// return o;
// }
}
return null;
}
public String getName() {
return name;
}
public Integer getGender() {
return gender;
}
public Integer getCode() {
return code;
}
}
package com.ihaoin.hooloo.device.data.enums;
public enum Season {
SPRING_1(3, "初春", 3),
SPRING_2(4, "仲春", 4),
SPRING_3(5, "暮春", 5),
SUMMER_1(6, "初夏", 6),
SUMMER_2(7, "盛夏", 7),
SUMMER_3(8, "夏末", 8),
AUTUMN_1(9, "早秋", 9),
AUTUMN_2(10, "中秋", 10),
AUTUMN_3(11, "晚秋", 11),
WINTER_1(12, "初冬", 12),
WINTER_2(1, "严冬", 1),
WINTER_3(2, "冬末", 2);
private Integer code;
private String name;
private Integer month;
Season(Integer code, String name, Integer month) {
this.code = code;
this.name = name;
this.month = month;
}
public static Season get(Integer month) {
for (Season o : Season.values()) {
if (o.getMonth().equals(month)) {
return o;
}
}
return null;
}
public String getName() {
return name;
}
public Integer getMonth() {
return month;
}
public Integer getCode() {
return code;
}
}
package com.ihaoin.hooloo.device.data.enums;
public enum TimePeriod {
BEFORE_DAWN(1, "凌晨", 0, 5),
MORNING(2, "早晨", 5, 8),
FORENOON(3, "上午", 8, 11),
NOON(4, "中午", 11, 13),
AFTERNOON(5, "下午", 13, 16),
EVENING(6, "傍晚", 16, 19),
NIGHT(7, "夜晚", 19, 24);
private Integer code;
private String name;
private Integer start;
private Integer end;
TimePeriod(Integer code, String name, Integer start, Integer end) {
this.code = code;
this.name = name;
this.start = start;
this.end = end;
}
public static TimePeriod get(Integer time) {
for (TimePeriod o : TimePeriod.values()) {
if (time >= o.getStart() && time < o.getEnd()) {
return o;
}
}
return null;
}
public String getName() {
return name;
}
public Integer getStart() {
return start;
}
public Integer getEnd() {
return end;
}
public Integer getCode() {
return code;
}
}
...@@ -17,6 +17,11 @@ public class Category implements Serializable { ...@@ -17,6 +17,11 @@ public class Category implements Serializable {
private String name; private String name;
/** /**
* 图标
*/
private String icon;
/**
* 商品信息 * 商品信息
*/ */
private List<Goods> goods; private List<Goods> goods;
...@@ -45,6 +50,14 @@ public class Category implements Serializable { ...@@ -45,6 +50,14 @@ public class Category implements Serializable {
this.goods = goods; this.goods = goods;
} }
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (o == null) { if (o == null) {
......
package com.ihaoin.hooloo.device.data.vo; package com.ihaoin.hooloo.device.data.vo;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.List;
public class Images implements Serializable { public class Images implements Serializable {
private String left; private List<String> left;
private Map<String, String> right; // private Map<String, String> right;
public String getLeft() { public List<String> getLeft() {
return left; return left;
} }
public void setLeft(String left) { public void setLeft(List<String> left) {
this.left = left; this.left = left;
} }
public Map<String, String> getRight() { // public Map<String, String> getRight() {
return right; // return right;
} // }
//
public void setRight(Map<String, String> right) { // public void setRight(Map<String, String> right) {
this.right = right; // this.right = right;
} // }
} }
package com.ihaoin.hooloo.device.data.vo;
import java.io.Serializable;
public class InteractionMsg implements Serializable {
/**
* 交互屏状态
* 1 交互屏无人状态
* 2 交互屏从无人到有人
* 3 交互屏正常人体状态
* 4 交互屏由正常人体1变更到正常人体2
*/
private Integer state;
/** 交互屏状态描述 */
private String stateDesc;
/** 内容文案 */
private String sentence;
/** 生成的背景图片地址 */
private String background;
/** 背景图片描述 */
private String backgroundDesc;
/** 生成的IP形象图片地址 */
private String picture;
/** 生成的头像地址 */
private String avatar;
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public String getStateDesc() {
return stateDesc;
}
public void setStateDesc(String stateDesc) {
this.stateDesc = stateDesc;
}
public String getSentence() {
return sentence;
}
public void setSentence(String sentence) {
this.sentence = sentence;
}
public String getBackground() {
return background;
}
public void setBackground(String background) {
this.background = background;
}
public String getBackgroundDesc() {
return backgroundDesc;
}
public void setBackgroundDesc(String backgroundDesc) {
this.backgroundDesc = backgroundDesc;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
}
package com.ihaoin.hooloo.device.data.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
public class KDSMsg implements Serializable {
@JsonProperty("making")
private List<KDSOrder> cookings;
@JsonProperty("toMake")
private List<String> waitings;
@JsonProperty("pick")
private List<String> completeds;
/** 室内温度 */
private Integer inTemperature;
/** 室内温度 */
private Integer outTemperature;
/** 上次维护时间 */
private String lastDevopsTime;
/** 下次维护时间 */
private String nextDevopsTime;
/** 冰箱温度 */
private Integer fridgeTemperature;
/** 内部湿度 */
private Integer humidity;
/** 更换原料时间 */
private String changeMaterialTime;
/** 咖啡机自动清洁时间 */
private String coffeeCleanTime;
/** 日常保洁时间 */
private String dailyCleanTime;
public List<KDSOrder> getCookings() {
return cookings;
}
public List<String> getWaitings() {
return waitings;
}
public void setWaitings(List<String> waitings) {
this.waitings = waitings;
}
public List<String> getCompleteds() {
return completeds;
}
public void setCompleteds(List<String> completeds) {
this.completeds = completeds;
}
public void setCookings(List<KDSOrder> cookings) {
this.cookings = cookings;
}
public Integer getInTemperature() {
return inTemperature;
}
public void setInTemperature(Integer inTemperature) {
this.inTemperature = inTemperature;
}
public Integer getOutTemperature() {
return outTemperature;
}
public void setOutTemperature(Integer outTemperature) {
this.outTemperature = outTemperature;
}
public String getLastDevopsTime() {
return lastDevopsTime;
}
public void setLastDevopsTime(String lastDevopsTime) {
this.lastDevopsTime = lastDevopsTime;
}
public String getNextDevopsTime() {
return nextDevopsTime;
}
public void setNextDevopsTime(String nextDevopsTime) {
this.nextDevopsTime = nextDevopsTime;
}
public Integer getFridgeTemperature() {
return fridgeTemperature;
}
public void setFridgeTemperature(Integer fridgeTemperature) {
this.fridgeTemperature = fridgeTemperature;
}
public Integer getHumidity() {
return humidity;
}
public void setHumidity(Integer humidity) {
this.humidity = humidity;
}
public String getChangeMaterialTime() {
return changeMaterialTime;
}
public void setChangeMaterialTime(String changeMaterialTime) {
this.changeMaterialTime = changeMaterialTime;
}
public String getCoffeeCleanTime() {
return coffeeCleanTime;
}
public void setCoffeeCleanTime(String coffeeCleanTime) {
this.coffeeCleanTime = coffeeCleanTime;
}
public String getDailyCleanTime() {
return dailyCleanTime;
}
public void setDailyCleanTime(String dailyCleanTime) {
this.dailyCleanTime = dailyCleanTime;
}
}
package com.ihaoin.hooloo.device.data.vo;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
public class KDSOrder implements Serializable {
@JsonProperty("order_num")
private String orderNumber;
@JsonProperty("percent")
private Integer progress;
public String getOrderNumber() {
return orderNumber;
}
public void setOrderNumber(String orderNumber) {
this.orderNumber = orderNumber;
}
public Integer getProgress() {
return progress;
}
public void setProgress(Integer progress) {
this.progress = progress;
}
}
package com.ihaoin.hooloo.device.test;
import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.data.vo.KDSOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
public class KDSGen {
public static KDSMsg getKdsMsg() {
KDSMsg msg = new KDSMsg();
List<String> days = Arrays.asList("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
String day = days.get(getRandom(days.size()));
msg.setCookings(getCookings(day));
msg.setWaitings(getOrders(day, 6));
msg.setCompleteds(getOrders(day, 9));
msg.setInTemperature(getRandom(10, 20));
msg.setOutTemperature(getRandom(20, 30));
msg.setFridgeTemperature(getRandom(0, 10));
msg.setHumidity(getRandom(40, 70));
msg.setCoffeeCleanTime("07月26日 09:50:07");
msg.setChangeMaterialTime("07月26日 09:50:07");
msg.setDailyCleanTime("07月26日 09:50:07");
return msg;
}
public static List<KDSOrder> getCookings(String day) {
int size = getRandom(2);
List<KDSOrder> list = new ArrayList<>();
for (int i = 0; i <= size; i++) {
KDSOrder order = new KDSOrder();
order.setOrderNumber(getOrderNum(day));
order.setProgress(getRandom(100));
list.add(order);
}
return list;
}
public static List<String> getOrders(String day, int max) {
int size = getRandom(max);
List<String> list = new ArrayList<>();
for (int i = 0; i <= size; i++) {
list.add(getOrderNum(day));
}
return list;
}
public static Integer getRandom(int min, int max) {
int r = new Random().nextInt(max);
if (r < min) {
r += min;
}
return r;
}
public static Integer getRandom(int max) {
return getRandom(0, max);
}
public static String getOrderNum(String day) {
Integer num = getRandom(200, 999);
return day + num;
}
}
package com.ihaoin.hooloo.device.util; package com.ihaoin.hooloo.device.util;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map; import java.util.Map;
public class CollectionUtils { public class CollectionUtils {
...@@ -11,6 +12,22 @@ public class CollectionUtils { ...@@ -11,6 +12,22 @@ public class CollectionUtils {
return (T) collection.toArray()[collection.size() - 1]; return (T) collection.toArray()[collection.size() - 1];
} }
public static Integer length(Collection collection) {
if (isEmpty(collection)) {
return 0;
}
return collection.size();
}
public static <T> List<T> subList(List<T> list, int start, int end) {
if (isEmpty(list)) {
return null;
}
if (length(list) <= end) {
return list;
}
return list.subList(start, end);
}
public static Boolean isEmpty(Object[] collection) { public static Boolean isEmpty(Object[] collection) {
if (collection == null || collection.length == 0) { if (collection == null || collection.length == 0) {
......
...@@ -28,6 +28,8 @@ import com.ihaoin.hooloo.device.config.Base; ...@@ -28,6 +28,8 @@ import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.TrolleyGoods; import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.SkuState; import com.ihaoin.hooloo.device.data.enums.SkuState;
import com.ihaoin.hooloo.device.data.vo.Goods; import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg;
import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.data.vo.Sku; import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.view.ClearDialog; import com.ihaoin.hooloo.device.view.ClearDialog;
import com.ihaoin.hooloo.device.view.ConfirmOrderDialog; import com.ihaoin.hooloo.device.view.ConfirmOrderDialog;
...@@ -69,6 +71,20 @@ public class Utils { ...@@ -69,6 +71,20 @@ public class Utils {
context.sendBroadcast(intent); context.sendBroadcast(intent);
} }
public static void sendKdsMsgBroadcast(Context context, KDSMsg msg) {
Intent intent = new Intent();
intent.setAction(Base.BROADCAST_ACTION_KDS_INFO);
intent.putExtra("msg", msg);
context.sendBroadcast(intent);
}
public static void sendInteractionMsgBroadcast(Context context, InteractionMsg msg) {
Intent intent = new Intent();
intent.setAction(Base.BROADCAST_ACTION_INTERACTION_INFO);
intent.putExtra("msg", msg);
context.sendBroadcast(intent);
}
public static void sendAddGoodsBroadcast(Context context, Goods goods, Sku sku, Integer count) { public static void sendAddGoodsBroadcast(Context context, Goods goods, Sku sku, Integer count) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setAction(Base.BROADCAST_ACTION_ADD_GOODS); intent.setAction(Base.BROADCAST_ACTION_ADD_GOODS);
......
...@@ -106,7 +106,7 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -106,7 +106,7 @@ public class ConfirmOrderDialog extends Dialog {
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
postConfirmOrder(); postConfirmOrder();
Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose)); // Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose));
} }
private void showConfirmViews() { private void showConfirmViews() {
......
...@@ -145,7 +145,7 @@ public class GoodsDetailDialog extends Dialog { ...@@ -145,7 +145,7 @@ public class GoodsDetailDialog extends Dialog {
// introIndicator.check(0); // introIndicator.check(0);
if (introIndicator.getChildCount() > 1) { if (introIndicator.getChildCount() > 1) {
introIndicator.setVisibility(View.VISIBLE); introIndicator.setVisibility(View.VISIBLE);
startPageThread(); startPagerThread();
introPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { introPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override @Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
...@@ -205,7 +205,7 @@ public class GoodsDetailDialog extends Dialog { ...@@ -205,7 +205,7 @@ public class GoodsDetailDialog extends Dialog {
buildSpecs(); buildSpecs();
buildDetails(); buildDetails();
Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose)); // Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose));
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
} }
...@@ -226,7 +226,7 @@ public class GoodsDetailDialog extends Dialog { ...@@ -226,7 +226,7 @@ public class GoodsDetailDialog extends Dialog {
} }
}; };
private void startPageThread() { private void startPagerThread() {
pagerHandler = new PagerHandler(); pagerHandler = new PagerHandler();
pagerThread = new PagerThread(); pagerThread = new PagerThread();
pagerThread.start(); pagerThread.start();
......
...@@ -27,7 +27,7 @@ public class InteractionPresentation extends Presentation { ...@@ -27,7 +27,7 @@ public class InteractionPresentation extends Presentation {
initViews(); initViews();
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
registDetectionReceiver(); registInteractionReceiver();
} }
private void initViews() { private void initViews() {
...@@ -37,28 +37,27 @@ public class InteractionPresentation extends Presentation { ...@@ -37,28 +37,27 @@ public class InteractionPresentation extends Presentation {
@Override @Override
public void onDismiss(DialogInterface dialog) { public void onDismiss(DialogInterface dialog) {
Utils.i("interaction present dismiss"); Utils.i("interaction present dismiss");
unregistDetectionReceiver(); unregistInteractionReceiver();
} }
}; };
DetectionReceiver detectionReceiver = null; InteractionReceiver interactionReceiver = null;
private void registDetectionReceiver() { private void registInteractionReceiver() {
detectionReceiver = new DetectionReceiver(); interactionReceiver = new InteractionReceiver();
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_DETECTION_BODY); filter.addAction(Base.BROADCAST_ACTION_INTERACTION_INFO);
filter.addAction(Base.BROADCAST_ACTION_DETECTION_NONE); getContext().registerReceiver(interactionReceiver, filter);
getContext().registerReceiver(detectionReceiver, filter);
} }
private void unregistDetectionReceiver() { private void unregistInteractionReceiver() {
if (detectionReceiver != null) { if (interactionReceiver != null) {
getContext().unregisterReceiver(detectionReceiver); getContext().unregisterReceiver(interactionReceiver);
detectionReceiver = null; interactionReceiver = null;
} }
} }
class DetectionReceiver extends BroadcastReceiver { class InteractionReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
} }
......
...@@ -8,6 +8,7 @@ import android.content.Context; ...@@ -8,6 +8,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.hardware.display.DisplayManager; import android.hardware.display.DisplayManager;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
...@@ -23,18 +24,21 @@ import android.widget.RelativeLayout; ...@@ -23,18 +24,21 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.ihaoin.hooloo.device.HLApplication; import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.adapter.GoodsAdapter; import com.ihaoin.hooloo.device.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.adapter.RecommendAdapter; import com.ihaoin.hooloo.device.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.component.InteractionSocket;
import com.ihaoin.hooloo.device.component.KDSSocket;
import com.ihaoin.hooloo.device.component.NetworkHandler; import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.component.SettingsQueue; import com.ihaoin.hooloo.device.component.SettingsQueue;
import com.ihaoin.hooloo.device.component.SocketClient;
import com.ihaoin.hooloo.device.component.SocketServerTest;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.MainData; import com.ihaoin.hooloo.device.data.MainData;
...@@ -109,13 +113,6 @@ public class LauncherActivity extends Activity { ...@@ -109,13 +113,6 @@ public class LauncherActivity extends Activity {
initSettingsQueue(); initSettingsQueue();
startTimeoutThread(); startTimeoutThread();
// startServer();
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
startClient();
getMachineCode(); getMachineCode();
} }
...@@ -133,18 +130,6 @@ public class LauncherActivity extends Activity { ...@@ -133,18 +130,6 @@ public class LauncherActivity extends Activity {
new TimeoutThread().start(); new TimeoutThread().start();
} }
private void startServer() {
SocketServerTest server = new SocketServerTest(this);
new Thread(server).start();
}
private SocketClient socketClient = null;
private void startClient() {
socketClient = new SocketClient(this);
socketClient.start();
}
@Override @Override
public boolean dispatchTouchEvent(MotionEvent ev) { public boolean dispatchTouchEvent(MotionEvent ev) {
Utils.i("dispatchTouchEvent"); Utils.i("dispatchTouchEvent");
...@@ -158,14 +143,14 @@ public class LauncherActivity extends Activity { ...@@ -158,14 +143,14 @@ public class LauncherActivity extends Activity {
} }
private void getMachineCode() { private void getMachineCode() {
AppConfig.MACHINE_CODE = SharedPreferencesUtils.getMachineCode(this); // AppConfig.MACHINE_CODE = SharedPreferencesUtils.getMachineCode(this);
if (StringUtils.isEmpty(AppConfig.MACHINE_CODE)) { // if (StringUtils.isEmpty(AppConfig.MACHINE_CODE)) {
Utils.fastBroadcast(this, Base.BROADCAST_SOCKET_GET_MACHINE_CODE); // 从设备上获取机器编码 // Utils.fastBroadcast(this, Base.BROADCAST_SOCKET_GET_MACHINE_CODE); // 从设备上获取机器编码
return; // return;
} // }
Utils.i("machine code: " + AppConfig.MACHINE_CODE); // Utils.i("machine code: " + AppConfig.MACHINE_CODE);
loadData(); // loadData();
HttpUtil.postRegistrationId(); // HttpUtil.postRegistrationId();
} }
private void initRecommends() { private void initRecommends() {
...@@ -305,6 +290,11 @@ public class LauncherActivity extends Activity { ...@@ -305,6 +290,11 @@ public class LauncherActivity extends Activity {
} }
private void initCategorys() { private void initCategorys() {
int w = Utils.getDimens(LauncherActivity.this, R.dimen.category_drawable_width);
int h = Utils.getDimens(LauncherActivity.this, R.dimen.category_drawable_height);
int drawablePadding = Utils.getDimens(LauncherActivity.this, R.dimen.category_drawable_padding);
Rect rect = new Rect(0, 0, w, h);
groupCategory.removeAllViews(); groupCategory.removeAllViews();
List<Category> categorys = HLApplication.getMainData().getCategorys(); List<Category> categorys = HLApplication.getMainData().getCategorys();
if (!CollectionUtils.isEmpty(categorys)) { if (!CollectionUtils.isEmpty(categorys)) {
...@@ -314,17 +304,30 @@ public class LauncherActivity extends Activity { ...@@ -314,17 +304,30 @@ public class LauncherActivity extends Activity {
continue; continue;
} }
RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.MATCH_PARENT, RadioGroup.LayoutParams.WRAP_CONTENT); RadioGroup.LayoutParams layoutParams = new RadioGroup.LayoutParams(RadioGroup.LayoutParams.MATCH_PARENT, RadioGroup.LayoutParams.WRAP_CONTENT);
RadioButton view = (RadioButton) this.getLayoutInflater().inflate(R.layout.item_category, null); RadioButton butnRadio = (RadioButton) this.getLayoutInflater().inflate(R.layout.item_category, null);
view.setText(category.getName()); butnRadio.setText(category.getName());
view.setId(category.getId()); butnRadio.setId(category.getId());
view.setTag(category); butnRadio.setTag(category);
if (i == 0) { if (i == 0) {
view.setChecked(true); butnRadio.setChecked(true);
view.getPaint().setFakeBoldText(true); butnRadio.getPaint().setFakeBoldText(true);
} }
groupCategory.addView(view, layoutParams); Utils.getGlide(LauncherActivity.this).load(category.getIcon()).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable drawable, @Nullable Transition<? super Drawable> transition) {
drawable.setBounds(rect);
butnRadio.setCompoundDrawablePadding(drawablePadding);
butnRadio.setCompoundDrawables(null, drawable, null, null);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
groupCategory.addView(butnRadio, layoutParams);
view.setOnClickListener(v -> { butnRadio.setOnClickListener(v -> {
Integer checkedId = v.getId(); Integer checkedId = v.getId();
Category tagCategory = (Category) groupCategory.findViewById(checkedId).getTag(); Category tagCategory = (Category) groupCategory.findViewById(checkedId).getTag();
int position = categorys.indexOf(tagCategory); int position = categorys.indexOf(tagCategory);
...@@ -441,7 +444,6 @@ public class LauncherActivity extends Activity { ...@@ -441,7 +444,6 @@ public class LauncherActivity extends Activity {
this.unregistSkuChangeReceiver(); this.unregistSkuChangeReceiver();
this.unregistGoodsChangeReceiver(); this.unregistGoodsChangeReceiver();
this.unregistTouchReceiver(); this.unregistTouchReceiver();
socketClient.close();
System.exit(0); System.exit(0);
} }
...@@ -576,6 +578,8 @@ public class LauncherActivity extends Activity { ...@@ -576,6 +578,8 @@ public class LauncherActivity extends Activity {
} }
presentView = new InteractionPresentation(this, displays[1]); presentView = new InteractionPresentation(this, displays[1]);
presentView.show(); presentView.show();
startIAClient();
} }
/** 隐藏交互屏 */ /** 隐藏交互屏 */
...@@ -588,6 +592,8 @@ public class LauncherActivity extends Activity { ...@@ -588,6 +592,8 @@ public class LauncherActivity extends Activity {
} }
presentView.dismiss(); presentView.dismiss();
presentView = null; presentView = null;
stopIAClient();
} }
/** 显示菜单屏KDS */ /** 显示菜单屏KDS */
...@@ -606,6 +612,8 @@ public class LauncherActivity extends Activity { ...@@ -606,6 +612,8 @@ public class LauncherActivity extends Activity {
} }
menuView = new MenuPresentation(this, displays[1]); menuView = new MenuPresentation(this, displays[1]);
menuView.show(); menuView.show();
startKdsClient();
} }
private void hideMenuView() { private void hideMenuView() {
...@@ -617,6 +625,35 @@ public class LauncherActivity extends Activity { ...@@ -617,6 +625,35 @@ public class LauncherActivity extends Activity {
} }
menuView.dismiss(); menuView.dismiss();
menuView = null; menuView = null;
stopKdsClient();
}
private KDSSocket kdsSocket = null;
private InteractionSocket interactionSocket = null;
private void startKdsClient() {
kdsSocket = new KDSSocket(this);
kdsSocket.start();
}
private void stopKdsClient() {
if (kdsSocket != null) {
kdsSocket.close();
kdsSocket = null;
}
}
private void startIAClient() {
interactionSocket = new InteractionSocket(this);
interactionSocket.start();
}
private void stopIAClient() {
if (interactionSocket != null) {
interactionSocket.close();
interactionSocket = null;
}
} }
private void requestPermissions() { private void requestPermissions() {
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.view;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.app.Presentation; import android.app.Presentation;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.view.Display; import android.view.Display;
import android.widget.GridView; import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.fasterxml.jackson.core.type.TypeReference;
import com.ihaoin.hooloo.device.HLApplication; import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.adapter.OrderAdapter; import com.ihaoin.hooloo.device.component.IntroViewPager;
import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.MainData; import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.enums.OrderState; import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.data.vo.Order; import com.ihaoin.hooloo.device.data.vo.KDSOrder;
import com.ihaoin.hooloo.device.data.vo.OrderPkg; import com.ihaoin.hooloo.device.data.vo.OrderPkg;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.test.KDSGen;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
public class MenuPresentation extends Presentation { public class MenuPresentation extends Presentation {
private List<OrderPkg> pkgs; // private List<OrderPkg> orderPkgs;
private LoadOrdersHandler loadOrdersHandler; private KDSMsg mKdsMsg;
private OrderStateChangeReceiver orderStateChangeReceiver; // private LoadOrdersHandler loadOrdersHandler;
// private OrderStateChangeReceiver orderStateChangeReceiver;
private List<Order> cookingOrders;
private List<Order> waitingOrders; private IntroViewPager introPager;
private List<Order> completedOrders; // private List<Order> cookingOrders;
// private List<Order> waitingOrders;
private ImageView imgLeft; // private List<Order> completedOrders;
private GridView gridCooking;
private GridView gridWaiting; // private ImageView imgLeft;
private GridView gridCompleted; // private GridView gridCooking;
private OrderAdapter cookingAdapter; // private GridView gridWaiting;
private OrderAdapter waitingAdapter; // private GridView gridCompleted;
private OrderAdapter completedAdapter; // private OrderAdapter cookingAdapter;
// private OrderAdapter waitingAdapter;
private TextView txtSupplement; // private OrderAdapter completedAdapter;
private TextView txtClear;
private TextView txtOutsideTemp;
private TextView txtInsideTemp;
private TextView txtFridgeTemp;
private TextView txtInsideHumidity;
private TextView txtTimerClear;
private TextView txtTimerMaterial;
private TextView txtTimerUsual;
private ImageView imgAvatar;
private List<View> progressViews = new ArrayList<>();
private List<TextView> waitingViews = new ArrayList<>();
private List<TextView> completedViews = new ArrayList<>();
public MenuPresentation(Context outerContext, Display display) { public MenuPresentation(Context outerContext, Display display) {
super(outerContext, display); super(outerContext, display);
...@@ -69,214 +79,407 @@ public class MenuPresentation extends Presentation { ...@@ -69,214 +79,407 @@ public class MenuPresentation extends Presentation {
setContentView(R.layout.present_menu); setContentView(R.layout.present_menu);
initViews(); initViews();
loadDatas(); // loadDatas();
registOrderChangeReceiver(); // registOrderChangeReceiver();
registerMachineMessageReceiver(); registerKDSMessageReceiver();
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
new MachineStateTimer().start(); startPagerThread();
} }
private void initViews() { private void initViews() {
imgLeft = findViewById(R.id.img_left); imgAvatar = findViewById(R.id.img_avatar);
gridCooking = findViewById(R.id.grid_cooking); introPager = findViewById(R.id.intro_pager);
gridWaiting = findViewById(R.id.grid_waiting); // imgLeft = findViewById(R.id.img_left);
gridCompleted = findViewById(R.id.grid_completed); // gridCooking = findViewById(R.id.grid_cooking);
// gridWaiting = findViewById(R.id.grid_waiting);
txtSupplement = findViewById(R.id.txt_timer_supplement); // gridCompleted = findViewById(R.id.grid_completed);
txtClear = findViewById(R.id.txt_timer_clear); //
// txtSupplement = findViewById(R.id.txt_timer_supplement);
cookingAdapter = new OrderAdapter(getContext()); // txtClear = findViewById(R.id.txt_timer_clear);
waitingAdapter = new OrderAdapter(getContext()); //
completedAdapter = new OrderAdapter(getContext()); // cookingAdapter = new OrderAdapter(getContext());
// waitingAdapter = new OrderAdapter(getContext());
gridCooking.setAdapter(cookingAdapter); // completedAdapter = new OrderAdapter(getContext());
gridWaiting.setAdapter(waitingAdapter); //
gridCompleted.setAdapter(completedAdapter); // gridCooking.setAdapter(cookingAdapter);
// gridWaiting.setAdapter(waitingAdapter);
// gridCompleted.setAdapter(completedAdapter);
progressViews.add(findViewById(R.id.progress1));
progressViews.add(findViewById(R.id.progress2));
waitingViews.add(findViewById(R.id.waiting1));
waitingViews.add(findViewById(R.id.waiting2));
waitingViews.add(findViewById(R.id.waiting3));
waitingViews.add(findViewById(R.id.waiting4));
waitingViews.add(findViewById(R.id.waiting5));
waitingViews.add(findViewById(R.id.waiting6));
completedViews.add(findViewById(R.id.completed1));
completedViews.add(findViewById(R.id.completed2));
completedViews.add(findViewById(R.id.completed3));
completedViews.add(findViewById(R.id.completed4));
completedViews.add(findViewById(R.id.completed5));
completedViews.add(findViewById(R.id.completed6));
completedViews.add(findViewById(R.id.completed7));
completedViews.add(findViewById(R.id.completed8));
completedViews.add(findViewById(R.id.completed9));
txtOutsideTemp = findViewById(R.id.txt_outside_temp);
txtInsideTemp = findViewById(R.id.txt_inside_temp);
txtFridgeTemp = findViewById(R.id.txt_fridge_temp);
txtInsideHumidity = findViewById(R.id.txt_inside_humidity);
txtTimerClear = findViewById(R.id.txt_timer_clear);
txtTimerMaterial = findViewById(R.id.txt_timer_material);
txtTimerUsual = findViewById(R.id.txt_timer_usual);
AnimationDrawable anim = (AnimationDrawable) getContext().getDrawable(R.drawable.menu_avatar);
imgAvatar.setImageDrawable(anim);
anim.start();
} }
private String getRightImage(String state) { // private String getRightImage(String state) {
MainData mainData = HLApplication.getMainData(); // MainData mainData = HLApplication.getMainData();
if (mainData == null || mainData.getImages() == null) { // if (mainData == null || mainData.getImages() == null) {
return null; // return null;
} // }
if (CollectionUtils.isEmpty(mainData.getImages().getRight())) { // if (CollectionUtils.isEmpty(mainData.getImages().getRight())) {
return null; // return null;
} // }
return mainData.getImages().getRight().get(state); // return mainData.getImages().getRight().get(state);
} // }
private void showImages() { private void showImages() {
MainData mainData = HLApplication.getMainData(); MainData mainData = HLApplication.getMainData();
if (mainData == null || mainData.getImages() == null) { if (mainData == null || mainData.getImages() == null) {
return; return;
} }
if (!StringUtils.isEmpty(mainData.getImages().getLeft())) { introPager.removeAllViews();
Utils.getGlide(getContext()).load(mainData.getImages().getLeft()).into(imgLeft); // List<String> lefts = Arrays.asList("https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/08/点单屏内容图-拿铁.png", "https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/08/点单屏内容图-拿铁.png");
if (CollectionUtils.isEmpty(mainData.getImages().getLeft())) {
return;
} }
List<View> introViews = new ArrayList<>();
mainData.getImages().getLeft().forEach(url -> introViews.add(getIntroImage(url)));
introPager.setIntroViews(introViews);
} }
public void mainDataChanged() { private ImageView getIntroImage(String url) {
showImages(); ImageView imgIntro = new ImageView(getContext());
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
imgIntro.setLayoutParams(layoutParams);
imgIntro.setAdjustViewBounds(true);
Utils.getGlide(getContext()).load(url).into(imgIntro);
return imgIntro;
} }
private void loadDatas() { private PagerThread pagerThread;
loadOrdersHandler = new LoadOrdersHandler(); private PagerHandler pagerHandler;
HttpUtil.getOrders(loadOrdersHandler);
private void startPagerThread() {
pagerHandler = new PagerHandler();
pagerThread = new PagerThread();
pagerThread.start();
} }
private void setDatas(String json) { private class PagerThread extends Thread {
try { @Override
pkgs = JsonUtils.getMapper().readValue(json, new TypeReference<List<OrderPkg>>() { public void run() {
}); try {
orderDataChanged(); while (true) {
} catch (Exception e) { Thread.sleep(1000 * 5);
e.printStackTrace(); pagerHandler.sendEmptyMessage(1);
KDSMsg msg = KDSGen.getKdsMsg();
Utils.sendKdsMsgBroadcast(getContext(), msg);
}
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
private void orderDataChanged() { private class PagerHandler extends Handler {
List<Order> cookings = getOrders(OrderState.COOKING.getCode()); @Override
List<Order> waitings = getOrders(OrderState.WAITING.getCode()); public void handleMessage(@NonNull Message msg) {
List<Order> completes = getOrders(OrderState.COMPLETED.getCode()); int count = introPager.getCount();
if(!CollectionUtils.isEmpty(cookings) && cookings.size()>2){ if (count <= 1) {
cookings = cookings.subList(0,2); return;
} }
if(!CollectionUtils.isEmpty(waitings) && waitings.size()>6){ int index = introPager.getCurrentItem();
waitings = waitings.subList(0,6); if (index + 1 >= count) {
} index = 0;
if(!CollectionUtils.isEmpty(completes) && completes.size()>9){ } else {
completes = completes.subList(0,9); index++;
}
introPager.setCurrentItem(index, true);
} }
cookingAdapter.setOrders(cookings);
waitingAdapter.setOrders(waitings);
completedAdapter.setOrders(completes);
cookingAdapter.notifyDataSetChanged();
waitingAdapter.notifyDataSetChanged();
completedAdapter.notifyDataSetChanged();
showImages();
} }
private void registOrderChangeReceiver() { public void mainDataChanged() {
orderStateChangeReceiver = new OrderStateChangeReceiver(); showImages();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.PUSH_ACTION_ORDER_STATE_CHANGED);
getContext().registerReceiver(orderStateChangeReceiver, filter);
} }
private void unregistOrderChangeReceiver() { // private void loadDatas() {
if (orderStateChangeReceiver != null) { // loadOrdersHandler = new LoadOrdersHandler();
getContext().unregisterReceiver(orderStateChangeReceiver); // HttpUtil.getOrders(loadOrdersHandler);
orderStateChangeReceiver = null; // }
//
// private void setDatas(String json) {
// try {
// orderPkgs = JsonUtils.getMapper().readValue(json, new TypeReference<List<OrderPkg>>() {
// });
// orderDataChanged();
//// List<OrderPkg> pkgs = JsonUtils.getMapper().readValue(json, new TypeReference<List<OrderPkg>>() {
//// });
//// setOrders(pkgs);
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// private void setOrders(List<OrderPkg> pkgs) {
// try {
// if (CollectionUtils.isEmpty(pkgs)) {
// return;
// }
// List<Order> cookings = getOrders(pkgs, OrderState.COOKING.getCode());
// if (CollectionUtils.isEmpty(cookings)) {
// return;
// }
// cookings.forEach(order -> order.setProgress(getProgressByOrder(order)));
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// orderPkgs = pkgs;
// orderDataChanged();
// }
// }
//
// private Integer getProgressByOrder(Order order) {
// List<Order> cookings = getOrders(OrderState.COOKING.getCode());
// if (CollectionUtils.isEmpty(cookings)) {
// return 0;
// }
// for (Order o : cookings) {
// if (o.equals(order)) {
// return o.getProgress();
// }
// }
// return 0;
// }
@SuppressLint("StringFormatMatches")
private void setMachineState() {
if (mKdsMsg == null) {
return;
} }
txtOutsideTemp.setText(getContext().getString(R.string.txt_outside_temp, mKdsMsg.getOutTemperature()));
txtInsideTemp.setText(getContext().getString(R.string.txt_inside_temp, mKdsMsg.getInTemperature()));
txtFridgeTemp.setText(getContext().getString(R.string.txt_fridge_temp, mKdsMsg.getFridgeTemperature()));
txtInsideHumidity.setText(getContext().getString(R.string.txt_inside_humidity, mKdsMsg.getHumidity()));
txtTimerClear.setText(getContext().getString(R.string.txt_timer_clear, mKdsMsg.getCoffeeCleanTime()));
txtTimerMaterial.setText(getContext().getString(R.string.txt_timer_material, mKdsMsg.getChangeMaterialTime()));
txtTimerUsual.setText(getContext().getString(R.string.txt_timer_usual, mKdsMsg.getDailyCleanTime()));
} }
private List<Order> getOrders(Integer state) { private void orderDataChanged() {
if (CollectionUtils.isEmpty(pkgs)) { if (mKdsMsg == null) {
return null; return;
} }
Map<Integer, OrderPkg> map = pkgs.stream().collect(Collectors.toMap(OrderPkg::getState, Function.identity())); List<KDSOrder> cookings = mKdsMsg.getCookings();
if (CollectionUtils.isEmpty(map)) { List<String> waitings = mKdsMsg.getWaitings();
return null; List<String> completes = mKdsMsg.getCompleteds();
cookings = CollectionUtils.subList(cookings, 0, 2);
waitings = CollectionUtils.subList(waitings, 0, 6);
completes = CollectionUtils.subList(completes, 0, 9);
progressViews.forEach(v -> v.setVisibility(View.INVISIBLE));
waitingViews.forEach(v -> v.setVisibility(View.INVISIBLE));
completedViews.forEach(v -> v.setVisibility(View.INVISIBLE));
if (!CollectionUtils.isEmpty(waitings)) {
for (int i = 0; i < waitings.size(); i++) {
TextView v = waitingViews.get(i);
v.setText(waitings.get(i));
v.setVisibility(View.VISIBLE);
}
} }
OrderPkg pkg = map.get(state); if (!CollectionUtils.isEmpty(completes)) {
if (pkg == null) { for (int i = 0; i < completes.size(); i++) {
return null; TextView v = completedViews.get(i);
v.setText(completes.get(i));
v.setVisibility(View.VISIBLE);
}
} }
return pkg.getOrders(); if (!CollectionUtils.isEmpty(cookings)) {
} for (int i = 0; i < cookings.size(); i++) {
KDSOrder order = cookings.get(i);
View v = progressViews.get(i);
// v.setText(cookings.get(i).getOrderNumber());
TextView orderNum = v.findViewById(R.id.txt_order_number);
View imgTmp = v.findViewById(R.id.img_tmp);
ImageView imgMask = v.findViewById(R.id.img_mask);
TextView txtProgress = v.findViewById(R.id.txt_progress);
orderNum.setText(order.getOrderNumber());
txtProgress.setText(order.getProgress() + "%");
LinearLayout.LayoutParams lpMask = (LinearLayout.LayoutParams) imgMask.getLayoutParams();
LinearLayout.LayoutParams lpTemp = (LinearLayout.LayoutParams) imgTmp.getLayoutParams();
ValueAnimator animator = new ValueAnimator();
animator.setDuration(500);
// Utils.i(String.format("weight:%s, pro:%s", lpMask.weight, order.getProgress()));
animator.setIntValues((int) lpTemp.weight, order.getProgress());
animator.addUpdateListener(animation -> {
int progress = (Integer) animation.getAnimatedValue();
lpMask.weight = 100 - progress;
imgMask.setLayoutParams(lpMask);
lpTemp.weight = progress;
imgTmp.setLayoutParams(lpTemp);
});
animator.start();
v.setVisibility(View.VISIBLE);
class LoadOrdersHandler extends NetworkHandler {
@Override
public void handleMessage(@NonNull Message msg) {
super.handleMessage(msg);
if (msg.what != 1) {
return;
} }
// String body = "[{\"state\":1,\"desc\":\"制作中\",\"orders\":[{\"orderId\":1011,\"orderNo\":\"N20220220A19231\",\"orderNumber\":\"Mon101\"},{\"orderId\":1012,\"orderNo\":\"N20220220A19232\",\"orderNumber\":\"Mon102\"},{\"orderId\":1013,\"orderNo\":\"N20220220A19233\",\"orderNumber\":\"Mon103\"}]},{\"state\":2,\"desc\":\"待制作\",\"orders\":[{\"orderId\":1014,\"orderNo\":\"N20220220A19234\",\"orderNumber\":\"Mon104\"},{\"orderId\":1015,\"orderNo\":\"N20220220A19235\",\"orderNumber\":\"Mon105\"},{\"orderId\":1016,\"orderNo\":\"N20220220A19236\",\"orderNumber\":\"Mon106\"},{\"orderId\":1017,\"orderNo\":\"N20220220A19237\",\"orderNumber\":\"Mon107\"},{\"orderId\":1018,\"orderNo\":\"N20220220A19238\",\"orderNumber\":\"Mon108\"}]},{\"state\":3,\"desc\":\"可取餐\",\"orders\":[{\"orderId\":1019,\"orderNo\":\"N20220220A19239\",\"orderNumber\":\"Mon109\"},{\"orderId\":1001,\"orderNo\":\"N20220220A19221\",\"orderNumber\":\"Mon121\"},{\"orderId\":1002,\"orderNo\":\"N20220220A19222\",\"orderNumber\":\"Mon122\"},{\"orderId\":1003,\"orderNo\":\"N20220220A19223\",\"orderNumber\":\"Mon123\"},{\"orderId\":1004,\"orderNo\":\"N20220220A19224\",\"orderNumber\":\"Mon124\"},{\"orderId\":1005,\"orderNo\":\"N20220220A19241\",\"orderNumber\":\"Mon141\"},{\"orderId\":1006,\"orderNo\":\"N20220220A19251\",\"orderNumber\":\"Mon151\"}]}]";
if (msg.obj == null) {
return;
}
String body = msg.obj.toString();
if (StringUtils.isEmpty(body)) {
return;
}
setDatas(body);
} }
}
class OrderStateChangeReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
try {
String msgBody = intent.getStringExtra(Base.PUSH_DEFAULT_EXTRA);
if (StringUtils.isEmpty(msgBody)) {
return;
}
Order order = JsonUtils.getMapper().readValue(msgBody, Order.class); // cookingAdapter.setOrders(cookings);
if (order == null || order.getState() == null || order.getOrderId() == null || order.getOrderId() <= 0 // waitingAdapter.setOrders(waitings);
|| StringUtils.isEmpty(order.getOrderNo()) || StringUtils.isEmpty(order.getOrderNumber())) { // completedAdapter.setOrders(completes);
return; //
} // cookingAdapter.notifyDataSetChanged();
// waitingAdapter.notifyDataSetChanged();
// completedAdapter.notifyDataSetChanged();
if (CollectionUtils.isEmpty(pkgs)) { showImages();
OrderState state = OrderState.get(order.getState());
if (state == null) {
return;
}
pkgs = new ArrayList<>();
List<Order> orders = new ArrayList<>();
orders.add(order);
OrderPkg pkg = new OrderPkg();
pkg.setState(order.getState());
pkg.setOrders(orders);
pkgs.add(pkg);
} else {
// 删除订单
pkgs.forEach(pkg -> {
if (CollectionUtils.isEmpty(pkg.getOrders())) {
return;
}
pkg.getOrders().remove(order);
});
OrderState state = OrderState.get(order.getState());
if (state == null) {
return;
}
// 添加新订单状态
OrderPkg pkg = getOrdersByState(pkgs, order.getState());
if (pkg == null) {
List<Order> orders = new ArrayList<>();
orders.add(order);
pkg = new OrderPkg();
pkg.setState(order.getState());
pkg.setOrders(orders);
pkgs.add(pkg);
} else {
List<Order> orders = pkg.getOrders();
if (CollectionUtils.isEmpty(orders)) {
orders = new ArrayList<>();
}
orders.add(order);
pkg.setOrders(orders);
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
orderDataChanged();
}
}
} }
// private List<Order> getOrders(Integer state) {
// return getOrders(orderPkgs, state);
// }
// private List<Order> getOrders(List<OrderPkg> pkgs, Integer state) {
// if (CollectionUtils.isEmpty(pkgs)) {
// return null;
// }
// Map<Integer, OrderPkg> map = pkgs.stream().collect(Collectors.toMap(OrderPkg::getState, Function.identity()));
// if (CollectionUtils.isEmpty(map)) {
// return null;
// }
// OrderPkg pkg = map.get(state);
// if (pkg == null) {
// return null;
// }
// return pkg.getOrders();
// }
// class LoadOrdersHandler extends NetworkHandler {
// @Override
// public void handleMessage(@NonNull Message msg) {
// super.handleMessage(msg);
// if (msg.what != 1) {
// return;
// }
//// String body = "[{\"state\":1,\"desc\":\"制作中\",\"orders\":[{\"orderId\":1011,\"orderNo\":\"N20220220A19231\",\"orderNumber\":\"Mon101\"},{\"orderId\":1012,\"orderNo\":\"N20220220A19232\",\"orderNumber\":\"Mon102\"},{\"orderId\":1013,\"orderNo\":\"N20220220A19233\",\"orderNumber\":\"Mon103\"}]},{\"state\":2,\"desc\":\"待制作\",\"orders\":[{\"orderId\":1014,\"orderNo\":\"N20220220A19234\",\"orderNumber\":\"Mon104\"},{\"orderId\":1015,\"orderNo\":\"N20220220A19235\",\"orderNumber\":\"Mon105\"},{\"orderId\":1016,\"orderNo\":\"N20220220A19236\",\"orderNumber\":\"Mon106\"},{\"orderId\":1017,\"orderNo\":\"N20220220A19237\",\"orderNumber\":\"Mon107\"},{\"orderId\":1018,\"orderNo\":\"N20220220A19238\",\"orderNumber\":\"Mon108\"}]},{\"state\":3,\"desc\":\"可取餐\",\"orders\":[{\"orderId\":1019,\"orderNo\":\"N20220220A19239\",\"orderNumber\":\"Mon109\"},{\"orderId\":1001,\"orderNo\":\"N20220220A19221\",\"orderNumber\":\"Mon121\"},{\"orderId\":1002,\"orderNo\":\"N20220220A19222\",\"orderNumber\":\"Mon122\"},{\"orderId\":1003,\"orderNo\":\"N20220220A19223\",\"orderNumber\":\"Mon123\"},{\"orderId\":1004,\"orderNo\":\"N20220220A19224\",\"orderNumber\":\"Mon124\"},{\"orderId\":1005,\"orderNo\":\"N20220220A19241\",\"orderNumber\":\"Mon141\"},{\"orderId\":1006,\"orderNo\":\"N20220220A19251\",\"orderNumber\":\"Mon151\"}]}]";
// if (msg.obj == null) {
// return;
// }
// String body = msg.obj.toString();
// if (StringUtils.isEmpty(body)) {
// return;
// }
// setDatas(body);
// }
// }
// private void registOrderChangeReceiver() {
// orderStateChangeReceiver = new OrderStateChangeReceiver();
// IntentFilter filter = new IntentFilter();
// filter.addAction(Base.PUSH_ACTION_ORDER_STATE_CHANGED);
// getContext().registerReceiver(orderStateChangeReceiver, filter);
// }
//
// private void unregistOrderChangeReceiver() {
// if (orderStateChangeReceiver != null) {
// getContext().unregisterReceiver(orderStateChangeReceiver);
// orderStateChangeReceiver = null;
// }
// }
//
// class OrderStateChangeReceiver extends BroadcastReceiver {
// @Override
// public void onReceive(Context context, Intent intent) {
// try {
// String msgBody = intent.getStringExtra(Base.PUSH_DEFAULT_EXTRA);
// if (StringUtils.isEmpty(msgBody)) {
// return;
// }
//
// Order order = JsonUtils.getMapper().readValue(msgBody, Order.class);
// if (order == null || order.getState() == null || order.getOrderId() == null || order.getOrderId() <= 0
// || StringUtils.isEmpty(order.getOrderNo()) || StringUtils.isEmpty(order.getOrderNumber())) {
// return;
// }
//
// if (CollectionUtils.isEmpty(orderPkgs)) {
// OrderState state = OrderState.get(order.getState());
// if (state == null) {
// return;
// }
// orderPkgs = new ArrayList<>();
//
// List<Order> orders = new ArrayList<>();
// orders.add(order);
// OrderPkg pkg = new OrderPkg();
// pkg.setState(order.getState());
// pkg.setOrders(orders);
// orderPkgs.add(pkg);
// } else {
// // 删除订单
// orderPkgs.forEach(pkg -> {
// if (CollectionUtils.isEmpty(pkg.getOrders())) {
// return;
// }
// pkg.getOrders().remove(order);
// });
//
// OrderState state = OrderState.get(order.getState());
// if (state == null) {
// return;
// }
// // 添加新订单状态
// OrderPkg pkg = getOrdersByState(orderPkgs, order.getState());
// if (pkg == null) {
// List<Order> orders = new ArrayList<>();
// orders.add(order);
// pkg = new OrderPkg();
// pkg.setState(order.getState());
// pkg.setOrders(orders);
// orderPkgs.add(pkg);
// } else {
// List<Order> orders = pkg.getOrders();
// if (CollectionUtils.isEmpty(orders)) {
// orders = new ArrayList<>();
// }
// orders.add(order);
// pkg.setOrders(orders);
// }
// }
// } catch (Exception e) {
// e.printStackTrace();
// } finally {
// orderDataChanged();
// }
// }
// }
private OrderPkg getOrdersByState(List<OrderPkg> pkgs, Integer state) { private OrderPkg getOrdersByState(List<OrderPkg> pkgs, Integer state) {
if (CollectionUtils.isEmpty(pkgs)) { if (CollectionUtils.isEmpty(pkgs)) {
return null; return null;
...@@ -293,87 +496,50 @@ public class MenuPresentation extends Presentation { ...@@ -293,87 +496,50 @@ public class MenuPresentation extends Presentation {
@Override @Override
public void onDismiss(DialogInterface dialog) { public void onDismiss(DialogInterface dialog) {
Utils.i("menu present dismiss"); Utils.i("menu present dismiss");
unregistOrderChangeReceiver(); // unregistOrderChangeReceiver();
unregistMachineMessageReceiver(); unregistKDSMessageReceiver();
if (loadOrdersHandler != null) { // if (loadOrdersHandler != null) {
loadOrdersHandler.removeCallbacksAndMessages(null); // loadOrdersHandler.removeCallbacksAndMessages(null);
loadOrdersHandler = null; // loadOrdersHandler = null;
// }
if (pagerHandler != null) {
pagerHandler.removeCallbacksAndMessages(null);
pagerHandler = null;
} }
} if (pagerThread != null) {
}; pagerThread.interrupt();
pagerThread = null;
private Long lastUpdateTime = 0l;
/** 更新机器状态、制作进度定时任务 */
private class MachineStateTimer extends Thread {
@Override
public void run() {
try {
while (true) {
if (System.currentTimeMillis() - lastUpdateTime >= 1000 * 3) {
Utils.fastBroadcast(getContext(), Base.BROADCAST_SOCKET_GET_MACHINE_CODE);
Utils.fastBroadcast(getContext(), Base.BROADCAST_SOCKET_GET_PRODUCTION_PROGRESS);
lastUpdateTime = System.currentTimeMillis();
}
// 更新倒计时
updateTimesHandler.sendEmptyMessage(0);
Thread.sleep(1000);
}
} catch (Exception e) {
e.printStackTrace();
} }
} }
} };
private MachineMessageReceiver machineMessageReceiver = null; private KDSMessageReceiver mKDSMessageReceiver = null;
private void registerMachineMessageReceiver() { private void registerKDSMessageReceiver() {
machineMessageReceiver = new MachineMessageReceiver(); mKDSMessageReceiver = new KDSMessageReceiver();
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_MACHINE_STATE_CHANGED); filter.addAction(Base.BROADCAST_ACTION_KDS_INFO);
filter.addAction(Base.BROADCAST_ACTION_PRODUCTION_PROGRESS_CHANGED); getContext().registerReceiver(mKDSMessageReceiver, filter);
getContext().registerReceiver(machineMessageReceiver, filter);
} }
private void unregistMachineMessageReceiver() { private void unregistKDSMessageReceiver() {
if (machineMessageReceiver != null) { if (mKDSMessageReceiver != null) {
getContext().unregisterReceiver(machineMessageReceiver); getContext().unregisterReceiver(mKDSMessageReceiver);
machineMessageReceiver = null; mKDSMessageReceiver = null;
} }
} }
private class MachineMessageReceiver extends BroadcastReceiver { private class KDSMessageReceiver extends BroadcastReceiver {
@Override @Override
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Base.BROADCAST_ACTION_MACHINE_STATE_CHANGED)) { KDSMsg msg = (KDSMsg) intent.getSerializableExtra("msg");
updateMachineState(); if (msg == null) {
} else { return;
updateOrderProgress();
} }
mKdsMsg = msg;
orderDataChanged();
setMachineState();
} }
} }
private void updateTimes() {
String targetSupplement = "08:00:00";
String targetClear = "10:30:00";
txtSupplement.setText(getContext().getString(R.string.txt_timer_supplement, targetSupplement));
txtClear.setText(getContext().getString(R.string.txt_timer_clear, targetClear));
}
private void updateOrderProgress() {
}
private void updateMachineState() {
}
private Handler updateTimesHandler = new Handler() {
@Override
public void handleMessage(@NonNull Message msg) {
if (msg.what == 0) {
updateTimes();
}
}
};
} }
...@@ -13,9 +13,6 @@ import androidx.annotation.NonNull; ...@@ -13,9 +13,6 @@ import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication; import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.util.StringUtils; import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.util.Arrays;
public class TestDialog extends Dialog { public class TestDialog extends Dialog {
private View butnClose; private View butnClose;
...@@ -49,6 +46,6 @@ public class TestDialog extends Dialog { ...@@ -49,6 +46,6 @@ public class TestDialog extends Dialog {
webView.loadUrl("http://www.baidu.com"); webView.loadUrl("http://www.baidu.com");
butnClose.setOnClickListener(x -> dismiss()); butnClose.setOnClickListener(x -> dismiss());
Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose)); // Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose));
} }
} }
...@@ -20,8 +20,6 @@ import com.ihaoin.hooloo.device.config.Base; ...@@ -20,8 +20,6 @@ import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.util.StringUtils; import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.util.Arrays;
public class TipsDialog extends Dialog { public class TipsDialog extends Dialog {
private View butnClose; private View butnClose;
private WebView webView; private WebView webView;
...@@ -56,7 +54,7 @@ public class TipsDialog extends Dialog { ...@@ -56,7 +54,7 @@ public class TipsDialog extends Dialog {
webView.loadUrl(HLApplication.getMainData().getTips()); webView.loadUrl(HLApplication.getMainData().getTips());
butnClose.setOnClickListener(x -> dismiss()); butnClose.setOnClickListener(x -> dismiss());
Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose)); // Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose));
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
} }
......
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false"><item android:drawable="@mipmap/motuo_00050" android:duration="40" />
<item android:drawable="@mipmap/motuo_00050" android:duration="40" />
<item android:drawable="@mipmap/motuo_00051" android:duration="40" />
<item android:drawable="@mipmap/motuo_00052" android:duration="40" />
<item android:drawable="@mipmap/motuo_00053" android:duration="40" />
<item android:drawable="@mipmap/motuo_00054" android:duration="40" />
<item android:drawable="@mipmap/motuo_00055" android:duration="40" />
<item android:drawable="@mipmap/motuo_00056" android:duration="40" />
<item android:drawable="@mipmap/motuo_00057" android:duration="40" />
<item android:drawable="@mipmap/motuo_00058" android:duration="40" />
<item android:drawable="@mipmap/motuo_00059" android:duration="40" />
<item android:drawable="@mipmap/motuo_00060" android:duration="40" />
<item android:drawable="@mipmap/motuo_00061" android:duration="40" />
<item android:drawable="@mipmap/motuo_00062" android:duration="40" />
<item android:drawable="@mipmap/motuo_00063" android:duration="40" />
<item android:drawable="@mipmap/motuo_00064" android:duration="40" />
<item android:drawable="@mipmap/motuo_00065" android:duration="40" />
<item android:drawable="@mipmap/motuo_00066" android:duration="40" />
<item android:drawable="@mipmap/motuo_00067" android:duration="40" />
<item android:drawable="@mipmap/motuo_00068" android:duration="40" />
<item android:drawable="@mipmap/motuo_00069" android:duration="40" />
<item android:drawable="@mipmap/motuo_00070" android:duration="40" />
<item android:drawable="@mipmap/motuo_00071" android:duration="40" />
<item android:drawable="@mipmap/motuo_00072" android:duration="40" />
<item android:drawable="@mipmap/motuo_00073" android:duration="40" />
<item android:drawable="@mipmap/motuo_00074" android:duration="40" />
<item android:drawable="@mipmap/motuo_00075" android:duration="40" />
<item android:drawable="@mipmap/motuo_00076" android:duration="40" />
<item android:drawable="@mipmap/motuo_00077" android:duration="40" />
<item android:drawable="@mipmap/motuo_00078" android:duration="40" />
<item android:drawable="@mipmap/motuo_00079" android:duration="40" />
<item android:drawable="@mipmap/motuo_00080" android:duration="40" />
<item android:drawable="@mipmap/motuo_00081" android:duration="40" />
<item android:drawable="@mipmap/motuo_00082" android:duration="40" />
<item android:drawable="@mipmap/motuo_00083" android:duration="40" />
<item android:drawable="@mipmap/motuo_00084" android:duration="40" />
<item android:drawable="@mipmap/motuo_00085" android:duration="40" />
<item android:drawable="@mipmap/motuo_00086" android:duration="40" />
<item android:drawable="@mipmap/motuo_00087" android:duration="40" />
<item android:drawable="@mipmap/motuo_00088" android:duration="40" />
<item android:drawable="@mipmap/motuo_00089" android:duration="40" />
<item android:drawable="@mipmap/motuo_00090" android:duration="40" />
<item android:drawable="@mipmap/motuo_00091" android:duration="40" />
<item android:drawable="@mipmap/motuo_00092" android:duration="40" />
<item android:drawable="@mipmap/motuo_00093" android:duration="40" />
<item android:drawable="@mipmap/motuo_00094" android:duration="40" />
<item android:drawable="@mipmap/motuo_00095" android:duration="40" />
<item android:drawable="@mipmap/motuo_00096" android:duration="40" />
<item android:drawable="@mipmap/motuo_00097" android:duration="40" />
<item android:drawable="@mipmap/motuo_00098" android:duration="40" />
<item android:drawable="@mipmap/motuo_00099" android:duration="40" />
<item android:drawable="@mipmap/motuo_00100" android:duration="40" />
<item android:drawable="@mipmap/motuo_00101" android:duration="40" />
<item android:drawable="@mipmap/motuo_00102" android:duration="40" />
<item android:drawable="@mipmap/motuo_00103" android:duration="40" />
<item android:drawable="@mipmap/motuo_00104" android:duration="40" />
<item android:drawable="@mipmap/motuo_00105" android:duration="40" />
<item android:drawable="@mipmap/motuo_00106" android:duration="40" />
<item android:drawable="@mipmap/motuo_00107" android:duration="40" />
<item android:drawable="@mipmap/motuo_00108" android:duration="40" />
<item android:drawable="@mipmap/motuo_00109" android:duration="40" />
<item android:drawable="@mipmap/motuo_00110" android:duration="40" />
<item android:drawable="@mipmap/motuo_00111" android:duration="40" />
<item android:drawable="@mipmap/motuo_00112" android:duration="40" />
<item android:drawable="@mipmap/motuo_00113" android:duration="40" />
<item android:drawable="@mipmap/motuo_00114" android:duration="40" />
<item android:drawable="@mipmap/motuo_00115" android:duration="40" />
<item android:drawable="@mipmap/motuo_00116" android:duration="40" />
<item android:drawable="@mipmap/motuo_00117" android:duration="40" />
<item android:drawable="@mipmap/motuo_00118" android:duration="40" />
<item android:drawable="@mipmap/motuo_00119" android:duration="40" />
<item android:drawable="@mipmap/motuo_00120" android:duration="40" />
<item android:drawable="@mipmap/motuo_00121" android:duration="40" />
<item android:drawable="@mipmap/motuo_00122" android:duration="40" />
<item android:drawable="@mipmap/motuo_00123" android:duration="40" />
<item android:drawable="@mipmap/motuo_00124" android:duration="40" />
<item android:drawable="@mipmap/motuo_00125" android:duration="40" />
<item android:drawable="@mipmap/motuo_00126" android:duration="40" />
<item android:drawable="@mipmap/motuo_00127" android:duration="40" />
<item android:drawable="@mipmap/motuo_00128" android:duration="40" />
<item android:drawable="@mipmap/motuo_00129" android:duration="40" />
<item android:drawable="@mipmap/motuo_00130" android:duration="40" />
<item android:drawable="@mipmap/motuo_00131" android:duration="40" />
<item android:drawable="@mipmap/motuo_00132" android:duration="40" />
<item android:drawable="@mipmap/motuo_00133" android:duration="40" />
<item android:drawable="@mipmap/motuo_00134" android:duration="40" />
<item android:drawable="@mipmap/motuo_00135" android:duration="40" />
<item android:drawable="@mipmap/motuo_00136" android:duration="40" />
<item android:drawable="@mipmap/motuo_00137" android:duration="40" />
<item android:drawable="@mipmap/motuo_00138" android:duration="40" />
<item android:drawable="@mipmap/motuo_00139" android:duration="40" />
<item android:drawable="@mipmap/motuo_00140" android:duration="40" />
<item android:drawable="@mipmap/motuo_00141" android:duration="40" />
<item android:drawable="@mipmap/motuo_00142" android:duration="40" />
<item android:drawable="@mipmap/motuo_00143" android:duration="40" />
<item android:drawable="@mipmap/motuo_00144" android:duration="40" />
<item android:drawable="@mipmap/motuo_00145" android:duration="40" />
<item android:drawable="@mipmap/motuo_00146" android:duration="40" />
<item android:drawable="@mipmap/motuo_00147" android:duration="40" />
<item android:drawable="@mipmap/motuo_00148" android:duration="40" />
<item android:drawable="@mipmap/motuo_00149" android:duration="40" />
<item android:drawable="@mipmap/motuo_00150" android:duration="40" />
<item android:drawable="@mipmap/motuo_00151" android:duration="40" />
<item android:drawable="@mipmap/motuo_00152" android:duration="40" />
<item android:drawable="@mipmap/motuo_00153" android:duration="40" />
<item android:drawable="@mipmap/motuo_00154" android:duration="40" />
<item android:drawable="@mipmap/motuo_00155" android:duration="40" />
<item android:drawable="@mipmap/motuo_00156" android:duration="40" />
<item android:drawable="@mipmap/motuo_00157" android:duration="40" />
<item android:drawable="@mipmap/motuo_00158" android:duration="40" />
<item android:drawable="@mipmap/motuo_00159" android:duration="40" />
<item android:drawable="@mipmap/motuo_00160" android:duration="40" />
<item android:drawable="@mipmap/motuo_00161" android:duration="40" />
<item android:drawable="@mipmap/motuo_00162" android:duration="40" />
<item android:drawable="@mipmap/motuo_00163" android:duration="40" />
<item android:drawable="@mipmap/motuo_00164" android:duration="40" />
<item android:drawable="@mipmap/motuo_00165" android:duration="40" />
<item android:drawable="@mipmap/motuo_00166" android:duration="40" />
<item android:drawable="@mipmap/motuo_00167" android:duration="40" />
<item android:drawable="@mipmap/motuo_00168" android:duration="40" />
<item android:drawable="@mipmap/motuo_00169" android:duration="40" />
<item android:drawable="@mipmap/motuo_00170" android:duration="40" />
<item android:drawable="@mipmap/motuo_00171" android:duration="40" />
<item android:drawable="@mipmap/motuo_00172" android:duration="40" />
<item android:drawable="@mipmap/motuo_00173" android:duration="40" />
<item android:drawable="@mipmap/motuo_00174" android:duration="40" />
<item android:drawable="@mipmap/motuo_00175" android:duration="40" />
<item android:drawable="@mipmap/motuo_00176" android:duration="40" />
<item android:drawable="@mipmap/motuo_00177" android:duration="40" />
<item android:drawable="@mipmap/motuo_00178" android:duration="40" />
<item android:drawable="@mipmap/motuo_00179" android:duration="40" />
<item android:drawable="@mipmap/motuo_00180" android:duration="40" />
<item android:drawable="@mipmap/motuo_00181" android:duration="40" />
<item android:drawable="@mipmap/motuo_00182" android:duration="40" />
<item android:drawable="@mipmap/motuo_00183" android:duration="40" />
<item android:drawable="@mipmap/motuo_00184" android:duration="40" />
<item android:drawable="@mipmap/motuo_00185" android:duration="40" />
<item android:drawable="@mipmap/motuo_00186" android:duration="40" />
<item android:drawable="@mipmap/motuo_00187" android:duration="40" />
<item android:drawable="@mipmap/motuo_00188" android:duration="40" />
<item android:drawable="@mipmap/motuo_00189" android:duration="40" />
<item android:drawable="@mipmap/motuo_00190" android:duration="40" />
<item android:drawable="@mipmap/motuo_00191" android:duration="40" />
<item android:drawable="@mipmap/motuo_00192" android:duration="40" />
<item android:drawable="@mipmap/motuo_00193" android:duration="40" />
<item android:drawable="@mipmap/motuo_00194" android:duration="40" />
<item android:drawable="@mipmap/motuo_00195" android:duration="40" />
<item android:drawable="@mipmap/motuo_00196" android:duration="40" />
<item android:drawable="@mipmap/motuo_00197" android:duration="40" />
<item android:drawable="@mipmap/motuo_00198" android:duration="40" />
<item android:drawable="@mipmap/motuo_00199" android:duration="40" />
<item android:drawable="@mipmap/motuo_00200" android:duration="40" />
<item android:drawable="@mipmap/motuo_00201" android:duration="40" />
<item android:drawable="@mipmap/motuo_00202" android:duration="40" />
<item android:drawable="@mipmap/motuo_00203" android:duration="40" />
<item android:drawable="@mipmap/motuo_00204" android:duration="40" />
<item android:drawable="@mipmap/motuo_00205" android:duration="40" />
<item android:drawable="@mipmap/motuo_00206" android:duration="40" />
<item android:drawable="@mipmap/motuo_00207" android:duration="40" />
<item android:drawable="@mipmap/motuo_00208" android:duration="40" />
<item android:drawable="@mipmap/motuo_00209" android:duration="40" />
<item android:drawable="@mipmap/motuo_00210" android:duration="40" />
<item android:drawable="@mipmap/motuo_00211" android:duration="40" />
<item android:drawable="@mipmap/motuo_00212" android:duration="40" />
<item android:drawable="@mipmap/motuo_00213" android:duration="40" />
<item android:drawable="@mipmap/motuo_00214" android:duration="40" />
<item android:drawable="@mipmap/motuo_00215" android:duration="40" />
<item android:drawable="@mipmap/motuo_00216" android:duration="40" />
<item android:drawable="@mipmap/motuo_00217" android:duration="40" />
<item android:drawable="@mipmap/motuo_00218" android:duration="40" />
<item android:drawable="@mipmap/motuo_00219" android:duration="40" />
<item android:drawable="@mipmap/motuo_00220" android:duration="40" />
<item android:drawable="@mipmap/motuo_00221" android:duration="40" />
<item android:drawable="@mipmap/motuo_00222" android:duration="40" />
<item android:drawable="@mipmap/motuo_00223" android:duration="40" />
<item android:drawable="@mipmap/motuo_00224" android:duration="40" />
<item android:drawable="@mipmap/motuo_00225" android:duration="40" />
<item android:drawable="@mipmap/motuo_00226" android:duration="40" />
<item android:drawable="@mipmap/motuo_00227" android:duration="40" />
<item android:drawable="@mipmap/motuo_00228" android:duration="40" />
<item android:drawable="@mipmap/motuo_00229" android:duration="40" />
<item android:drawable="@mipmap/motuo_00230" android:duration="40" />
<item android:drawable="@mipmap/motuo_00231" android:duration="40" />
<item android:drawable="@mipmap/motuo_00232" android:duration="40" />
<item android:drawable="@mipmap/motuo_00233" android:duration="40" />
<item android:drawable="@mipmap/motuo_00234" android:duration="40" />
<item android:drawable="@mipmap/motuo_00235" android:duration="40" />
<item android:drawable="@mipmap/motuo_00236" android:duration="40" />
<item android:drawable="@mipmap/motuo_00237" android:duration="40" />
<item android:drawable="@mipmap/motuo_00238" android:duration="40" />
<item android:drawable="@mipmap/motuo_00239" android:duration="40" />
<item android:drawable="@mipmap/motuo_00240" android:duration="40" />
<item android:drawable="@mipmap/motuo_00241" android:duration="40" />
<item android:drawable="@mipmap/motuo_00242" android:duration="40" />
<item android:drawable="@mipmap/motuo_00243" android:duration="40" />
<item android:drawable="@mipmap/motuo_00244" android:duration="40" />
<item android:drawable="@mipmap/motuo_00245" android:duration="40" />
<item android:drawable="@mipmap/motuo_00246" android:duration="40" />
<item android:drawable="@mipmap/motuo_00247" android:duration="40" />
<item android:drawable="@mipmap/motuo_00248" android:duration="40" />
<item android:drawable="@mipmap/motuo_00249" android:duration="40" />
<item android:drawable="@mipmap/motuo_00250" android:duration="40" />
<item android:drawable="@mipmap/motuo_00251" android:duration="40" />
<item android:drawable="@mipmap/motuo_00252" android:duration="40" />
<item android:drawable="@mipmap/motuo_00253" android:duration="40" />
<item android:drawable="@mipmap/motuo_00254" android:duration="40" />
<item android:drawable="@mipmap/motuo_00255" android:duration="40" />
<item android:drawable="@mipmap/motuo_00256" android:duration="40" />
<item android:drawable="@mipmap/motuo_00257" android:duration="40" />
<item android:drawable="@mipmap/motuo_00258" android:duration="40" />
<item android:drawable="@mipmap/motuo_00259" android:duration="40" />
<item android:drawable="@mipmap/motuo_00260" android:duration="40" />
<item android:drawable="@mipmap/motuo_00261" android:duration="40" />
<item android:drawable="@mipmap/motuo_00262" android:duration="40" />
<item android:drawable="@mipmap/motuo_00263" android:duration="40" />
<item android:drawable="@mipmap/motuo_00264" android:duration="40" />
<item android:drawable="@mipmap/motuo_00265" android:duration="40" />
<item android:drawable="@mipmap/motuo_00266" android:duration="40" />
<item android:drawable="@mipmap/motuo_00267" android:duration="40" />
<item android:drawable="@mipmap/motuo_00268" android:duration="40" />
<item android:drawable="@mipmap/motuo_00269" android:duration="40" />
<item android:drawable="@mipmap/motuo_00270" android:duration="40" />
<item android:drawable="@mipmap/motuo_00271" android:duration="40" />
<item android:drawable="@mipmap/motuo_00272" android:duration="40" />
<item android:drawable="@mipmap/motuo_00273" android:duration="40" />
<item android:drawable="@mipmap/motuo_00274" android:duration="40" />
<item android:drawable="@mipmap/motuo_00275" android:duration="40" />
<item android:drawable="@mipmap/motuo_00276" android:duration="40" />
<item android:drawable="@mipmap/motuo_00277" android:duration="40" />
<item android:drawable="@mipmap/motuo_00278" android:duration="40" />
<item android:drawable="@mipmap/motuo_00279" android:duration="40" />
<item android:drawable="@mipmap/motuo_00280" android:duration="40" />
<item android:drawable="@mipmap/motuo_00281" android:duration="40" />
<item android:drawable="@mipmap/motuo_00282" android:duration="40" />
<item android:drawable="@mipmap/motuo_00283" android:duration="40" />
<item android:drawable="@mipmap/motuo_00284" android:duration="40" />
<item android:drawable="@mipmap/motuo_00285" android:duration="40" />
<item android:drawable="@mipmap/motuo_00286" android:duration="40" />
<item android:drawable="@mipmap/motuo_00287" android:duration="40" />
<item android:drawable="@mipmap/motuo_00288" android:duration="40" />
<item android:drawable="@mipmap/motuo_00289" android:duration="40" />
<item android:drawable="@mipmap/motuo_00290" android:duration="40" />
<item android:drawable="@mipmap/motuo_00291" android:duration="40" />
<item android:drawable="@mipmap/motuo_00292" android:duration="40" />
<item android:drawable="@mipmap/motuo_00293" android:duration="40" />
<item android:drawable="@mipmap/motuo_00294" android:duration="40" />
<item android:drawable="@mipmap/motuo_00295" android:duration="40" />
<item android:drawable="@mipmap/motuo_00296" android:duration="40" />
<item android:drawable="@mipmap/motuo_00297" android:duration="40" />
<item android:drawable="@mipmap/motuo_00298" android:duration="40" />
<item android:drawable="@mipmap/motuo_00299" android:duration="40" />
<item android:drawable="@mipmap/motuo_00300" android:duration="40" />
<item android:drawable="@mipmap/motuo_00301" android:duration="40" />
<item android:drawable="@mipmap/motuo_00302" android:duration="40" />
<item android:drawable="@mipmap/motuo_00303" android:duration="40" />
<item android:drawable="@mipmap/motuo_00304" android:duration="40" />
<item android:drawable="@mipmap/motuo_00305" android:duration="40" />
<item android:drawable="@mipmap/motuo_00306" android:duration="40" />
<item android:drawable="@mipmap/motuo_00307" android:duration="40" />
<item android:drawable="@mipmap/motuo_00308" android:duration="40" />
<item android:drawable="@mipmap/motuo_00309" android:duration="40" />
<item android:drawable="@mipmap/motuo_00310" android:duration="40" />
<item android:drawable="@mipmap/motuo_00311" android:duration="40" />
<item android:drawable="@mipmap/motuo_00312" android:duration="40" />
<item android:drawable="@mipmap/motuo_00313" android:duration="40" />
<item android:drawable="@mipmap/motuo_00314" android:duration="40" />
<item android:drawable="@mipmap/motuo_00315" android:duration="40" />
<item android:drawable="@mipmap/motuo_00316" android:duration="40" />
<item android:drawable="@mipmap/motuo_00317" android:duration="40" />
<item android:drawable="@mipmap/motuo_00318" android:duration="40" />
<item android:drawable="@mipmap/motuo_00319" android:duration="40" />
<item android:drawable="@mipmap/motuo_00320" android:duration="40" />
<item android:drawable="@mipmap/motuo_00321" android:duration="40" />
<item android:drawable="@mipmap/motuo_00322" android:duration="40" />
<item android:drawable="@mipmap/motuo_00323" android:duration="40" />
<item android:drawable="@mipmap/motuo_00324" android:duration="40" />
<item android:drawable="@mipmap/motuo_00325" android:duration="40" />
<item android:drawable="@mipmap/motuo_00326" android:duration="40" />
<item android:drawable="@mipmap/motuo_00327" android:duration="40" />
<item android:drawable="@mipmap/motuo_00328" android:duration="40" />
<item android:drawable="@mipmap/motuo_00329" android:duration="40" />
<item android:drawable="@mipmap/motuo_00330" android:duration="40" />
<item android:drawable="@mipmap/motuo_00331" android:duration="40" />
<item android:drawable="@mipmap/motuo_00332" android:duration="40" />
<item android:drawable="@mipmap/motuo_00333" android:duration="40" />
<item android:drawable="@mipmap/motuo_00334" android:duration="40" />
<item android:drawable="@mipmap/motuo_00335" android:duration="40" />
<item android:drawable="@mipmap/motuo_00336" android:duration="40" />
<item android:drawable="@mipmap/motuo_00337" android:duration="40" />
<item android:drawable="@mipmap/motuo_00338" android:duration="40" />
<item android:drawable="@mipmap/motuo_00339" android:duration="40" />
<item android:drawable="@mipmap/motuo_00340" android:duration="40" />
<item android:drawable="@mipmap/motuo_00341" android:duration="40" />
<item android:drawable="@mipmap/motuo_00342" android:duration="40" />
<item android:drawable="@mipmap/motuo_00343" android:duration="40" />
<item android:drawable="@mipmap/motuo_00344" android:duration="40" />
<item android:drawable="@mipmap/motuo_00345" android:duration="40" />
<item android:drawable="@mipmap/motuo_00346" android:duration="40" />
<item android:drawable="@mipmap/motuo_00347" android:duration="40" />
<item android:drawable="@mipmap/motuo_00348" android:duration="40" />
<item android:drawable="@mipmap/motuo_00349" android:duration="40" />
<item android:drawable="@mipmap/motuo_00350" android:duration="40" />
<item android:drawable="@mipmap/motuo_00351" android:duration="40" />
<item android:drawable="@mipmap/motuo_00352" android:duration="40" />
<item android:drawable="@mipmap/motuo_00353" android:duration="40" />
</animation-list>
\ No newline at end of file
...@@ -94,12 +94,21 @@ ...@@ -94,12 +94,21 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@drawable/anim_qrcode_loading" android:background="@drawable/anim_qrcode_loading"
android:visibility="invisible" /> android:visibility="invisible" />
<ImageView
<FrameLayout
android:id="@+id/butn_close" android:id="@+id/butn_close"
android:layout_width="@dimen/ic_dialog_close" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_dialog_close" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginRight="@dimen/confirm_order_padding_top" android:layout_marginStart="@dimen/dialog_close_margin"
android:layout_marginTop="@dimen/dialog_close_margin"
android:layout_marginEnd="@dimen/dialog_close_margin"
android:layout_marginBottom="@dimen/dialog_close_margin"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:src="@mipmap/chazi" /> android:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" />
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -199,12 +199,20 @@ ...@@ -199,12 +199,20 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<ImageView <FrameLayout
android:id="@+id/butn_close" android:id="@+id/butn_close"
android:layout_width="@dimen/ic_dialog_close" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_dialog_close" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/dialog_close_margin" android:layout_marginStart="@dimen/dialog_close_margin"
android:layout_marginTop="@dimen/dialog_close_margin"
android:layout_marginEnd="@dimen/dialog_close_margin"
android:layout_marginBottom="@dimen/dialog_close_margin"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:src="@mipmap/chazi" /> android:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" />
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -8,12 +8,20 @@ ...@@ -8,12 +8,20 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<ImageView <FrameLayout
android:id="@+id/butn_close" android:id="@+id/butn_close"
android:layout_width="@dimen/ic_dialog_close" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_dialog_close" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/dialog_close_margin" android:layout_marginStart="@dimen/dialog_close_margin"
android:layout_marginTop="@dimen/dialog_close_margin"
android:layout_marginEnd="@dimen/dialog_close_margin"
android:layout_marginBottom="@dimen/dialog_close_margin"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:src="@mipmap/chazi" /> android:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" />
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -8,12 +8,20 @@ ...@@ -8,12 +8,20 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<ImageView <FrameLayout
android:id="@+id/butn_close" android:id="@+id/butn_close"
android:layout_width="@dimen/ic_dialog_close" android:layout_width="wrap_content"
android:layout_height="@dimen/ic_dialog_close" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_margin="@dimen/dialog_close_margin" android:layout_marginStart="@dimen/dialog_close_margin"
android:layout_marginTop="@dimen/dialog_close_margin"
android:layout_marginEnd="@dimen/dialog_close_margin"
android:layout_marginBottom="@dimen/dialog_close_margin"
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:src="@mipmap/chazi" /> android:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" />
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
android:foreground="?selectableItemBackground" android:foreground="?selectableItemBackground"
android:gravity="center" android:gravity="center"
android:paddingHorizontal="@dimen/category_padding_hor" android:paddingHorizontal="@dimen/category_padding_hor"
android:paddingVertical="@dimen/category_padding_ver" android:paddingTop="@dimen/category_padding_top"
android:paddingBottom="@dimen/category_padding_bottom"
android:textColor="@drawable/sel_category_color" android:textColor="@drawable/sel_category_color"
android:textSize="@dimen/ts_category_radio" /> android:textSize="@dimen/ts_category_radio" />
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/txt_order_number" android:id="@+id/txt_order_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="Mon000" android:text="Mon000"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" /> android:textSize="@dimen/ts_order_number" />
<ProgressBar <RelativeLayout
android:id="@+id/bar_progress" android:layout_width="@dimen/menu_progress_width"
style="@style/progress_bar" android:layout_height="@dimen/menu_progress_height"
android:layout_width="0dp" android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/menu_progress_start" android:layout_marginStart="@dimen/menu_progress_start"
android:layout_marginEnd="@dimen/menu_progress_end" android:layout_toRightOf="@id/txt_order_number"
android:layout_weight="1" android:layout_weight="1">
android:max="10" <ImageView
android:progress="5" /> android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:background="@mipmap/pro_progress" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/img_tmp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="50" />
<ImageView
android:id="@+id/img_mask"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_weight="50"
android:background="@mipmap/pro_mask" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:background="@mipmap/pro_bg" />
</RelativeLayout>
<TextView <TextView
android:id="@+id/txt_progress" android:id="@+id/txt_progress"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="50%" android:text="50%"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" /> android:textSize="@dimen/ts_order_number" />
</LinearLayout> </RelativeLayout>
\ No newline at end of file \ No newline at end of file
...@@ -7,26 +7,31 @@ ...@@ -7,26 +7,31 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView
android:id="@+id/img_left" <com.ihaoin.hooloo.device.component.IntroViewPager
android:id="@+id/intro_pager"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.7321" android:layout_weight="0.73125" />
android:adjustViewBounds="true" <!-- <ImageView-->
android:scaleType="centerCrop" /> <!-- android:id="@+id/img_left"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_weight="0.73125"-->
<!-- android:adjustViewBounds="true"-->
<!-- android:scaleType="centerCrop" />-->
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.2679" android:layout_weight="0.26875"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="0.6888" android:layout_weight="0.70186"
android:background="@color/menu_order_bg" android:background="@color/menu_order_bg"
android:paddingHorizontal="@dimen/menu_content_padding_hor" android:paddingStart="@dimen/menu_content_padding_hor"
android:paddingTop="@dimen/menu_content_padding_top" android:paddingTop="@dimen/menu_content_padding_top">
android:paddingBottom="@dimen/menu_content_padding_bottom">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -43,16 +48,18 @@ ...@@ -43,16 +48,18 @@
android:id="@+id/grid_cooking" android:id="@+id/grid_cooking"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical"
android:paddingEnd="@dimen/menu_content_padding_hor">
<include <include
android:id="@+id/progress1"
layout="@layout/layout_progress" layout="@layout/layout_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<include <include
android:id="@+id/progress2"
layout="@layout/layout_progress" layout="@layout/layout_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
android:layout_marginTop="@dimen/menu_order_number_margin" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/txt_waiting" android:id="@+id/txt_waiting"
...@@ -63,12 +70,70 @@ ...@@ -63,12 +70,70 @@
android:text="待制作" android:text="待制作"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" /> android:textSize="@dimen/ts_menu_subtitle" />
<LinearLayout <LinearLayout
android:id="@+id/grid_waiting" android:id="@+id/grid_waiting"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/waiting1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/waiting2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/waiting3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/waiting4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/waiting5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/waiting6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
</LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -76,18 +141,14 @@ ...@@ -76,18 +141,14 @@
android:layout_marginBottom="@dimen/menu_title_margin_bottom" android:layout_marginBottom="@dimen/menu_title_margin_bottom"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/txt_competed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="可取餐" android:text="可取餐"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" /> android:textSize="@dimen/ts_menu_subtitle" />
<TextView <TextView
android:id="@+id/txt_competed1"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/txt_competed"
android:layout_toRightOf="@id/txt_competed"
android:text="(扫码取餐)" android:text="(扫码取餐)"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle1" /> android:textSize="@dimen/ts_menu_subtitle1" />
...@@ -96,18 +157,106 @@ ...@@ -96,18 +157,106 @@
android:id="@+id/grid_completed" android:id="@+id/grid_completed"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/completed1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/completed2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/completed3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/completed4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/completed5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/completed6"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/completed7"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/completed8"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<TextView
android:id="@+id/completed9"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mon999"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
</LinearLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_machine_state" android:id="@+id/layout_machine_state"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="0.3112" android:layout_weight="0.29814"
android:background="@color/menu_state_bg" android:background="@color/menu_state_bg"
android:orientation="vertical" android:orientation="vertical"
android:paddingHorizontal="@dimen/menu_state_padding_hor" android:paddingLeft="@dimen/menu_state_padding_hor"
android:paddingVertical="@dimen/menu_state_padding_ver"> android:paddingTop="@dimen/menu_state_padding_ver">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -126,8 +275,9 @@ ...@@ -126,8 +275,9 @@
android:id="@+id/txt_outside_temp" android:id="@+id/txt_outside_temp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/menu_state_icon_margin"
android:text="@string/txt_outside_temp" android:text="@string/txt_outside_temp"
android:textColor="@color/black" android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -140,46 +290,14 @@ ...@@ -140,46 +290,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/txt_inside_temp" android:text="@string/txt_inside_temp"
android:textColor="@color/black" android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center_vertical" android:layout_marginTop="@dimen/menu_state_padding_line"
android:orientation="horizontal">
<ImageView
android:layout_width="35px"
android:layout_height="34px"
android:src="@mipmap/weihu" />
<TextView
android:id="@+id/txt_last_maintenance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_last_maintenance"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="35px"
android:layout_height="34px"
android:visibility="invisible" />
<TextView
android:id="@+id/txt_next_maintenance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_next_maintenance"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -195,8 +313,9 @@ ...@@ -195,8 +313,9 @@
android:id="@+id/txt_fridge_temp" android:id="@+id/txt_fridge_temp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/menu_state_icon_margin"
android:text="@string/txt_fridge_temp" android:text="@string/txt_fridge_temp"
android:textColor="@color/black" android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -209,64 +328,73 @@ ...@@ -209,64 +328,73 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/txt_inside_humidity" android:text="@string/txt_inside_humidity"
android:textColor="@color/black" android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/menu_state_padding_line"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="35px" android:layout_width="35px"
android:layout_height="34px" android:layout_height="34px"
android:src="@mipmap/shui" /> android:src="@mipmap/qingxi" />
<TextView <TextView
android:id="@+id/txt_water_quality" android:id="@+id/txt_timer_clear"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/txt_water_quality" android:layout_marginStart="@dimen/menu_state_icon_margin"
android:textColor="@color/black" android:text="@string/txt_timer_clear"
android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/menu_state_padding_line"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="35px" android:layout_width="35px"
android:layout_height="34px" android:layout_height="34px"
android:visibility="invisible" /> android:src="@mipmap/yuanliao" />
<TextView <TextView
android:id="@+id/txt_timer_supplement" android:id="@+id/txt_timer_material"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/txt_timer_supplement" android:layout_marginStart="@dimen/menu_state_icon_margin"
android:textColor="@color/black" android:text="@string/txt_timer_material"
android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/menu_state_padding_line"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="35px" android:layout_width="35px"
android:layout_height="34px" android:layout_height="34px"
android:visibility="invisible" /> android:src="@mipmap/baojie" />
<TextView <TextView
android:id="@+id/txt_timer_clear" android:id="@+id/txt_timer_usual"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/txt_timer_clear" android:layout_marginStart="@dimen/menu_state_icon_margin"
android:textColor="@color/black" android:text="@string/txt_timer_usual"
android:textColor="@color/menu_state_text"
android:textSize="@dimen/ts_menu_state" /> android:textSize="@dimen/ts_menu_state" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<RelativeLayout <ImageView
android:id="@+id/img_avatar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/menu_logo_bar" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"></RelativeLayout> android:layout_alignParentBottom="true" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
app/src/main/res/mipmap-xhdpi/wendu.png

1.16 KB | W: | H:

app/src/main/res/mipmap-xhdpi/wendu.png

1.53 KB | W: | H:

app/src/main/res/mipmap-xhdpi/wendu.png
app/src/main/res/mipmap-xhdpi/wendu.png
app/src/main/res/mipmap-xhdpi/wendu.png
app/src/main/res/mipmap-xhdpi/wendu.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -32,8 +32,12 @@ ...@@ -32,8 +32,12 @@
<dimen name="goods_desc_margin_top">26px</dimen> <dimen name="goods_desc_margin_top">26px</dimen>
<dimen name="goods_butns_margin_top">25px</dimen> <dimen name="goods_butns_margin_top">25px</dimen>
<dimen name="goods_price_margin">5px</dimen> <dimen name="goods_price_margin">5px</dimen>
<dimen name="category_padding_ver">67px</dimen> <dimen name="category_padding_top">17px</dimen>
<dimen name="category_padding_bottom">32px</dimen>
<dimen name="category_padding_hor">35px</dimen> <dimen name="category_padding_hor">35px</dimen>
<dimen name="category_drawable_padding">10px</dimen>
<dimen name="category_drawable_width">100px</dimen>
<dimen name="category_drawable_height">75px</dimen>
<dimen name="category_margin">129px</dimen> <dimen name="category_margin">129px</dimen>
<dimen name="category_divider_padding">0px</dimen> <dimen name="category_divider_padding">0px</dimen>
<dimen name="tip_margin_top">40px</dimen> <dimen name="tip_margin_top">40px</dimen>
...@@ -42,19 +46,22 @@ ...@@ -42,19 +46,22 @@
<dimen name="menu_divider_padding_hor">33px</dimen> <dimen name="menu_divider_padding_hor">33px</dimen>
<dimen name="menu_divider_padding_top">60px</dimen> <dimen name="menu_divider_padding_top">60px</dimen>
<dimen name="menu_divider_padding_bottom">50px</dimen> <dimen name="menu_divider_padding_bottom">50px</dimen>
<dimen name="menu_content_padding_hor">40px</dimen> <dimen name="menu_content_padding_hor">48px</dimen>
<dimen name="menu_content_padding_top">40px</dimen> <dimen name="menu_content_padding_top">40px</dimen>
<dimen name="menu_content_padding_bottom">20px</dimen> <dimen name="menu_content_padding_bottom">30px</dimen>
<dimen name="menu_spacing_hor">30px</dimen> <dimen name="menu_spacing_hor">30px</dimen>
<dimen name="menu_spacing_ver">20px</dimen> <dimen name="menu_spacing_ver">20px</dimen>
<dimen name="menu_logo_bar">112px</dimen> <dimen name="menu_logo_bar">110px</dimen>
<dimen name="menu_progress_start">24px</dimen> <dimen name="menu_progress_start">33px</dimen>
<dimen name="menu_progress_end">32px</dimen> <dimen name="menu_progress_end">33px</dimen>
<dimen name="menu_progress_width">280px</dimen>
<dimen name="menu_progress_height">26px</dimen>
<dimen name="menu_title_margin_top">20px</dimen> <dimen name="menu_title_margin_top">20px</dimen>
<dimen name="menu_title_margin_bottom">10px</dimen> <dimen name="menu_title_margin_bottom">12px</dimen>
<dimen name="menu_order_number_margin">-10px</dimen> <dimen name="menu_state_padding_hor">48px</dimen>
<dimen name="menu_state_padding_hor">40px</dimen> <dimen name="menu_state_padding_ver">35px</dimen>
<dimen name="menu_state_padding_ver">20px</dimen> <dimen name="menu_state_padding_line">20px</dimen>
<dimen name="menu_state_icon_margin">22px</dimen>
<dimen name="goods_detail_padding_ver">55px</dimen> <dimen name="goods_detail_padding_ver">55px</dimen>
<dimen name="goods_detail_padding_hor">40px</dimen> <dimen name="goods_detail_padding_hor">40px</dimen>
...@@ -174,7 +181,7 @@ ...@@ -174,7 +181,7 @@
<dimen name="ts_menu_title">40px</dimen> <dimen name="ts_menu_title">40px</dimen>
<dimen name="ts_menu_subtitle">36px</dimen> <dimen name="ts_menu_subtitle">36px</dimen>
<dimen name="ts_menu_subtitle1">24px</dimen> <dimen name="ts_menu_subtitle1">24px</dimen>
<dimen name="ts_order_number">48px</dimen> <dimen name="ts_order_number">44px</dimen>
<dimen name="ts_menu_state">36px</dimen> <dimen name="ts_menu_state">36px</dimen>
<dimen name="ts_setting_name">18sp</dimen> <dimen name="ts_setting_name">18sp</dimen>
<dimen name="ts_setting_desc">16sp</dimen> <dimen name="ts_setting_desc">16sp</dimen>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<color name="black">#FF000000</color> <color name="black">#FF000000</color>
<color name="colorPink">#FFFF72C1</color> <color name="colorPink">#FFFF72C1</color>
<color name="progress">#FFCDE3F6</color> <color name="progress">#FFCDE3F6</color>
<color name="menu_order_bg">#FF486FFF</color> <color name="menu_order_bg">#FF4A71FF</color>
<color name="menu_state_bg">#FFCDE3F6</color> <color name="menu_state_bg">#FFDEF0FF</color>
<color name="menu_state_text">#FF006ECF</color>
</resources> </resources>
...@@ -32,8 +32,12 @@ ...@@ -32,8 +32,12 @@
<dimen name="goods_desc_margin_top">26px</dimen> <dimen name="goods_desc_margin_top">26px</dimen>
<dimen name="goods_butns_margin_top">25px</dimen> <dimen name="goods_butns_margin_top">25px</dimen>
<dimen name="goods_price_margin">5px</dimen> <dimen name="goods_price_margin">5px</dimen>
<dimen name="category_padding_ver">67px</dimen> <dimen name="category_padding_top">17px</dimen>
<dimen name="category_padding_bottom">32px</dimen>
<dimen name="category_padding_hor">35px</dimen> <dimen name="category_padding_hor">35px</dimen>
<dimen name="category_drawable_padding">10px</dimen>
<dimen name="category_drawable_width">100px</dimen>
<dimen name="category_drawable_height">75px</dimen>
<dimen name="category_margin">50dp</dimen> <dimen name="category_margin">50dp</dimen>
<dimen name="category_divider_padding">0px</dimen> <dimen name="category_divider_padding">0px</dimen>
<dimen name="tip_margin_top">40px</dimen> <dimen name="tip_margin_top">40px</dimen>
...@@ -47,14 +51,17 @@ ...@@ -47,14 +51,17 @@
<dimen name="menu_content_padding_bottom">20px</dimen> <dimen name="menu_content_padding_bottom">20px</dimen>
<dimen name="menu_spacing_hor">10px</dimen> <dimen name="menu_spacing_hor">10px</dimen>
<dimen name="menu_spacing_ver">100px</dimen> <dimen name="menu_spacing_ver">100px</dimen>
<dimen name="menu_logo_bar">112px</dimen> <dimen name="menu_logo_bar">80px</dimen>
<dimen name="menu_progress_start">24px</dimen> <dimen name="menu_progress_start">33px</dimen>
<dimen name="menu_progress_end">32px</dimen> <dimen name="menu_progress_end">33px</dimen>
<dimen name="menu_progress_width">280px</dimen>
<dimen name="menu_progress_height">26px</dimen>
<dimen name="menu_title_margin_top">20px</dimen> <dimen name="menu_title_margin_top">20px</dimen>
<dimen name="menu_title_margin_bottom">10px</dimen> <dimen name="menu_title_margin_bottom">10px</dimen>
<dimen name="menu_order_number_margin">-10px</dimen>
<dimen name="menu_state_padding_hor">40px</dimen> <dimen name="menu_state_padding_hor">40px</dimen>
<dimen name="menu_state_padding_ver">20px</dimen> <dimen name="menu_state_padding_ver">20px</dimen>
<dimen name="menu_state_padding_line">20px</dimen>
<dimen name="menu_state_icon_margin">22px</dimen>
<dimen name="goods_detail_padding_ver">55px</dimen> <dimen name="goods_detail_padding_ver">55px</dimen>
<dimen name="goods_detail_padding_hor">40px</dimen> <dimen name="goods_detail_padding_hor">40px</dimen>
...@@ -171,7 +178,7 @@ ...@@ -171,7 +178,7 @@
<dimen name="ts_dialog_title">18sp</dimen> <dimen name="ts_dialog_title">18sp</dimen>
<dimen name="ts_scan">14sp</dimen> <dimen name="ts_scan">14sp</dimen>
<dimen name="ts_expire">12sp</dimen> <dimen name="ts_expire">12sp</dimen>
<dimen name="ts_order_number">12sp</dimen> <dimen name="ts_order_number">18sp</dimen>
<dimen name="ts_menu_title">22sp</dimen> <dimen name="ts_menu_title">22sp</dimen>
<dimen name="ts_menu_subtitle">10sp</dimen> <dimen name="ts_menu_subtitle">10sp</dimen>
<dimen name="ts_menu_subtitle1">8sp</dimen> <dimen name="ts_menu_subtitle1">8sp</dimen>
......
...@@ -16,12 +16,10 @@ ...@@ -16,12 +16,10 @@
<string name="error_check_sku">商品已售罄</string> <string name="error_check_sku">商品已售罄</string>
<string name="clear_tips">是否清空购物车(%ss)</string> <string name="clear_tips">是否清空购物车(%ss)</string>
<string name="txt_outside_temp">室外温度: %s°</string> <string name="txt_outside_temp">室外温度: %s°</string>
<string name="txt_inside_temp">内部温度: %s°</string> <string name="txt_inside_temp">店内温度: %s°</string>
<string name="txt_last_maintenance">上次维护: %s</string>
<string name="txt_next_maintenance">下次维护: %s</string>
<string name="txt_fridge_temp">冰箱温度: %s°</string> <string name="txt_fridge_temp">冰箱温度: %s°</string>
<string name="txt_inside_humidity">内部湿度: %s</string> <string name="txt_inside_humidity">店内湿度: %s%%rh</string>
<string name="txt_water_quality">水质TDS: %s</string> <string name="txt_timer_clear">咖啡机清洗时间: %s</string>
<string name="txt_timer_supplement">保育员预计降临倒计时: %s</string> <string name="txt_timer_material">原料更换时间: %s</string>
<string name="txt_timer_clear">咖啡机自动清洁倒计时: %s</string> <string name="txt_timer_usual">日常保洁时间: %s</string>
</resources> </resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment