Commit 91eb4c73 by wjg

v2

parent 4c99e9b4
......@@ -2,16 +2,14 @@ package com.ihaoin.hooloo.device;
import android.app.Application;
import android.graphics.Typeface;
import android.util.Log;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.PresentState;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.umeng.commonsdk.UMConfigure;
import java.lang.reflect.Field;
......@@ -23,6 +21,58 @@ import cn.jpush.android.api.JPushInterface;
public class HLApplication extends Application {
public static HLApplication SELF = null;
@Override
public void onCreate() {
super.onCreate();
HLApplication.SELF = this;
setEnvConfig();
setDefaultTypeface();
UMConfigure.preInit(this, AppConfig.UMENG_APPKEY, AppConfig.UMENG_CHANNEL);
UMConfigure.init(this, AppConfig.UMENG_APPKEY, AppConfig.UMENG_CHANNEL, 0, null);
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
AppConfig.REGISTRATION_ID = JPushInterface.getRegistrationID(this);
HttpUtil.postRegistrationId();
}
private void setDefaultTypeface() {
try {
Typeface typefaceMonospace = Typeface.createFromAsset(getAssets(), "fonts/pingfang_jianti_regular.ttf");
Field monospace = Typeface.class.getDeclaredField("MONOSPACE");
monospace.setAccessible(true);
monospace.set(null, typefaceMonospace);
} catch (Exception e) {
e.printStackTrace();
}
}
private void setEnvConfig() {
if (AppConfig.DEBUG) {
// 开发测试环境
AppConfig.HOST = AppConfig.HOST_TEST;
AppConfig.WX_URL = AppConfig.WX_URL_TEST;
} else {
// 线上环境
AppConfig.HOST = AppConfig.HOST_PROD;
AppConfig.WX_URL = AppConfig.WX_URL_PROD;
}
// 第一个点单屏默认显示交互屏
if (AppConfig.DEFAULT_SCREEN_NO.equals("1")) {
AppConfig.DEFAULT_PRESENT = PresentState.INTERACTION.getName();
} else {
AppConfig.DEFAULT_PRESENT = PresentState.MENU.getName();
}
// if (AppConfig.DEBUG) { // TODO delete
// return "SN0091290001";
// }
}
private static MainData mainData = new MainData();
private static List<TrolleyGoods> TROLLEY_GOODS = new ArrayList<>();
......@@ -50,40 +100,6 @@ public class HLApplication extends Application {
return TROLLEY_GOODS;
}
@Override
public void onCreate() {
super.onCreate();
HLApplication.SELF = this;
UMConfigure.preInit(this, AppConfig.UMENG_APPKEY, AppConfig.UMENG_CHANNEL);
UMConfigure.init(this, AppConfig.UMENG_APPKEY, AppConfig.UMENG_CHANNEL, 0, null);
try {
Typeface typefaceMonospace = Typeface.createFromAsset(getAssets(), "fonts/pingfang_jianti_regular.ttf");
Field monospace = Typeface.class.getDeclaredField("MONOSPACE");
monospace.setAccessible(true);
monospace.set(null, typefaceMonospace);
} catch (Exception e) {
e.printStackTrace();
}
AppConfig.MACHINE_CODE = SharedPreferencesUtils.getMachineCode(this);
JPushInterface.setDebugMode(true);
JPushInterface.init(this);
String registrationId = JPushInterface.getRegistrationID(this);
Log.d(AppConfig.TAG_PUSH, "get registrationId:" + registrationId);
if (!StringUtils.isEmpty(registrationId)) {
HttpUtil.postRegistrationId(registrationId, null);
}
}
@Override
public void onTerminate() {
super.onTerminate();
}
public static Integer getCountOfOrder() {
if (HLApplication.getMainData() == null || HLApplication.getMainData().getCountOfOrder() == null) {
return 9;
......
......@@ -2,11 +2,11 @@ package com.ihaoin.hooloo.device.component;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.util.Utils;
/**
* 所有网络请求处理父类
......@@ -19,7 +19,7 @@ public abstract class NetworkHandler extends Handler {
if (AppConfig.DEBUG) {
String url = msg.getData().getString("url");
String msgText = String.format("请求:%s, 返回状态:%s, 返回内容:%s", url, msg.what, msg.obj);
Log.d(AppConfig.TAG_NETWORK, msgText);
Utils.i(AppConfig.TAG_NETWORK, msgText);
}
if (msg == null || msg.what == 0) {
return;
......
......@@ -2,7 +2,6 @@ package com.ihaoin.hooloo.device.component;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.HLApplication;
......@@ -24,7 +23,7 @@ import cn.jpush.android.service.JPushMessageReceiver;
public class PushMessageReceiver extends JPushMessageReceiver {
@Override
public void onMessage(Context context, CustomMessage customMessage) {
Log.e(AppConfig.TAG_PUSH, "[onMessage] " + customMessage);
Utils.i(AppConfig.TAG_PUSH, "[onMessage] " + customMessage);
this.showToast("onMessage");
try {
dispatchMsg(customMessage);
......@@ -37,7 +36,7 @@ public class PushMessageReceiver extends JPushMessageReceiver {
JsonNode jsonNode = JsonUtils.getMapper().readValue(customMessage.message, JsonNode.class);
String action = jsonNode.get("action").asText();
if (StringUtils.isEmpty(action)) {
Log.e(AppConfig.TAG_PUSH, "msg action is empty");
Utils.i(AppConfig.TAG_PUSH, "msg action is empty");
return;
}
......@@ -46,67 +45,68 @@ public class PushMessageReceiver extends JPushMessageReceiver {
@Override
public void onNotifyMessageOpened(Context context, NotificationMessage message) {
Log.e(AppConfig.TAG_PUSH, "[onNotifyMessageOpened] " + message);
Utils.i(AppConfig.TAG_PUSH, "[onNotifyMessageOpened] " + message);
this.showToast("onNotifyMessageOpened");
}
@Override
public void onMultiActionClicked(Context context, Intent intent) {
Log.e(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击了通知栏按钮");
Utils.i(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击了通知栏按钮");
this.showToast("onMultiActionClicked");
String nActionExtra = intent.getExtras().getString(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA);
//开发者根据不同 Action 携带的 extra 字段来分配不同的动作。
if (nActionExtra == null) {
Log.d(AppConfig.TAG_PUSH, "ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null");
Utils.i(AppConfig.TAG_PUSH, "ACTION_NOTIFICATION_CLICK_ACTION nActionExtra is null");
return;
}
if (nActionExtra.equals("my_extra1")) {
Log.e(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮一");
Utils.i(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮一");
} else if (nActionExtra.equals("my_extra2")) {
Log.e(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮二");
Utils.i(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮二");
} else if (nActionExtra.equals("my_extra3")) {
Log.e(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮三");
Utils.i(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮三");
} else {
Log.e(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
Utils.i(AppConfig.TAG_PUSH, "[onMultiActionClicked] 用户点击通知栏按钮未定义");
}
}
@Override
public void onNotifyMessageArrived(Context context, NotificationMessage message) {
Log.e(AppConfig.TAG_PUSH, "[onNotifyMessageArrived] " + message);
Utils.i(AppConfig.TAG_PUSH, "[onNotifyMessageArrived] " + message);
this.showToast("onNotifyMessageArrived");
}
@Override
public void onNotifyMessageDismiss(Context context, NotificationMessage message) {
Log.e(AppConfig.TAG_PUSH, "[onNotifyMessageDismiss] " + message);
Utils.i(AppConfig.TAG_PUSH, "[onNotifyMessageDismiss] " + message);
this.showToast("onNotifyMessageDismiss");
}
@Override
public void onRegister(Context context, String registrationId) {
Log.e(AppConfig.TAG_PUSH, "[onRegister] " + registrationId);
HttpUtil.postRegistrationId(registrationId, null);
Utils.i(AppConfig.TAG_PUSH, "[onRegister] " + registrationId);
AppConfig.REGISTRATION_ID = registrationId;
HttpUtil.postRegistrationId();
this.showToast("onRegister");
}
@Override
public void onConnected(Context context, boolean isConnected) {
Log.e(AppConfig.TAG_PUSH, "[onConnected] " + isConnected);
Utils.i(AppConfig.TAG_PUSH, "[onConnected] " + isConnected);
this.showToast("onConnected");
}
@Override
public void onCommandResult(Context context, CmdMessage cmdMessage) {
Log.e(AppConfig.TAG_PUSH, "[onCommandResult] " + cmdMessage);
Utils.i(AppConfig.TAG_PUSH, "[onCommandResult] " + cmdMessage);
this.showToast("onCommandResult");
}
@Override
public void onNotificationSettingsCheck(Context context, boolean isOn, int source) {
super.onNotificationSettingsCheck(context, isOn, source);
Log.e(AppConfig.TAG_PUSH, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source);
Utils.i(AppConfig.TAG_PUSH, "[onNotificationSettingsCheck] isOn:" + isOn + ",source:" + source);
this.showToast("onNotificationSettingsCheck");
}
......
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);
}
};
}
package com.ihaoin.hooloo.device.config;
import com.ihaoin.hooloo.device.data.enums.PresentState;
public class AppConfig {
public static Boolean DEBUG = true; // TODO 编译环境
/** 点单屏编码 */
public static String DEFAULT_SCREEN_NO = "1"; // TODO 编译点单屏编码
/** 副屏内容 */
public static String DEFAULT_PRESENT = PresentState.MENU.getName();
public static Boolean DEBUG = true; // TODO false
public static String HL = "HL";
public static String TAG = HL + "_TEST";
public static String TAG_PUSH = HL + "_PUSH";
public static String TAG_NETWORK = HL + "_NETWORK";
/** 点单屏编码 */
public static String DEFAULT_SCREEN_NO = "1";
public static String UMENG_APPKEY = "6294708905844627b598aa78";
public static String UMENG_CHANNEL = "DEVICE_ORDER";
/** 机器编码 */
public static String MACHINE_CODE = "";
public static String REGISTRATION_ID = "";
/** 打开微信网址 */
public static String WX_URL = "http://hooloo.gdatac.com/c2?id=%s";
public static String UMENG_APPKEY = "6294708905844627b598aa78";
public static String UMENG_CHANNEL = "DEVICE_ORDER";
public static String WX_URL = "";
public static String WX_URL_PROD = "http://hooloo.gdatac.com/prod-co?id=%s";
public static String WX_URL_TEST = "http://hooloo.gdatac.com/c2?id=%s";
public static String HOST = "";
public static final String HOST_PROD = "https://hooloo-api.gdatac.com/";
public static final String HOST_TEST = "https://hooloo-dev-api.gdatac.com/";
}
......@@ -17,9 +17,16 @@ public class Base {
public static final String BROADCAST_ACTION_TROLLEY_SHOW = "ACTION_TROLLEY_SHOW";
public static final String BROADCAST_ACTION_TROLLEY_HIDE = "ACTION_TROLLEY_HIDE";
public static final String BROADCAST_ACTION_MACHINE_CODE_CHANGED = "ACTION_MACHINE_CODE_CHANGED";
public static final String BROADCAST_ACTION_MENU_STATE_CHANGED = "ACTION_MENU_STATE_CHANGED";
public static final String BROADCAST_ACTION_PRESENT_CHANGED = "ACTION_MENU_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_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_SOCKET_GET_MACHINE_STATE = "BROADCAST_SOCKET_GET_MACHINE_STATE";
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;
import com.ihaoin.hooloo.device.util.StringUtils;
public enum PresentState {
NONE("不显示"),
MENU("菜单屏"),
INTERACTION("交互屏");
private String name;
PresentState(String name) {
this.name = name;
}
public static PresentState get(String name) {
if (StringUtils.isEmpty(name)) {
return NONE;
}
for (PresentState state : PresentState.values()) {
if (state.getName().equals(name)) {
return state;
}
}
return null;
}
public String getName() {
return name;
}
}
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;
}
}
......@@ -20,6 +20,18 @@ public class Order implements Serializable {
* 状态
*/
private Integer state;
/**
* 制作进度
*/
private Integer progress = 0;
public Integer getProgress() {
return progress;
}
public void setProgress(Integer progress) {
this.progress = progress;
}
public Integer getOrderId() {
return orderId;
......
package com.ihaoin.hooloo.device.network;
public class HttpParams {
import com.ihaoin.hooloo.device.config.AppConfig;
private static final String HOST = "https://hooloo-api.gdatac.com/";
public class HttpParams {
/** 首页获取数据 */
public static final String GET_MAIN_DATA = HOST + "/application/getOrderTaking?machineCode=%s";
public static final String GET_MAIN_DATA = AppConfig.HOST + "/application/getOrderTaking?machineCode=%s";
/** 获取订单信息 */
public static final String GET_ORDERS = HOST + "/application/getOrderInfo?machineCode=%s";
public static final String GET_ORDERS = AppConfig.HOST + "/application/getOrderInfo?machineCode=%s";
/** 校验SKU状态 */
public static final String CHECK_SKU = HOST + "/application/checkSku?machineCode=%s&skuId=%s";
public static final String CHECK_SKU = AppConfig.HOST + "/application/checkSku?machineCode=%s&skuId=%s";
/** 保存购物车数据 */
public static final String POST_CONFIRM_ORDER = HOST + "/application/saveData?machineCode=%s";
public static final String POST_CONFIRM_ORDER = AppConfig.HOST + "/application/saveData?machineCode=%s";
/** 保存推送ID */
public static final String POST_REGISTRATION_ID = HOST + "/application/jgRegister?machineCode=%s&registerId=%s";
public static final String POST_REGISTRATION_ID = AppConfig.HOST + "/application/jgRegister?machineCode=%s&registerId=%s";
}
......@@ -3,16 +3,14 @@ package com.ihaoin.hooloo.device.network;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.io.IOException;
import java.net.NetworkInterface;
import java.util.Collections;
import java.util.List;
import okhttp3.Call;
import okhttp3.Callback;
......@@ -63,7 +61,7 @@ public class HttpUtil {
try {
if (handler == null) {
String msgText = String.format("请求:%s, 返回状态:%s, 返回内容:%s", call.request().url(), 0, e.getMessage());
Log.e(AppConfig.TAG_NETWORK, msgText);
Utils.i(AppConfig.TAG_NETWORK, msgText);
return;
}
sendHandlerMessage(0, handler, call, e);
......@@ -86,7 +84,7 @@ public class HttpUtil {
}
if (handler == null) {
String msgText = String.format("请求:%s, 返回状态:%s, 返回内容:%s", call.request().url(), 1, responseBody);
Log.i(AppConfig.TAG_NETWORK, msgText);
Utils.i(AppConfig.TAG_NETWORK, msgText);
return;
}
sendHandlerMessage(1, handler, call, jsonNode.get("data") == null ? "" : jsonNode.get("data").toString());
......@@ -118,9 +116,17 @@ public class HttpUtil {
post(url, body, handler);
}
public static void postRegistrationId(String registrationId, Handler handler) {
String url = String.format(HttpParams.POST_REGISTRATION_ID, AppConfig.MACHINE_CODE, registrationId);
get(url, handler);
public static void postRegistrationId() {
if (StringUtils.isEmpty(AppConfig.MACHINE_CODE)) {
Utils.i("post machineCode is null");
return;
}
if (StringUtils.isEmpty(AppConfig.REGISTRATION_ID)) {
Utils.i("post registrationId is null");
return;
}
String url = String.format(HttpParams.POST_REGISTRATION_ID, AppConfig.MACHINE_CODE, AppConfig.REGISTRATION_ID);
get(url, null);
}
public static void checkSku(Integer skuId, Handler handler) {
......@@ -128,30 +134,27 @@ public class HttpUtil {
get(url, handler);
}
public static String getMacAddress() {
try {
if (AppConfig.DEBUG) { // TODO delete
return "SN0091290001";
}
List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface nif : all) {
if (!nif.getName().equalsIgnoreCase("wlan0")) continue;
byte[] macBytes = nif.getHardwareAddress();
if (macBytes == null) {
return null;
}
StringBuilder res1 = new StringBuilder();
for (byte b : macBytes) {
res1.append(String.format("%02X:", b));
}
if (res1.length() > 0) {
res1.deleteCharAt(res1.length() - 1);
}
return res1.toString();
}
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
// public static String getMacAddress() {
// try {
// List<NetworkInterface> all = Collections.list(NetworkInterface.getNetworkInterfaces());
// for (NetworkInterface nif : all) {
// if (!nif.getName().equalsIgnoreCase("wlan0")) continue;
// byte[] macBytes = nif.getHardwareAddress();
// if (macBytes == null) {
// return null;
// }
// StringBuilder res1 = new StringBuilder();
// for (byte b : macBytes) {
// res1.append(String.format("%02X:", b));
// }
// if (res1.length() > 0) {
// res1.deleteCharAt(res1.length() - 1);
// }
// return res1.toString();
// }
// } catch (Exception ex) {
// ex.printStackTrace();
// }
// return null;
// }
}
......@@ -4,12 +4,11 @@ import android.content.Context;
import android.content.SharedPreferences;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.network.HttpUtil;
public class SharedPreferencesUtils {
private final static String KEY_SEETINGS = "settings";
private final static String KEY_SCREEN_NO = "SCREEN_NO";
private final static String KEY_SHOW_MENU = "SHOW_MENU";
private final static String KEY_PRESENTATION = "KEY_PRESENTATION";
private final static String KEY_SHOW_LOGCAT = "SHOW_LOGCAT";
private final static String KEY_MACHINE_CODE = "MACHINE_CODE";
......@@ -25,7 +24,7 @@ public class SharedPreferencesUtils {
public static String getMachineCode(Context context) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getString(KEY_MACHINE_CODE, HttpUtil.getMacAddress());
return sp.getString(KEY_MACHINE_CODE, "");
}
public static void setMachineCode(Context context, String val) {
......@@ -33,14 +32,14 @@ public class SharedPreferencesUtils {
sp.edit().putString(KEY_MACHINE_CODE, val).commit();
}
public static Boolean getShowMenu(Context context) {
public static String getPresentation(Context context) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getBoolean(KEY_SHOW_MENU, getScreenNo(context).equals(AppConfig.DEFAULT_SCREEN_NO));
return sp.getString(KEY_PRESENTATION, AppConfig.DEFAULT_PRESENT);
}
public static void setShowMenu(Context context, Boolean val) {
public static void setPresentation(Context context, String val) {
SharedPreferences sp = getSharedPreferences(context);
sp.edit().putBoolean(KEY_SHOW_MENU, val).commit();
sp.edit().putString(KEY_PRESENTATION, val).commit();
}
public static Boolean getShowLogcat(Context context) {
......
......@@ -6,6 +6,7 @@ import android.content.Intent;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.TouchDelegate;
......@@ -22,6 +23,7 @@ import com.bumptech.glide.RequestManager;
import com.bumptech.glide.request.RequestOptions;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.component.TouchDelegateComposite;
import com.ihaoin.hooloo.device.config.AppConfig;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.SkuState;
......@@ -31,6 +33,7 @@ import com.ihaoin.hooloo.device.view.ClearDialog;
import com.ihaoin.hooloo.device.view.ConfirmOrderDialog;
import com.ihaoin.hooloo.device.view.GoodsDetailDialog;
import com.ihaoin.hooloo.device.view.SettingsActivity;
import com.ihaoin.hooloo.device.view.TestDialog;
import com.ihaoin.hooloo.device.view.TipsDialog;
import java.math.BigDecimal;
......@@ -40,6 +43,15 @@ import java.util.List;
import java.util.Optional;
public class Utils {
public static void i(String s) {
Utils.i(AppConfig.TAG, s);
}
public static void i(String t, String s) {
Log.i(t, s);
}
public static long getTimestamp() {
return new Date().getTime();
}
......@@ -76,6 +88,11 @@ public class Utils {
dialog.show();
}
public static void showTest(Context context) {
TestDialog dialog = new TestDialog(context);
dialog.show();
}
public static void showClearDialog(Context context) {
ClearDialog dialog = new ClearDialog(context);
dialog.show();
......
......@@ -11,7 +11,6 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.util.Utils;
......@@ -29,7 +28,7 @@ public class ClearDialog extends Dialog {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.view_clear);
this.setContentView(R.layout.dialog_clear);
setCancelable(false);
setCanceledOnTouchOutside(false);
......@@ -61,8 +60,8 @@ public class ClearDialog extends Dialog {
}
private void confirmClear() {
Utils.fastBroadcast(HLApplication.SELF, Base.BROADCAST_ACTION_CLEAR_GOODS);
Utils.fastBroadcast(HLApplication.SELF, Base.BROADCAST_ACTION_TIMEOUT);
Utils.fastBroadcast(getContext(), Base.BROADCAST_ACTION_CLEAR_GOODS);
Utils.fastBroadcast(getContext(), Base.BROADCAST_ACTION_TIMEOUT);
dismiss();
}
......
......@@ -12,7 +12,6 @@ import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
......@@ -81,7 +80,7 @@ public class ConfirmOrderDialog extends Dialog {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.view_confirm_order);
this.setContentView(R.layout.dialog_confirm_order);
initViews();
LauncherActivity.TIMEOUT_TOGGLE = false;
}
......@@ -157,7 +156,7 @@ public class ConfirmOrderDialog extends Dialog {
confirmOrder.setSeqNo(genSeqNo());
confirmOrder.setGoods(confirmGoods);
String json = JsonUtils.getMapper().writeValueAsString(confirmOrder);
Log.d(AppConfig.TAG, "saveData json: " + json);
Utils.i("saveData json: " + json);
return json;
} catch (Exception e) {
e.printStackTrace();
......@@ -188,13 +187,13 @@ public class ConfirmOrderDialog extends Dialog {
confirmOrderHandler.removeCallbacksAndMessages(null);
confirmOrderHandler = null;
}
unregsitQRCodeVisitedReceiver();
unregistQRCodeVisitedReceiver();
}
};
/** 等待扫码倒计时 */
private void startExpireThread() {
regsitQRCodeVisitedReceiver();
registQRCodeVisitedReceiver();
expireThread = new Thread(() -> {
try {
for (int i = EXPIRE_TIMES; i >= 0; i--) {
......@@ -316,18 +315,18 @@ public class ConfirmOrderDialog extends Dialog {
expireThread.interrupt();
showSucceedViews();
startReturnThread();
unregsitQRCodeVisitedReceiver();
unregistQRCodeVisitedReceiver();
}
}
private void regsitQRCodeVisitedReceiver() {
private void registQRCodeVisitedReceiver() {
qrCodeVisitedReceiver = new QRCodeVisitedReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.PUSH_ACTION_QRCODE_VISITED);
getContext().registerReceiver(qrCodeVisitedReceiver, filter);
}
private void unregsitQRCodeVisitedReceiver() {
private void unregistQRCodeVisitedReceiver() {
if (qrCodeVisitedReceiver != null) {
getContext().unregisterReceiver(qrCodeVisitedReceiver);
qrCodeVisitedReceiver = null;
......
......@@ -85,9 +85,9 @@ public class GoodsDetailDialog extends Dialog {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.view_goods_detail);
this.setContentView(R.layout.dialog_goods_detail);
initViews();
regsitTimeoutReceiver();
registTimeoutReceiver();
LauncherActivity.IN_MAIN = false;
}
......@@ -221,7 +221,7 @@ public class GoodsDetailDialog extends Dialog {
pagerThread.interrupt();
pagerThread = null;
}
unregsitTimeoutReceiver();
unregistTimeoutReceiver();
LauncherActivity.IN_MAIN = true;
}
};
......@@ -676,14 +676,14 @@ public class GoodsDetailDialog extends Dialog {
}
}
private void regsitTimeoutReceiver() {
private void registTimeoutReceiver() {
timeoutReceiver = new TimeoutReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_TIMEOUT);
this.getContext().registerReceiver(timeoutReceiver, filter);
}
private void unregsitTimeoutReceiver() {
private void unregistTimeoutReceiver() {
if (timeoutReceiver != null) {
this.getContext().unregisterReceiver(timeoutReceiver);
timeoutReceiver = null;
......
package com.ihaoin.hooloo.device.view;
import android.app.Presentation;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.Display;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.util.Utils;
public class InteractionPresentation extends Presentation {
public InteractionPresentation(Context outerContext, Display display) {
super(outerContext, display);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.present_interaction);
initViews();
setOnDismissListener(dismissListener);
registDetectionReceiver();
}
private void initViews() {
}
OnDismissListener dismissListener = new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
Utils.i("interaction present dismiss");
unregistDetectionReceiver();
}
};
DetectionReceiver detectionReceiver = null;
private void registDetectionReceiver() {
detectionReceiver = new DetectionReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_DETECTION_BODY);
filter.addAction(Base.BROADCAST_ACTION_DETECTION_NONE);
getContext().registerReceiver(detectionReceiver, filter);
}
private void unregistDetectionReceiver() {
if (detectionReceiver != null) {
getContext().unregisterReceiver(detectionReceiver);
detectionReceiver = null;
}
}
class DetectionReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
}
}
}
......@@ -13,7 +13,6 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
......@@ -34,10 +33,13 @@ import com.ihaoin.hooloo.device.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.component.NetworkHandler;
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.Base;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.ScrollBean;
import com.ihaoin.hooloo.device.data.enums.PresentState;
import com.ihaoin.hooloo.device.data.enums.SkuState;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.data.vo.Goods;
......@@ -78,7 +80,8 @@ public class LauncherActivity extends Activity {
//记录商品当前可见的第一个item的position
private int first = 0;
private TrolleyView trolleyView;
private MenuPresentation menu;
private MenuPresentation menuView;
private InteractionPresentation presentView;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -88,39 +91,63 @@ public class LauncherActivity extends Activity {
requestPermissions();
txtCategory = findViewById(R.id.txt_category);
trolleyView = findViewById(R.id.view_trolley);
groupCategory = findViewById(R.id.group_category);
recGoods = findViewById(R.id.rec_right);
recRecommends = findViewById(R.id.rec_recommend);
layoutTips = findViewById(R.id.layout_tips);
layoutTips.setOnClickListener(v -> Utils.showTips(LauncherActivity.this));
initViews();
initRecommends();
setRecommendsData();
initCategorys();
initGoods();
setGoodsData();
registTrolleyGoodsChangedReceiver();
registTrolleyStateChangedReceiver();
registSettingChangedReceiver();
prepareMenuView();
regsitSkuChangeReceiver();
regsitGoodsChangeReceiver();
regsitTouchReceiver();
preparePresentView();
registSkuChangeReceiver();
registGoodsChangeReceiver();
registTouchReceiver();
startLoadDataThread();
initSettingsQueue();
startTimeoutThread();
// startServer();
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
startClient();
getMachineCode();
}
private void initViews() {
txtCategory = findViewById(R.id.txt_category);
trolleyView = findViewById(R.id.view_trolley);
groupCategory = findViewById(R.id.group_category);
recGoods = findViewById(R.id.rec_right);
recRecommends = findViewById(R.id.rec_recommend);
layoutTips = findViewById(R.id.layout_tips);
layoutTips.setOnClickListener(v -> Utils.showTips(LauncherActivity.this));
}
private void startTimeoutThread() {
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
public boolean dispatchTouchEvent(MotionEvent ev) {
Log.i(AppConfig.TAG, "dispatchTouchEvent");
Utils.i("dispatchTouchEvent");
TIMESTAMP = Utils.getTimestamp();
return super.dispatchTouchEvent(ev);
}
......@@ -130,12 +157,15 @@ public class LauncherActivity extends Activity {
new SettingsQueue(this, imgLogo, txtCategory);
}
private void setMachineCode() {
private void getMachineCode() {
AppConfig.MACHINE_CODE = SharedPreferencesUtils.getMachineCode(this);
if (AppConfig.DEBUG) {
Log.i(AppConfig.TAG, "machine code: " + AppConfig.MACHINE_CODE);
if (StringUtils.isEmpty(AppConfig.MACHINE_CODE)) {
Utils.fastBroadcast(this, Base.BROADCAST_SOCKET_GET_MACHINE_CODE); // 从设备上获取机器编码
return;
}
startLoadDataThread();
Utils.i("machine code: " + AppConfig.MACHINE_CODE);
loadData();
HttpUtil.postRegistrationId();
}
private void initRecommends() {
......@@ -221,11 +251,6 @@ public class LauncherActivity extends Activity {
title = scrollGoods.get(first).header;
} else {
title = scrollGoods.get(first).t.getType();
if (dy < 0) { // 上滑
// Log.d(AppConfig.TAG, "up, " + recGoods);
} else if (dy > 0) {// 下滑
// Log.d(AppConfig.TAG, "down, " + recGoods.getScrollY());
}
}
txtCategory.setText(title);
}
......@@ -242,7 +267,6 @@ public class LauncherActivity extends Activity {
nextView.getLocationInWindow(location);
int topMargin = location[1] - paddingTop;
int height = nextView.getHeight();
// Log.d(AppConfig.TAG, String.format("c:%s, n:%s, 0:%s, 1:%s", firstPosition, nextPosition, rect[0], rect[1]));
if (topMargin < height) {
lp.setMargins(0, -(height - topMargin), 0, 0);
}
......@@ -355,19 +379,19 @@ public class LauncherActivity extends Activity {
}
}
private void startLoadDataThread() {
loadData();
// new Thread(() -> {
// try {
// while (true) {
// runOnUiThread(() -> loadData());
// Thread.sleep(1000 * 10);
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }).start();
}
// private void startLoadDataThread() {
// loadData();
//// new Thread(() -> {
//// try {
//// while (true) {
//// runOnUiThread(() -> loadData());
//// Thread.sleep(1000 * 10);
//// }
//// } catch (Exception e) {
//// e.printStackTrace();
//// }
//// }).start();
// }
private LoadDataHandler loadDataHandler;
......@@ -399,8 +423,8 @@ public class LauncherActivity extends Activity {
setRecommendsData();
initCategorys();
setGoodsData();
if (menu != null) {
menu.mainDataChanged();
if (menuView != null) {
menuView.mainDataChanged();
}
}
......@@ -414,9 +438,10 @@ public class LauncherActivity extends Activity {
this.unregistTrolleyGoodsChangedReceiver();
this.unregistTrolleyStateChangedReceiver();
this.unregistSettingChangedReceiver();
this.unregsitSkuChangeReceiver();
this.unregsitGoodsChangeReceiver();
this.unregsitTouchReceiver();
this.unregistSkuChangeReceiver();
this.unregistGoodsChangeReceiver();
this.unregistTouchReceiver();
socketClient.close();
System.exit(0);
}
......@@ -434,11 +459,11 @@ public class LauncherActivity extends Activity {
private void registTrolleyGoodsChangedReceiver() {
if (trolleyGoodsChangedReceiver == null) {
trolleyGoodsChangedReceiver = new TrolleyGoodsChangedReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(Base.BROADCAST_ACTION_ADD_GOODS);
intentFilter.addAction(Base.BROADCAST_ACTION_GOODS_CHANGED);
intentFilter.addAction(Base.BROADCAST_ACTION_CLEAR_GOODS);
this.registerReceiver(trolleyGoodsChangedReceiver, intentFilter);
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_ADD_GOODS);
filter.addAction(Base.BROADCAST_ACTION_GOODS_CHANGED);
filter.addAction(Base.BROADCAST_ACTION_CLEAR_GOODS);
this.registerReceiver(trolleyGoodsChangedReceiver, filter);
}
}
......@@ -503,15 +528,11 @@ public class LauncherActivity extends Activity {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Base.BROADCAST_ACTION_MACHINE_CODE_CHANGED)) {
setMachineCode();
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_MENU_STATE_CHANGED)) {
if (SharedPreferencesUtils.getShowMenu(LauncherActivity.this)) {
showMenuView();
} else {
hideMenuView();
}
getMachineCode();
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_PRESENT_CHANGED)) {
preparePresentView();
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED)) {
if (SharedPreferencesUtils.getShowMenu(LauncherActivity.this)) {
if (SharedPreferencesUtils.getShowLogcat(LauncherActivity.this)) {
Utils.showToast(LauncherActivity.this, "展示Logcat");
} else {
Utils.showToast(LauncherActivity.this, "隐藏Logcat");
......@@ -520,12 +541,53 @@ public class LauncherActivity extends Activity {
}
}
/** 显示副屏内容 */
private void preparePresentView() {
PresentState present = PresentState.get(SharedPreferencesUtils.getPresentation(LauncherActivity.this));
switch (present) {
case MENU:
showMenuView();
hideInteractionView();
return;
case INTERACTION:
hideMenuView();
showInteractionView();
return;
default:
hideMenuView();
hideInteractionView();
return;
}
}
/** 显示菜单屏KDS */
private void prepareMenuView() {
if (SharedPreferencesUtils.getShowMenu(LauncherActivity.this)) {
showMenuView();
/** 显示交互屏 */
private void showInteractionView() {
if (AppConfig.DEBUG) {
Utils.showToast(this, "展示交互屏");
}
if (presentView != null) {
return;
}
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
Utils.showToast(this, "未获取到菜单屏硬件");
return;
}
presentView = new InteractionPresentation(this, displays[1]);
presentView.show();
}
/** 隐藏交互屏 */
private void hideInteractionView() {
if (AppConfig.DEBUG) {
Utils.showToast(this, "隐藏交互屏");
}
if (presentView == null) {
return;
}
presentView.dismiss();
presentView = null;
}
/** 显示菜单屏KDS */
......@@ -533,7 +595,7 @@ public class LauncherActivity extends Activity {
if (AppConfig.DEBUG) {
Utils.showToast(this, "展示菜单屏");
}
if (menu != null) {
if (menuView != null) {
return;
}
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
......@@ -542,19 +604,19 @@ public class LauncherActivity extends Activity {
Utils.showToast(this, "未获取到菜单屏硬件");
return;
}
menu = new MenuPresentation(this, displays[1]);
menu.show();
menuView = new MenuPresentation(this, displays[1]);
menuView.show();
}
private void hideMenuView() {
if (AppConfig.DEBUG) {
Utils.showToast(this, "隐藏菜单屏");
}
if (menu == null) {
if (menuView == null) {
return;
}
menu.dismiss();
menu = null;
menuView.dismiss();
menuView = null;
}
private void requestPermissions() {
......@@ -567,7 +629,7 @@ public class LauncherActivity extends Activity {
settingChangedReceiver = new SettingChangedReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_MACHINE_CODE_CHANGED);
filter.addAction(Base.BROADCAST_ACTION_MENU_STATE_CHANGED);
filter.addAction(Base.BROADCAST_ACTION_PRESENT_CHANGED);
filter.addAction(Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED);
this.registerReceiver(settingChangedReceiver, filter);
}
......@@ -579,42 +641,42 @@ public class LauncherActivity extends Activity {
}
}
private void regsitSkuChangeReceiver() {
private void registSkuChangeReceiver() {
skuChangeReceiver = new SkuStateChangeReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.PUSH_ACTION_SKU_STATE_CHANGED);
this.registerReceiver(skuChangeReceiver, filter);
}
private void unregsitSkuChangeReceiver() {
private void unregistSkuChangeReceiver() {
if (skuChangeReceiver != null) {
this.unregisterReceiver(skuChangeReceiver);
skuChangeReceiver = null;
}
}
private void regsitGoodsChangeReceiver() {
private void registGoodsChangeReceiver() {
goodsChangeReceiver = new GoodsChangeReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.PUSH_ACTION_GOODS_CHANGED);
this.registerReceiver(goodsChangeReceiver, filter);
}
private void unregsitGoodsChangeReceiver() {
private void unregistGoodsChangeReceiver() {
if (goodsChangeReceiver != null) {
this.unregisterReceiver(goodsChangeReceiver);
goodsChangeReceiver = null;
}
}
private void regsitTouchReceiver() {
private void registTouchReceiver() {
touchReceiver = new TouchReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_TOUCH_EVENT);
this.registerReceiver(touchReceiver, filter);
}
private void unregsitTouchReceiver() {
private void unregistTouchReceiver() {
if (touchReceiver != null) {
this.unregisterReceiver(touchReceiver);
touchReceiver = null;
......@@ -718,15 +780,8 @@ public class LauncherActivity extends Activity {
TIMESTAMP = Utils.getTimestamp();
continue;
}
// if (!IN_MAIN) {
// TIMESTAMP = Utils.getTimestamp();
// continue;
// }
// Log.i(AppConfig.TAG, String.valueOf(Utils.getTimestamp() - TIMESTAMP));
if (Utils.getTimestamp() - TIMESTAMP > 1000 * 30) {
TIMESTAMP = Utils.getTimestamp();
// Utils.fastBroadcast(HLApplication.SELF, Base.BROADCAST_ACTION_CLEAR_GOODS);
// Utils.fastBroadcast(HLApplication.SELF, Base.BROADCAST_ACTION_TIMEOUT);
clearTipHandler.sendEmptyMessage(0);
}
}
......
......@@ -3,15 +3,16 @@ package com.ihaoin.hooloo.device.view;
import android.app.Presentation;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Display;
import android.view.View;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.VideoView;
import android.widget.TextView;
import androidx.annotation.NonNull;
......@@ -22,7 +23,6 @@ import com.ihaoin.hooloo.device.adapter.OrderAdapter;
import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.enums.ImageState;
import com.ihaoin.hooloo.device.data.enums.OrderState;
import com.ihaoin.hooloo.device.data.vo.Order;
import com.ihaoin.hooloo.device.data.vo.OrderPkg;
......@@ -49,8 +49,6 @@ public class MenuPresentation extends Presentation {
private List<Order> completedOrders;
private ImageView imgLeft;
private ImageView imgRight;
private VideoView vidRight;
private GridView gridCooking;
private GridView gridWaiting;
private GridView gridCompleted;
......@@ -58,6 +56,9 @@ public class MenuPresentation extends Presentation {
private OrderAdapter waitingAdapter;
private OrderAdapter completedAdapter;
private TextView txtSupplement;
private TextView txtClear;
public MenuPresentation(Context outerContext, Display display) {
super(outerContext, display);
}
......@@ -65,21 +66,28 @@ public class MenuPresentation extends Presentation {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu);
setContentView(R.layout.present_menu);
initViews();
loadDatas();
}
registOrderChangeReceiver();
registerMachineMessageReceiver();
setOnDismissListener(dismissListener);
new MachineStateTimer().start();
}
private void initViews() {
imgLeft = findViewById(R.id.img_left);
imgRight = findViewById(R.id.img_right);
vidRight = findViewById(R.id.vid_right);
gridCooking = findViewById(R.id.grid_cooking);
gridWaiting = findViewById(R.id.grid_waiting);
gridCompleted = findViewById(R.id.grid_completed);
txtSupplement = findViewById(R.id.txt_timer_supplement);
txtClear = findViewById(R.id.txt_timer_clear);
cookingAdapter = new OrderAdapter(getContext());
waitingAdapter = new OrderAdapter(getContext());
completedAdapter = new OrderAdapter(getContext());
......@@ -108,41 +116,6 @@ public class MenuPresentation extends Presentation {
if (!StringUtils.isEmpty(mainData.getImages().getLeft())) {
Utils.getGlide(getContext()).load(mainData.getImages().getLeft()).into(imgLeft);
}
String url = "";
if (mainData.getShopState().equals(Base.FALSE)) {
url = getRightImage(ImageState.CLOSED.getCode());
} else if (!CollectionUtils.isEmpty(cookingOrders)) {
url = getRightImage(ImageState.COOKING.getCode());
} else if (!CollectionUtils.isEmpty(completedOrders)) {
url = getRightImage(ImageState.COMPLETED.getCode());
} else {
url = getRightImage(ImageState.NOT_COMPLETED.getCode());
}
if (StringUtils.isEmpty(url)) {
vidRight.pause();
vidRight.setVisibility(View.INVISIBLE);
imgRight.setVisibility(View.INVISIBLE);
return;
}
// url = "http://songclound.oss-cn-hongkong.aliyuncs.com/2022/06/27/e6582afb60924.mp4";
if (url.substring(url.lastIndexOf(".")).equalsIgnoreCase(".mp4")) {
vidRight.setVisibility(View.VISIBLE);
imgRight.setVisibility(View.GONE);
vidRight.setOnPreparedListener(mp -> {
mp.start();
mp.setLooping(true);
});
vidRight.setVideoPath(url);
vidRight.requestFocus();
vidRight.start();
} else {
vidRight.pause();
vidRight.setVisibility(View.GONE);
imgRight.setVisibility(View.VISIBLE);
Utils.getGlide(getContext()).load(url).into(imgRight);
}
}
public void mainDataChanged() {
......@@ -165,29 +138,44 @@ public class MenuPresentation extends Presentation {
}
private void orderDataChanged() {
cookingOrders = getOrders(OrderState.COOKING.getCode());
waitingOrders = getOrders(OrderState.WAITING.getCode());
completedOrders = getOrders(OrderState.COMPLETED.getCode());
List<Order> cookings = getOrders(OrderState.COOKING.getCode());
List<Order> waitings = getOrders(OrderState.WAITING.getCode());
List<Order> completes = getOrders(OrderState.COMPLETED.getCode());
if(!CollectionUtils.isEmpty(cookings) && cookings.size()>2){
cookings = cookings.subList(0,2);
}
if(!CollectionUtils.isEmpty(waitings) && waitings.size()>6){
waitings = waitings.subList(0,6);
}
if(!CollectionUtils.isEmpty(completes) && completes.size()>9){
completes = completes.subList(0,9);
}
cookingAdapter.setOrders(cookingOrders);
waitingAdapter.setOrders(waitingOrders);
completedAdapter.setOrders(completedOrders);
cookingAdapter.setOrders(cookings);
waitingAdapter.setOrders(waitings);
completedAdapter.setOrders(completes);
cookingAdapter.notifyDataSetChanged();
waitingAdapter.notifyDataSetChanged();
completedAdapter.notifyDataSetChanged();
showImages();
regsitOrderChangeReceiver();
}
private void regsitOrderChangeReceiver() {
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;
}
}
private List<Order> getOrders(Integer state) {
if (CollectionUtils.isEmpty(pkgs)) {
return null;
......@@ -300,4 +288,92 @@ public class MenuPresentation extends Presentation {
}
return null;
}
OnDismissListener dismissListener = new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
Utils.i("menu present dismiss");
unregistOrderChangeReceiver();
unregistMachineMessageReceiver();
if (loadOrdersHandler != null) {
loadOrdersHandler.removeCallbacksAndMessages(null);
loadOrdersHandler = 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 void registerMachineMessageReceiver() {
machineMessageReceiver = new MachineMessageReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_MACHINE_STATE_CHANGED);
filter.addAction(Base.BROADCAST_ACTION_PRODUCTION_PROGRESS_CHANGED);
getContext().registerReceiver(machineMessageReceiver, filter);
}
private void unregistMachineMessageReceiver() {
if (machineMessageReceiver != null) {
getContext().unregisterReceiver(machineMessageReceiver);
machineMessageReceiver = null;
}
}
private class MachineMessageReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Base.BROADCAST_ACTION_MACHINE_STATE_CHANGED)) {
updateMachineState();
} else {
updateOrderProgress();
}
}
}
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();
}
}
};
}
......@@ -12,20 +12,23 @@ import android.widget.ToggleButton;
import com.ihaoin.hooloo.device.R;
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;
public class SettingsActivity extends Activity {
private View layoutTest;
private View layoutSysSettings;
private TextView txtVersion;
private TextView txtMachineCode;
private View layoutMachineCode;
private View layoutScreen;
private View layoutPresentation;
private TextView txtScreenNo;
private TextView txtPresentation;
private ToggleButton butnMenu;
private ToggleButton butnLogcat;
private View butnClose;
......@@ -35,30 +38,29 @@ public class SettingsActivity extends Activity {
setContentView(R.layout.activity_settings);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
initViews();
LauncherActivity.IN_MAIN = false;
}
private void initViews() {
layoutTest = findViewById(R.id.layout_test);
layoutSysSettings = findViewById(R.id.layout_sys_settings);
txtVersion = findViewById(R.id.txt_version);
txtMachineCode = findViewById(R.id.txt_machine_code);
layoutMachineCode = findViewById(R.id.layout_machine_code);
layoutScreen = findViewById(R.id.layout_screen);
txtScreenNo = findViewById(R.id.txt_screen_no);
butnMenu = findViewById(R.id.butn_menu);
layoutPresentation = findViewById(R.id.layout_presentation);
txtPresentation = findViewById(R.id.txt_presentation);
butnLogcat = findViewById(R.id.butn_logcat);
butnClose = findViewById(R.id.butn_close);
txtVersion.setText(getAppVersionName());
txtMachineCode.setText(SharedPreferencesUtils.getMachineCode(this));
txtScreenNo.setText(SharedPreferencesUtils.getScreenNo(this));
butnMenu.setChecked(SharedPreferencesUtils.getShowMenu(this));
txtPresentation.setText(SharedPreferencesUtils.getPresentation(this));
butnLogcat.setChecked(SharedPreferencesUtils.getShowLogcat(this));
butnMenu.setOnCheckedChangeListener((v, checked) -> {
SharedPreferencesUtils.setShowMenu(SettingsActivity.this, checked);
Utils.fastBroadcast(SettingsActivity.this, Base.BROADCAST_ACTION_MENU_STATE_CHANGED);
});
layoutTest.setOnClickListener(v -> Utils.showTest(SettingsActivity.this));
butnLogcat.setOnCheckedChangeListener((v, checked) -> {
SharedPreferencesUtils.setShowLogcat(SettingsActivity.this, checked);
Utils.fastBroadcast(SettingsActivity.this, Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED);
......@@ -66,6 +68,7 @@ public class SettingsActivity extends Activity {
butnClose.setOnClickListener(v -> finish());
layoutScreen.setOnClickListener(v -> showEditScreen());
layoutMachineCode.setOnClickListener(v -> showMachineCode());
layoutPresentation.setOnClickListener(v -> showEditPresentation());
layoutSysSettings.setOnClickListener(v -> Utils.openSystemSettings(getApplicationContext()));
}
......@@ -81,6 +84,19 @@ public class SettingsActivity extends Activity {
builder.create().show();
}
private void showEditPresentation() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("修改副屏内容");
String[] items = new String[]{PresentState.NONE.getName(), PresentState.MENU.getName(), PresentState.INTERACTION.getName()};
builder.setSingleChoiceItems(items, StringUtils.indexOf(items, SharedPreferencesUtils.getPresentation(SettingsActivity.this)), (dialog, which) -> {
SharedPreferencesUtils.setPresentation(SettingsActivity.this, items[which]);
txtPresentation.setText(SharedPreferencesUtils.getPresentation(SettingsActivity.this));
dialog.dismiss();
Utils.fastBroadcast(SettingsActivity.this, Base.BROADCAST_ACTION_PRESENT_CHANGED);
});
builder.create().show();
}
private void showMachineCode() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("修改机器编码");
......@@ -104,4 +120,10 @@ public class SettingsActivity extends Activity {
}
return null;
}
@Override
protected void onDestroy() {
super.onDestroy();
LauncherActivity.IN_MAIN = true;
}
}
package com.ihaoin.hooloo.device.view;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.util.Arrays;
public class TestDialog extends Dialog {
private View butnClose;
private WebView webView;
public TestDialog(@NonNull Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.dialog_test);
if (HLApplication.getMainData() == null || StringUtils.isEmpty(HLApplication.getMainData().getTips())) {
dismiss();
return;
}
initViews();
}
private void initViews() {
webView = findViewById(R.id.web_view);
butnClose = findViewById(R.id.butn_close);
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
return false;
}
});
webView.loadUrl("http://www.baidu.com");
butnClose.setOnClickListener(x -> dismiss());
Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose));
}
}
......@@ -33,13 +33,13 @@ public class TipsDialog extends Dialog {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setContentView(R.layout.view_tips);
this.setContentView(R.layout.dialog_tips);
if (HLApplication.getMainData() == null || StringUtils.isEmpty(HLApplication.getMainData().getTips())) {
dismiss();
return;
}
initViews();
regsitTimeoutReceiver();
registTimeoutReceiver();
LauncherActivity.IN_MAIN = false;
}
......@@ -67,7 +67,7 @@ public class TipsDialog extends Dialog {
}
OnDismissListener dismissListener = dialog -> {
unregsitTimeoutReceiver();
unregistTimeoutReceiver();
LauncherActivity.IN_MAIN = true;
};
......@@ -80,14 +80,14 @@ public class TipsDialog extends Dialog {
}
}
private void regsitTimeoutReceiver() {
private void registTimeoutReceiver() {
timeoutReceiver = new TimeoutReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_TIMEOUT);
this.getContext().registerReceiver(timeoutReceiver, filter);
}
private void unregsitTimeoutReceiver() {
private void unregistTimeoutReceiver() {
if (timeoutReceiver != null) {
this.getContext().unregisterReceiver(timeoutReceiver);
timeoutReceiver = null;
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<stroke
android:width="1px"
android:color="@color/progress" />
<corners android:radius="5px" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid
android:width="1px"
android:color="@color/progress" />
<corners android:radius="5px" />
</shape>
</item>
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/img_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.5625"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.4375"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:background="@color/colorPrimary"
android:orientation="vertical"
android:paddingHorizontal="@dimen/menu_content_padding_hor"
android:paddingTop="@dimen/menu_content_padding_top"
android:paddingBottom="@dimen/menu_content_padding_bottom">
<TextView
android:id="@+id/txt_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="自主取餐"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_title" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/txt_title"
android:layout_marginTop="@dimen/menu_order_margin_top"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:id="@+id/txt_cooking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="制作中"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" />
<GridView
android:id="@+id/grid_cooking"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/txt_cooking"
android:horizontalSpacing="@dimen/menu_spacing_hor"
android:numColumns="2"
android:scrollbars="none"
android:verticalSpacing="@dimen/menu_spacing_ver" />
</RelativeLayout>
<ImageView
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginHorizontal="@dimen/menu_divider_padding_hor"
android:layout_marginTop="@dimen/menu_divider_padding_top"
android:layout_marginBottom="@dimen/menu_divider_padding_bottom"
android:background="@color/white"
tools:ignore="Suspicious0dp" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:id="@+id/txt_waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="待制作"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" />
<GridView
android:id="@+id/grid_waiting"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/txt_waiting"
android:horizontalSpacing="@dimen/menu_spacing_hor"
android:numColumns="2"
android:scrollbars="none"
android:verticalSpacing="@dimen/menu_spacing_ver" />
</RelativeLayout>
<ImageView
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginHorizontal="@dimen/menu_divider_padding_hor"
android:layout_marginTop="@dimen/menu_divider_padding_top"
android:layout_marginBottom="@dimen/menu_divider_padding_bottom"
android:background="@color/white"
tools:ignore="Suspicious0dp" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1">
<TextView
android:id="@+id/txt_competed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="可取餐"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" />
<TextView
android:id="@+id/txt_competed1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/txt_competed"
android:layout_toRightOf="@id/txt_competed"
android:text="(扫码取餐)"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle1" />
<GridView
android:id="@+id/grid_completed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/txt_competed"
android:horizontalSpacing="@dimen/menu_spacing_hor"
android:numColumns="2"
android:scrollbars="none"
android:verticalSpacing="@dimen/menu_spacing_ver" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<ImageView
android:id="@+id/img_right"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<VideoView
android:id="@+id/vid_right"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -15,6 +15,28 @@
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/layout_test"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding10"
android:text="工厂测试"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_setting_name" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding10"
android:src="@drawable/ic_baseline_chevron_right_24_grey" />
</LinearLayout>
<include layout="@layout/view_line" />
<LinearLayout
android:id="@+id/layout_sys_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -122,7 +144,7 @@
</LinearLayout>
<include layout="@layout/view_line" />
<LinearLayout
android:id="@+id/layout_menu"
android:id="@+id/layout_presentation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
......@@ -133,15 +155,22 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding10"
android:text="显示菜单屏"
android:text="副屏内容"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_setting_name" />
<ToggleButton
android:id="@+id/butn_menu"
<TextView
android:id="@+id/txt_presentation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding10"
android:foreground="?selectableItemBackground" />
android:text="不显示"
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_setting_desc" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding10"
android:src="@drawable/ic_baseline_chevron_right_24_grey" />
</LinearLayout>
<include layout="@layout/view_line" />
<LinearLayout
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="@dimen/dialog_detail_width"
android:layout_height="match_parent">
<WebView
android:id="@+id/web_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/butn_close"
android:layout_width="@dimen/ic_dialog_close"
android:layout_height="@dimen/ic_dialog_close"
android:layout_alignParentEnd="true"
android:layout_margin="@dimen/dialog_close_margin"
android:foreground="?selectableItemBackground"
android:src="@mipmap/chazi" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_order_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mon000"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
<ProgressBar
android:id="@+id/bar_progress"
style="@style/progress_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/menu_progress_start"
android:layout_marginEnd="@dimen/menu_progress_end"
android:layout_weight="1"
android:max="10"
android:progress="5" />
<TextView
android:id="@+id/txt_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="50%"
android:textColor="@color/white"
android:textSize="@dimen/ts_order_number" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/layout_background"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img_background"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/hooloo_launcher" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="horizontal"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="1"
android:singleLine="false"
android:text="就是借此事物代事物"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="1"
android:singleLine="false"
android:text="它与比拟有相似之处,在于"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="1"
android:singleLine="false"
android:text="它与比之处,但又有所不同,不同之处在于"
android:textColor="@color/black"
android:textSize="18sp" />
</LinearLayout>
<ImageView
android:id="@+id/img_ip"
android:layout_width="match_parent"
android:layout_height="300dp"
android:scaleType="centerCrop"
android:src="@mipmap/mm_049"
app:layout_constraintBottom_toBottomOf="parent" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:orientation="horizontal"
android:padding="10dp"
app:layout_constraintBottom_toTopOf="@+id/img_ip">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:src="@mipmap/mm_049" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="测试内容测试内容测试内容测试内容测试内容测试内容测试内容测试内容"
android:textColor="@color/black"
android:textSize="18sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/img_left"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.7321"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.2679"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.6888"
android:background="@color/menu_order_bg"
android:paddingHorizontal="@dimen/menu_content_padding_hor"
android:paddingTop="@dimen/menu_content_padding_top"
android:paddingBottom="@dimen/menu_content_padding_bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/txt_cooking"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/menu_title_margin_bottom"
android:text="制作中"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" />
<LinearLayout
android:id="@+id/grid_cooking"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/layout_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/layout_progress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/menu_order_number_margin" />
</LinearLayout>
<TextView
android:id="@+id/txt_waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/menu_title_margin_top"
android:layout_marginBottom="@dimen/menu_title_margin_bottom"
android:text="待制作"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" />
<LinearLayout
android:id="@+id/grid_waiting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/menu_title_margin_top"
android:layout_marginBottom="@dimen/menu_title_margin_bottom"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_competed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="可取餐"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle" />
<TextView
android:id="@+id/txt_competed1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/txt_competed"
android:layout_toRightOf="@id/txt_competed"
android:text="(扫码取餐)"
android:textColor="@color/white"
android:textSize="@dimen/ts_menu_subtitle1" />
</LinearLayout>
<LinearLayout
android:id="@+id/grid_completed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/layout_machine_state"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.3112"
android:background="@color/menu_state_bg"
android:orientation="vertical"
android:paddingHorizontal="@dimen/menu_state_padding_hor"
android:paddingVertical="@dimen/menu_state_padding_ver">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="35px"
android:layout_height="34px"
android:src="@mipmap/wendu" />
<TextView
android:id="@+id/txt_outside_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_outside_temp"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_inside_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_inside_temp"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
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">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="35px"
android:layout_height="34px"
android:src="@mipmap/bingxiang" />
<TextView
android:id="@+id/txt_fridge_temp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_fridge_temp"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_inside_humidity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_inside_humidity"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="35px"
android:layout_height="34px"
android:src="@mipmap/shui" />
<TextView
android:id="@+id/txt_water_quality"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_water_quality"
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_timer_supplement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_timer_supplement"
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_timer_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/txt_timer_clear"
android:textColor="@color/black"
android:textSize="@dimen/ts_menu_state" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/menu_logo_bar"
android:layout_alignParentBottom="true"></RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -126,7 +126,7 @@
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:foreground="?selectableItemBackground"
android:text="付款"
android:text="结算"
android:textColor="@color/white"
android:textSize="@dimen/ts_trolley_pay"
android:textStyle="bold" />
......
......@@ -42,12 +42,19 @@
<dimen name="menu_divider_padding_hor">33px</dimen>
<dimen name="menu_divider_padding_top">60px</dimen>
<dimen name="menu_divider_padding_bottom">50px</dimen>
<dimen name="menu_content_padding_hor">55px</dimen>
<dimen name="menu_content_padding_top">38px</dimen>
<dimen name="menu_content_padding_bottom">38px</dimen>
<dimen name="menu_order_margin_top">43px</dimen>
<dimen name="menu_content_padding_hor">40px</dimen>
<dimen name="menu_content_padding_top">40px</dimen>
<dimen name="menu_content_padding_bottom">20px</dimen>
<dimen name="menu_spacing_hor">30px</dimen>
<dimen name="menu_spacing_ver">20px</dimen>
<dimen name="menu_logo_bar">112px</dimen>
<dimen name="menu_progress_start">24px</dimen>
<dimen name="menu_progress_end">32px</dimen>
<dimen name="menu_title_margin_top">20px</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_ver">20px</dimen>
<dimen name="goods_detail_padding_ver">55px</dimen>
<dimen name="goods_detail_padding_hor">40px</dimen>
......@@ -165,9 +172,10 @@
<dimen name="ts_scan">36px</dimen>
<dimen name="ts_expire">36px</dimen>
<dimen name="ts_menu_title">40px</dimen>
<dimen name="ts_menu_subtitle">32px</dimen>
<dimen name="ts_menu_subtitle1">28px</dimen>
<dimen name="ts_order_number">36px</dimen>
<dimen name="ts_menu_subtitle">36px</dimen>
<dimen name="ts_menu_subtitle1">24px</dimen>
<dimen name="ts_order_number">48px</dimen>
<dimen name="ts_menu_state">36px</dimen>
<dimen name="ts_setting_name">18sp</dimen>
<dimen name="ts_setting_desc">16sp</dimen>
</resources>
......@@ -15,4 +15,7 @@
<color name="white">#FFFFFFFF</color>
<color name="black">#FF000000</color>
<color name="colorPink">#FFFF72C1</color>
<color name="progress">#FFCDE3F6</color>
<color name="menu_order_bg">#FF486FFF</color>
<color name="menu_state_bg">#FFCDE3F6</color>
</resources>
......@@ -42,12 +42,19 @@
<dimen name="menu_divider_padding_hor">10px</dimen>
<dimen name="menu_divider_padding_top">20px</dimen>
<dimen name="menu_divider_padding_bottom">20px</dimen>
<dimen name="menu_content_padding_hor">25px</dimen>
<dimen name="menu_content_padding_top">18px</dimen>
<dimen name="menu_content_padding_bottom">18px</dimen>
<dimen name="menu_order_margin_top">23px</dimen>
<dimen name="menu_content_padding_hor">40px</dimen>
<dimen name="menu_content_padding_top">40px</dimen>
<dimen name="menu_content_padding_bottom">20px</dimen>
<dimen name="menu_spacing_hor">10px</dimen>
<dimen name="menu_spacing_ver">100px</dimen>
<dimen name="menu_logo_bar">112px</dimen>
<dimen name="menu_progress_start">24px</dimen>
<dimen name="menu_progress_end">32px</dimen>
<dimen name="menu_title_margin_top">20px</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_ver">20px</dimen>
<dimen name="goods_detail_padding_ver">55px</dimen>
<dimen name="goods_detail_padding_hor">40px</dimen>
......@@ -166,8 +173,9 @@
<dimen name="ts_expire">12sp</dimen>
<dimen name="ts_order_number">12sp</dimen>
<dimen name="ts_menu_title">22sp</dimen>
<dimen name="ts_menu_subtitle">18sp</dimen>
<dimen name="ts_menu_subtitle1">12sp</dimen>
<dimen name="ts_menu_subtitle">10sp</dimen>
<dimen name="ts_menu_subtitle1">8sp</dimen>
<dimen name="ts_menu_state">36px</dimen>
<dimen name="ts_setting_name">16sp</dimen>
<dimen name="ts_setting_desc">14sp</dimen>
</resources>
......@@ -15,4 +15,13 @@
<string name="error_check_sku_wrong">商品状态错误</string>
<string name="error_check_sku">商品已售罄</string>
<string name="clear_tips">是否清空购物车(%ss)</string>
<string name="txt_outside_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_inside_humidity">内部湿度: %s</string>
<string name="txt_water_quality">水质TDS: %s</string>
<string name="txt_timer_supplement">保育员预计降临倒计时: %s</string>
<string name="txt_timer_clear">咖啡机自动清洁倒计时: %s</string>
</resources>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:typeface">monospace</item>
</style>
<style name="button_style" parent="Widget.AppCompat.Button.Borderless">
<style name="button_style" parent="Widget.AppCompat.Button.Borderless"></style>
<style name="progress_bar" parent="@android:style/Widget.ProgressBar.Horizontal">
<item name="android:maxHeight">26px</item>
<item name="android:minHeight">26px</item>
<item name="android:indeterminateOnly">false</item>
<item name="android:indeterminateDrawable">@drawable/bg_indeterminate</item>
<item name="android:progressDrawable">@drawable/bg_progress</item>
</style>
</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