Commit bed8a038 by wjg

.

parent 91eb4c73
...@@ -72,4 +72,5 @@ dependencies { ...@@ -72,4 +72,5 @@ dependencies {
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);
}
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(view, layoutParams); });
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() {
......
...@@ -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);
} }
......
...@@ -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:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" /> 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:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" /> 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:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" /> 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:padding="20px">
<ImageView
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:src="@mipmap/chazi" /> 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_centerVertical="true"
android:layout_marginStart="@dimen/menu_progress_start"
android:layout_toRightOf="@id/txt_order_number"
android:layout_weight="1">
<ImageView
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_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/menu_progress_start" android:layout_weight="50" />
android:layout_marginEnd="@dimen/menu_progress_end" <ImageView
android:layout_weight="1" android:id="@+id/img_mask"
android:max="10" android:layout_width="0dp"
android:progress="5" /> 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
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