Commit 52c48c55 by wjg

add update

parent 6249ed85
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
tools:replace="android:allowBackup,android:icon"> tools:replace="android:allowBackup,android:icon">
<activity <activity
android:name=".view.LauncherActivity" android:name=".home.view.LauncherActivity"
android:exported="true" android:exported="true"
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="landscape" android:screenOrientation="landscape"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".view.SettingsActivity" android:name=".setting.view.SettingsActivity"
android:exported="true" android:exported="true"
android:label="@string/app_name" android:label="@string/app_name"
android:screenOrientation="landscape" /> android:screenOrientation="landscape" />
......
...@@ -3,13 +3,15 @@ package com.ihaoin.hooloo.device; ...@@ -3,13 +3,15 @@ package com.ihaoin.hooloo.device;
import android.app.Application; import android.app.Application;
import android.graphics.Typeface; import android.graphics.Typeface;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.update.UpdateSocket;
import com.ihaoin.hooloo.device.data.MainData; import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.TrolleyGoods; import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.PresentState; import com.ihaoin.hooloo.device.data.enums.PresentState;
import com.ihaoin.hooloo.device.data.vo.Category; import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.Utils;
import com.umeng.commonsdk.UMConfigure; import com.umeng.commonsdk.UMConfigure;
import java.lang.reflect.Field; import java.lang.reflect.Field;
...@@ -21,6 +23,8 @@ import cn.jpush.android.api.JPushInterface; ...@@ -21,6 +23,8 @@ import cn.jpush.android.api.JPushInterface;
public class HLApplication extends Application { public class HLApplication extends Application {
public static HLApplication SELF = null; public static HLApplication SELF = null;
public static String RECOGNIZE_PERSON = "";
private UpdateSocket updateSocket = null;
@Override @Override
public void onCreate() { public void onCreate() {
...@@ -37,6 +41,28 @@ public class HLApplication extends Application { ...@@ -37,6 +41,28 @@ public class HLApplication extends Application {
AppConfig.REGISTRATION_ID = JPushInterface.getRegistrationID(this); AppConfig.REGISTRATION_ID = JPushInterface.getRegistrationID(this);
HttpUtil.postRegistrationId(); HttpUtil.postRegistrationId();
startUpdateSocket();
}
@Override
public void onTerminate() {
super.onTerminate();
Utils.i("Application onTerminate");
stopUpdateSocket();
}
private void startUpdateSocket() {
updateSocket = new UpdateSocket(this);
updateSocket.start();
}
private void stopUpdateSocket() {
if (updateSocket != null) {
updateSocket.close();
updateSocket = null;
}
} }
private void setDefaultTypeface() { private void setDefaultTypeface() {
......
package com.ihaoin.hooloo.device.config; package com.ihaoin.hooloo.device.base;
import com.ihaoin.hooloo.device.data.enums.PresentState; import com.ihaoin.hooloo.device.data.enums.PresentState;
......
package com.ihaoin.hooloo.device.config; package com.ihaoin.hooloo.device.base;
public class Base { public class Base {
public static final Integer TRUE = 1; public static final Integer TRUE = 1;
public static final Integer FALSE = 0; public static final Integer FALSE = 0;
public static final Integer DELETE = 2; public static final Integer DELETE = 2;
private static final String SOCKET_HOST = "http://192.168.1.155:8000";
public static final String NSP_UPGRADE = SOCKET_HOST + "/upgrade";
public static final String NSP_KDS = SOCKET_HOST + "/kds";
public static final String NSP_INTERACTION = SOCKET_HOST + "/interaction";
public static final String NSP_MACHINE = SOCKET_HOST + "/getMachineInfo";
public static final String PUSH_DEFAULT_EXTRA = "PUSH_DEFAULT_EXTRA"; public static final String PUSH_DEFAULT_EXTRA = "PUSH_DEFAULT_EXTRA";
public static final String PUSH_ACTION_ORDER_STATE_CHANGED = "ORDER_STATE_CHANGED"; public static final String PUSH_ACTION_ORDER_STATE_CHANGED = "ORDER_STATE_CHANGED";
public static final String PUSH_ACTION_SKU_STATE_CHANGED = "SKU_STATE_CHANGED"; public static final String PUSH_ACTION_SKU_STATE_CHANGED = "SKU_STATE_CHANGED";
......
package com.ihaoin.hooloo.device.network; package com.ihaoin.hooloo.device.base;
public class BizException extends RuntimeException { public class BizException extends RuntimeException {
public BizException(String msg) { public BizException(String msg) {
......
package com.ihaoin.hooloo.device.component; package com.ihaoin.hooloo.device.base;
import android.content.Context; import android.content.Context;
import com.ihaoin.hooloo.device.config.Base;
import com.ihaoin.hooloo.device.data.vo.MachineInfoMsg; import com.ihaoin.hooloo.device.data.vo.MachineInfoMsg;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
...@@ -18,9 +17,6 @@ import io.socket.client.Socket; ...@@ -18,9 +17,6 @@ import io.socket.client.Socket;
public class MachineInfoSocket extends Thread { public class MachineInfoSocket extends Thread {
private Context mContext; private Context mContext;
private Socket mSocket; private Socket mSocket;
private static final String mUrl = "localhost:8000";
private static final String mNamespace = "getMachineInfo";
private String tag = "[HL_CLIENT]";
public MachineInfoSocket(Context context) { public MachineInfoSocket(Context context) {
this.mContext = context; this.mContext = context;
...@@ -33,7 +29,8 @@ public class MachineInfoSocket extends Thread { ...@@ -33,7 +29,8 @@ public class MachineInfoSocket extends Thread {
private void connectSocket() { private void connectSocket() {
try { try {
mSocket = IO.socket(mUrl + "/" + mNamespace); mSocket = IO.socket(Base.NSP_MACHINE);
mSocket.connect();
} catch (Exception e) { } catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage()); Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
......
...@@ -5,7 +5,7 @@ import android.content.Intent; ...@@ -5,7 +5,7 @@ import android.content.Intent;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.HLApplication; import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils; import com.ihaoin.hooloo.device.util.StringUtils;
......
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.List;
public class InteractionMsg implements Serializable { public class InteractionMsg implements Serializable {
/** /**
...@@ -15,20 +16,32 @@ public class InteractionMsg implements Serializable { ...@@ -15,20 +16,32 @@ public class InteractionMsg implements Serializable {
/** 交互屏状态描述 */ /** 交互屏状态描述 */
private String stateDesc; private String stateDesc;
/** 内容文案 */ /** 生成的文字 */
private String sentence; private List<Sentence> sentences;
/** 生成的IP形象图片地址 */
private String picture;
/** 生成的背景图片地址 */ /** 生成的背景图片地址 */
private String background; private String background;
/** 背景图片描述 */ /** 背景图片地址描述 */
private String backgroundDesc; private String backgroundDesc;
/** 生成的IP形象图片地址 */ /** 推荐的商品 */
private String picture; private String recommendGoods;
/** 推荐的商品icon */
private String goodsIcon;
/** 推荐的商品的描述 */
private String recommendSentence;
/** 转场动画图片地址 */
private String cutToPicture;
/** 生成的头像地址 */ /** 识别到的人脸特征标识 */
private String avatar; private String recognizePerson;
public Integer getState() { public Integer getState() {
return state; return state;
...@@ -46,12 +59,20 @@ public class InteractionMsg implements Serializable { ...@@ -46,12 +59,20 @@ public class InteractionMsg implements Serializable {
this.stateDesc = stateDesc; this.stateDesc = stateDesc;
} }
public String getSentence() { public List<Sentence> getSentences() {
return sentence; return sentences;
} }
public void setSentence(String sentence) { public void setSentences(List<Sentence> sentences) {
this.sentence = sentence; this.sentences = sentences;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
} }
public String getBackground() { public String getBackground() {
...@@ -70,19 +91,43 @@ public class InteractionMsg implements Serializable { ...@@ -70,19 +91,43 @@ public class InteractionMsg implements Serializable {
this.backgroundDesc = backgroundDesc; this.backgroundDesc = backgroundDesc;
} }
public String getPicture() { public String getRecommendGoods() {
return picture; return recommendGoods;
} }
public void setPicture(String picture) { public void setRecommendGoods(String recommendGoods) {
this.picture = picture; this.recommendGoods = recommendGoods;
}
public String getGoodsIcon() {
return goodsIcon;
}
public void setGoodsIcon(String goodsIcon) {
this.goodsIcon = goodsIcon;
}
public String getRecommendSentence() {
return recommendSentence;
}
public void setRecommendSentence(String recommendSentence) {
this.recommendSentence = recommendSentence;
}
public String getCutToPicture() {
return cutToPicture;
}
public void setCutToPicture(String cutToPicture) {
this.cutToPicture = cutToPicture;
} }
public String getAvatar() { public String getRecognizePerson() {
return avatar; return recognizePerson;
} }
public void setAvatar(String avatar) { public void setRecognizePerson(String recognizePerson) {
this.avatar = avatar; this.recognizePerson = recognizePerson;
} }
} }
...@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable; import java.io.Serializable;
public class KDSOrder implements Serializable { public class KDSOrder implements Serializable {
@JsonProperty("order_num") @JsonProperty("orderNum")
private String orderNumber; private String orderNumber;
@JsonProperty("percent") @JsonProperty("percent")
......
package com.ihaoin.hooloo.device.data.vo;
import java.io.Serializable;
public class Sentence implements Serializable {
/** 顺序 */
private Integer turn;
/** 字号 */
private Integer fontSize;
/** 文字 */
private String sentence;
public Integer getTurn() {
return turn;
}
public void setTurn(Integer turn) {
this.turn = turn;
}
public Integer getFontSize() {
return fontSize;
}
public void setFontSize(Integer fontSize) {
this.fontSize = fontSize;
}
public String getSentence() {
return sentence;
}
public void setSentence(String sentence) {
this.sentence = sentence;
}
}
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.home.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.Paint; import android.graphics.Paint;
...@@ -13,7 +13,7 @@ import android.widget.TextView; ...@@ -13,7 +13,7 @@ import android.widget.TextView;
import com.chad.library.adapter.base.BaseSectionQuickAdapter; import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.ScrollBean; import com.ihaoin.hooloo.device.data.ScrollBean;
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;
...@@ -39,6 +39,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo ...@@ -39,6 +39,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
protected void convert(BaseViewHolder helper, ScrollBean item) { protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t; ScrollBean.ScrollItemBean t = item.t;
ViewGroup layoutItem = helper.getView(R.id.layout_item); ViewGroup layoutItem = helper.getView(R.id.layout_item);
layoutItem.setForeground(null);
Goods goods = (Goods) t.getObject(); Goods goods = (Goods) t.getObject();
helper.setText(R.id.txt_name, goods.getName()); helper.setText(R.id.txt_name, goods.getName());
......
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.home.adapter;
import android.content.Context; import android.content.Context;
import android.view.LayoutInflater; import android.view.LayoutInflater;
......
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.home.adapter;
import android.content.Context; import android.content.Context;
import android.view.View; import android.view.View;
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.home.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
...@@ -12,7 +12,8 @@ import android.widget.TextView; ...@@ -12,7 +12,8 @@ import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.home.view.LauncherActivity;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
public class ClearDialog extends Dialog { public class ClearDialog extends Dialog {
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.home.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
...@@ -23,20 +23,23 @@ import com.google.zxing.EncodeHintType; ...@@ -23,20 +23,23 @@ import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter; import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException; import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix; import com.google.zxing.common.BitMatrix;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.component.NetworkHandler; import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.TrolleyGoods; import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.po.ConfirmGoods; import com.ihaoin.hooloo.device.data.po.ConfirmGoods;
import com.ihaoin.hooloo.device.data.po.ConfirmOrder; import com.ihaoin.hooloo.device.data.po.ConfirmOrder;
import com.ihaoin.hooloo.device.data.vo.Goods; import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.Sku; import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.home.view.LauncherActivity;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.RandomUtils; import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils; import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -285,6 +288,9 @@ public class ConfirmOrderDialog extends Dialog { ...@@ -285,6 +288,9 @@ public class ConfirmOrderDialog extends Dialog {
private Bitmap genQRCode(String saveCode) throws WriterException { private Bitmap genQRCode(String saveCode) throws WriterException {
String url = String.format(AppConfig.WX_URL, saveCode); String url = String.format(AppConfig.WX_URL, saveCode);
if (!StringUtils.isEmpty(HLApplication.RECOGNIZE_PERSON)) {
url += "recognizePerson=" + HLApplication.RECOGNIZE_PERSON;
}
int width = Utils.dpToPx(getContext(), 800); // 图像宽度 int width = Utils.dpToPx(getContext(), 800); // 图像宽度
int height = Utils.dpToPx(getContext(), 800); // 图像高度 int height = Utils.dpToPx(getContext(), 800); // 图像高度
Map<EncodeHintType, Object> hints = new HashMap(); Map<EncodeHintType, Object> hints = new HashMap();
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.home.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
...@@ -29,15 +29,16 @@ import com.ihaoin.hooloo.device.HLApplication; ...@@ -29,15 +29,16 @@ import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.component.AutoWrapLayout; import com.ihaoin.hooloo.device.component.AutoWrapLayout;
import com.ihaoin.hooloo.device.component.IntroViewPager; import com.ihaoin.hooloo.device.component.IntroViewPager;
import com.ihaoin.hooloo.device.component.NetworkHandler; import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.Base;
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.GoodsRule; import com.ihaoin.hooloo.device.data.vo.GoodsRule;
import com.ihaoin.hooloo.device.data.vo.Sku; import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.data.vo.SkuRule; import com.ihaoin.hooloo.device.data.vo.SkuRule;
import com.ihaoin.hooloo.device.data.vo.SkuStateChangedVo; import com.ihaoin.hooloo.device.data.vo.SkuStateChangedVo;
import com.ihaoin.hooloo.device.home.view.LauncherActivity;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
...@@ -73,22 +74,13 @@ public class GoodsDetailDialog extends Dialog { ...@@ -73,22 +74,13 @@ public class GoodsDetailDialog extends Dialog {
private Button butnAdd; private Button butnAdd;
private Button butnBuy; private Button butnBuy;
private Button butnTrolley; private Button butnTrolley;
private View layoutOperate;
private View layoutButns;
private List<View> introViews; private List<View> introViews;
private List<Integer> availableRuleId;
public GoodsDetailDialog(@NonNull Context context, Goods goods) { public GoodsDetailDialog(@NonNull Context context, Goods goods) {
super(context); super(context);
this.mGoods = goods; this.mGoods = goods;
// this.mGoods.getSkus().forEach(sku -> sku.getRules().forEach(rule -> {
// if (rule.getRuleName().equals("热")) {
// sku.setIsDelete(2);
// }
// }));
// 处理售罄的SKU和规格选项 // 处理售罄的SKU和规格选项
processSelloutRules(); processSelloutRules();
...@@ -112,8 +104,6 @@ public class GoodsDetailDialog extends Dialog { ...@@ -112,8 +104,6 @@ public class GoodsDetailDialog extends Dialog {
} }
private void initViews() { private void initViews() {
layoutButns = findViewById(R.id.layout_butns);
layoutOperate = findViewById(R.id.layout_operate);
butnClose = findViewById(R.id.butn_close); butnClose = findViewById(R.id.butn_close);
introPager = findViewById(R.id.intro_pager); introPager = findViewById(R.id.intro_pager);
introIndicator = findViewById(R.id.intro_indicator); introIndicator = findViewById(R.id.intro_indicator);
...@@ -203,6 +193,8 @@ public class GoodsDetailDialog extends Dialog { ...@@ -203,6 +193,8 @@ public class GoodsDetailDialog extends Dialog {
txtName.setText(mGoods.getName()); txtName.setText(mGoods.getName());
butnSubtract.setOnClickListener(v -> subtractCount()); butnSubtract.setOnClickListener(v -> subtractCount());
butnAdd.setOnClickListener(v -> addCount()); butnAdd.setOnClickListener(v -> addCount());
butnSubtract.setForeground(null);
butnAdd.setForeground(null);
icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
...@@ -219,6 +211,8 @@ public class GoodsDetailDialog extends Dialog { ...@@ -219,6 +211,8 @@ public class GoodsDetailDialog extends Dialog {
// Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose)); // Utils.setTouchDelegate(findViewById(R.id.layout_root), Arrays.asList(butnClose));
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
// Utils.showToast(getContext(), "time: " + (System.currentTimeMillis() - Utils.times));
} }
OnDismissListener dismissListener = new OnDismissListener() { OnDismissListener dismissListener = new OnDismissListener() {
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.home.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
...@@ -16,7 +16,8 @@ import androidx.annotation.NonNull; ...@@ -16,7 +16,8 @@ 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.config.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.home.view.LauncherActivity;
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;
......
package com.ihaoin.hooloo.device.interaction;
import android.content.Context;
import com.ihaoin.hooloo.device.util.Utils;
import io.socket.client.Ack;
import io.socket.client.Socket;
import test.IAGen;
/** Linux通信 交互屏 */
public class InteractionSocket extends Thread {
private Context mContext;
private Socket mSocket;
public InteractionSocket(Context context) {
this.mContext = context;
}
@Override
public void run() {
connectSocket();
}
private void connectSocket() {
try {
// TODO test
Utils.sendInteractionMsgBroadcast(mContext, IAGen.getMsg1());
Thread.sleep(30 * 1000);
Utils.sendInteractionMsgBroadcast(mContext, IAGen.getMsg3());
Thread.sleep(30 * 1000);
Utils.sendInteractionMsgBroadcast(mContext, IAGen.getMsg2());
while (true) {
Thread.sleep(30 * 1000);
}
// mSocket = IO.socket(Base.NSP_INTERACTION);
// mSocket.connect();
// 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.interaction.view;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg;
import com.ihaoin.hooloo.device.data.vo.Sentence;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import java.util.Optional;
public class AnimView extends RelativeLayout {
private TextView line1;
private TextView line2;
private TextView line3;
private TextView recommend;
private ImageView goodsIcon;
private InteractionMsg mMsg = null;
public AnimView(Context context) {
this(context, null);
}
public AnimView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public AnimView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
protected void onAttachedToWindow() {
super.onAttachedToWindow();
initView();
}
private void initView() {
line1 = findViewById(R.id.txt_line_1);
line2 = findViewById(R.id.txt_line_2);
line3 = findViewById(R.id.txt_line_3);
recommend = findViewById(R.id.txt_recommend);
goodsIcon = findViewById(R.id.img_goods_icon);
}
public void setMsg(InteractionMsg msg) {
mMsg = msg;
if (mMsg == null) {
return;
}
Sentence s1 = getSentence(1);
Sentence s2 = getSentence(2);
Sentence s3 = getSentence(3);
if (s1 == null) {
line1.setText("");
} else {
line1.setText(s1.getSentence());
line1.setTextSize(s1.getFontSize());
}
if (s2 == null) {
line2.setText("");
} else {
line2.setText(s2.getSentence());
line2.setTextSize(s2.getFontSize());
}
if (s3 == null) {
line3.setText("");
} else {
line3.setText(s3.getSentence());
line3.setTextSize(s3.getFontSize());
}
if (StringUtils.isEmpty(mMsg.getRecommendGoods())) {
recommend.setText("");
goodsIcon.setImageDrawable(null);
} else {
recommend.setText(mMsg.getRecommendSentence());
Glide.with(this).load(mMsg.getGoodsIcon()).into(goodsIcon);
}
}
private Sentence getSentence(Integer num) {
if (mMsg == null) {
return null;
}
if (CollectionUtils.isEmpty(mMsg.getSentences())) {
return null;
}
Optional<Sentence> optional = mMsg.getSentences().stream().filter(x -> x.getTurn().equals(num)).findFirst();
return optional.orElse(null);
}
}
package com.ihaoin.hooloo.device.component; package com.ihaoin.hooloo.device.kds;
import android.content.Context; import android.content.Context;
import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.vo.KDSMsg; import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
...@@ -16,9 +17,6 @@ import io.socket.client.Socket; ...@@ -16,9 +17,6 @@ import io.socket.client.Socket;
public class KDSSocket extends Thread { public class KDSSocket extends Thread {
private Context mContext; private Context mContext;
private Socket mSocket; 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) { public KDSSocket(Context context) {
this.mContext = context; this.mContext = context;
...@@ -31,9 +29,15 @@ public class KDSSocket extends Thread { ...@@ -31,9 +29,15 @@ public class KDSSocket extends Thread {
private void connectSocket() { private void connectSocket() {
try { try {
// IO.Options opts = new IO.Options(); mSocket = IO.socket(Base.NSP_KDS);
// opts.query = "notice"; mSocket.connect();
mSocket = IO.socket(mUrl + "/" + mNamespace); mSocket.emit("notice", "test", (Ack) args -> {
if (CollectionUtils.isEmpty(args)) {
Utils.i("notice args empty");
return;
}
Utils.i("notice: " + args[0].toString());
});
mSocket.on("reply", args -> { mSocket.on("reply", args -> {
if (CollectionUtils.isEmpty(args)) { if (CollectionUtils.isEmpty(args)) {
Utils.i("reply args empty"); Utils.i("reply args empty");
......
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.kds.adapter;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
...@@ -18,7 +18,6 @@ public class MachineStateAdapter extends RecyclerView.Adapter<RecyclerView.ViewH ...@@ -18,7 +18,6 @@ public class MachineStateAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
private KDSMsg msg; private KDSMsg msg;
private LayoutInflater inflater; private LayoutInflater inflater;
public MachineStateAdapter(Context context, KDSMsg msg) { public MachineStateAdapter(Context context, KDSMsg msg) {
this.context = context; this.context = context;
this.msg = msg; this.msg = msg;
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.kds.view;
import android.animation.ValueAnimator; import android.animation.ValueAnimator;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Presentation; import android.app.Presentation;
import android.content.BroadcastReceiver; import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.graphics.drawable.AnimationDrawable; import android.graphics.drawable.AnimationDrawable;
...@@ -27,13 +26,13 @@ import androidx.recyclerview.widget.RecyclerView; ...@@ -27,13 +26,13 @@ import androidx.recyclerview.widget.RecyclerView;
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.MachineStateAdapter;
import com.ihaoin.hooloo.device.component.IntroViewPager; import com.ihaoin.hooloo.device.component.IntroViewPager;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.MainData; import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.vo.KDSMsg; import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.data.vo.KDSOrder; import com.ihaoin.hooloo.device.data.vo.KDSOrder;
import com.ihaoin.hooloo.device.test.KDSGen; import com.ihaoin.hooloo.device.kds.KDSSocket;
import com.ihaoin.hooloo.device.kds.adapter.MachineStateAdapter;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
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;
...@@ -54,6 +53,7 @@ public class MenuPresentation extends Presentation { ...@@ -54,6 +53,7 @@ public class MenuPresentation extends Presentation {
private List<View> progressViews = new ArrayList<>(); private List<View> progressViews = new ArrayList<>();
private List<TextView> waitingViews = new ArrayList<>(); private List<TextView> waitingViews = new ArrayList<>();
private List<TextView> completedViews = new ArrayList<>(); private List<TextView> completedViews = new ArrayList<>();
private KDSSocket kdsSocket = null;
public MenuPresentation(Context outerContext, Display display) { public MenuPresentation(Context outerContext, Display display) {
super(outerContext, display); super(outerContext, display);
...@@ -70,6 +70,7 @@ public class MenuPresentation extends Presentation { ...@@ -70,6 +70,7 @@ public class MenuPresentation extends Presentation {
setOnDismissListener(dismissListener); setOnDismissListener(dismissListener);
startImagePagerThread(); startImagePagerThread();
startSocket();
} }
private void initViews() { private void initViews() {
...@@ -118,7 +119,7 @@ public class MenuPresentation extends Presentation { ...@@ -118,7 +119,7 @@ public class MenuPresentation extends Presentation {
completedViews.add(findViewById(R.id.completed9)); completedViews.add(findViewById(R.id.completed9));
AnimationDrawable anim = (AnimationDrawable) getContext().getDrawable(R.drawable.menu_avatar); AnimationDrawable anim = (AnimationDrawable) getContext().getDrawable(R.drawable.menu_avatar);
imgAvatar.setImageDrawable(anim); imgAvatar.setBackground(anim);
anim.start(); anim.start();
} }
...@@ -146,6 +147,18 @@ public class MenuPresentation extends Presentation { ...@@ -146,6 +147,18 @@ public class MenuPresentation extends Presentation {
return image; return image;
} }
private void startSocket() {
kdsSocket = new KDSSocket(this.getContext());
kdsSocket.start();
}
private void stopSocket() {
if (kdsSocket != null) {
kdsSocket.close();
kdsSocket = null;
}
}
private ImagePagerThread imagePagerThread; private ImagePagerThread imagePagerThread;
private ImagePagerHandler imagePagerHandler; private ImagePagerHandler imagePagerHandler;
...@@ -158,10 +171,11 @@ public class MenuPresentation extends Presentation { ...@@ -158,10 +171,11 @@ public class MenuPresentation extends Presentation {
private class ImagePagerThread extends Thread { private class ImagePagerThread extends Thread {
@Override @Override
public void run() { public void run() {
KDSMsg msg = KDSGen.getKdsMsg();
Utils.sendKdsMsgBroadcast(getContext(), msg);
try { try {
while (true) { while (true) {
// KDSMsg msg = KDSGen.getKdsMsg();
// Utils.sendKdsMsgBroadcast(getContext(), msg);
Thread.sleep(1000 * 5); Thread.sleep(1000 * 5);
imagePagerHandler.sendEmptyMessage(1); imagePagerHandler.sendEmptyMessage(1);
} }
...@@ -249,12 +263,17 @@ public class MenuPresentation extends Presentation { ...@@ -249,12 +263,17 @@ public class MenuPresentation extends Presentation {
KDSOrder order = cookings.get(i); KDSOrder order = cookings.get(i);
View v = progressViews.get(i); View v = progressViews.get(i);
TextView orderNum = v.findViewById(R.id.txt_order_number); TextView orderNum = v.findViewById(R.id.txt_order_number);
ImageView bgProgress = v.findViewById(R.id.bg_progress);
View imgTmp = v.findViewById(R.id.img_tmp); View imgTmp = v.findViewById(R.id.img_tmp);
ImageView imgMask = v.findViewById(R.id.img_mask); ImageView imgMask = v.findViewById(R.id.img_mask);
TextView txtProgress = v.findViewById(R.id.txt_progress); TextView txtProgress = v.findViewById(R.id.txt_progress);
orderNum.setText(order.getOrderNumber()); orderNum.setText(order.getOrderNumber());
txtProgress.setText(order.getProgress() + "%"); txtProgress.setText(order.getProgress() + "%");
AnimationDrawable anim = (AnimationDrawable) getContext().getDrawable(R.drawable.anim_progress);
bgProgress.setBackground(anim);
anim.start();
LinearLayout.LayoutParams lpMask = (LinearLayout.LayoutParams) imgMask.getLayoutParams(); LinearLayout.LayoutParams lpMask = (LinearLayout.LayoutParams) imgMask.getLayoutParams();
LinearLayout.LayoutParams lpTemp = (LinearLayout.LayoutParams) imgTmp.getLayoutParams(); LinearLayout.LayoutParams lpTemp = (LinearLayout.LayoutParams) imgTmp.getLayoutParams();
...@@ -277,21 +296,20 @@ public class MenuPresentation extends Presentation { ...@@ -277,21 +296,20 @@ public class MenuPresentation extends Presentation {
} }
} }
OnDismissListener dismissListener = new OnDismissListener() { OnDismissListener dismissListener = dialog -> {
@Override Utils.i("menu present dismiss");
public void onDismiss(DialogInterface dialog) { unregistKDSMessageReceiver();
Utils.i("menu present dismiss");
unregistKDSMessageReceiver();
if (imagePagerHandler != null) { if (imagePagerHandler != null) {
imagePagerHandler.removeCallbacksAndMessages(null); imagePagerHandler.removeCallbacksAndMessages(null);
imagePagerHandler = null; imagePagerHandler = null;
} }
if (imagePagerThread != null) { if (imagePagerThread != null) {
imagePagerThread.interrupt(); imagePagerThread.interrupt();
imagePagerThread = null; imagePagerThread = null;
}
} }
stopSocket();
}; };
private KDSMessageReceiver mKDSMessageReceiver = null; private KDSMessageReceiver mKDSMessageReceiver = null;
......
package com.ihaoin.hooloo.device.network; package com.ihaoin.hooloo.device.network;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
public class HttpParams { public class HttpParams {
/** 首页获取数据 */ /** 首页获取数据 */
......
...@@ -6,8 +6,9 @@ import android.os.Handler; ...@@ -6,8 +6,9 @@ import android.os.Handler;
import android.os.Message; import android.os.Message;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.base.BizException;
import com.ihaoin.hooloo.device.HLApplication; import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.data.po.CheckUpdate; import com.ihaoin.hooloo.device.data.po.CheckUpdate;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils; import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
......
package com.ihaoin.hooloo.device.component; package com.ihaoin.hooloo.device.network;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
/** /**
......
package com.ihaoin.hooloo.device.component; package com.ihaoin.hooloo.device.setting;
import android.content.Context; import android.content.Context;
import android.view.View; import android.view.View;
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.setting.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.setting.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.setting.view;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
...@@ -11,8 +11,9 @@ import android.widget.TextView; ...@@ -11,8 +11,9 @@ import android.widget.TextView;
import android.widget.ToggleButton; import android.widget.ToggleButton;
import com.ihaoin.hooloo.device.R; import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.enums.PresentState; import com.ihaoin.hooloo.device.data.enums.PresentState;
import com.ihaoin.hooloo.device.home.view.LauncherActivity;
import com.ihaoin.hooloo.device.util.SharedPreferencesUtils; import com.ihaoin.hooloo.device.util.SharedPreferencesUtils;
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;
......
package com.ihaoin.hooloo.device.adapter; package com.ihaoin.hooloo.device.trolley.adapter;
import android.content.Context; import android.content.Context;
import android.graphics.Paint; import android.graphics.Paint;
...@@ -16,10 +16,10 @@ import com.ihaoin.hooloo.device.R; ...@@ -16,10 +16,10 @@ import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.data.TrolleyGoods; import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.vo.Goods; import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.Sku; import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.trolley.view.TrolleyView;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.StringAppend; import com.ihaoin.hooloo.device.util.StringAppend;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
import com.ihaoin.hooloo.device.view.TrolleyView;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
......
package com.ihaoin.hooloo.device.view; package com.ihaoin.hooloo.device.trolley.view;
import android.content.Context; import android.content.Context;
import android.graphics.Typeface; import android.graphics.Typeface;
...@@ -19,15 +19,15 @@ import androidx.annotation.NonNull; ...@@ -19,15 +19,15 @@ import androidx.annotation.NonNull;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
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.TrolleyAdapter; import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.component.NetworkHandler;
import com.ihaoin.hooloo.device.component.Rotate3dAnimation; import com.ihaoin.hooloo.device.component.Rotate3dAnimation;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.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.Sku; import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.trolley.adapter.TrolleyAdapter;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.RandomUtils; import com.ihaoin.hooloo.device.util.RandomUtils;
import com.ihaoin.hooloo.device.util.Utils; import com.ihaoin.hooloo.device.util.Utils;
......
package com.ihaoin.hooloo.device.component; package com.ihaoin.hooloo.device.update;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
...@@ -9,10 +9,10 @@ import android.os.Message; ...@@ -9,10 +9,10 @@ import android.os.Message;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication; import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.data.vo.CheckUpdateVo; import com.ihaoin.hooloo.device.data.vo.CheckUpdateVo;
import com.ihaoin.hooloo.device.network.HttpUtil; import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.ApkUtils; import com.ihaoin.hooloo.device.util.ApkUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
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;
...@@ -55,16 +55,16 @@ public class UpdateService extends Thread { ...@@ -55,16 +55,16 @@ public class UpdateService extends Thread {
@Override @Override
public void handleMessage(@NonNull Message msg) { public void handleMessage(@NonNull Message msg) {
try { try {
// CheckUpdateVo updateVo = new CheckUpdateVo(); CheckUpdateVo updateVo = new CheckUpdateVo();
// updateVo.setUrl("https://testapi.pecktoy.com/files/upload_test/signed-v10.apk"); updateVo.setUrl("https://testapi.pecktoy.com/files/upload_test/signed-v10.apk");
// updateVo.setVersion("1.0.10"); updateVo.setVersion("1.0.10");
// updateVo.setVersionCode(10); updateVo.setVersionCode(10);
Object obj = msg.obj; // Object obj = msg.obj;
if (msg.what == 0 || obj == null) { // if (msg.what == 0 || obj == null) {
Utils.i("check update error"); // Utils.i("check update error");
return; // return;
} // }
CheckUpdateVo updateVo = JsonUtils.readValue(obj, CheckUpdateVo.class); // CheckUpdateVo updateVo = JsonUtils.readValue(obj, CheckUpdateVo.class);
if (updateVo.getVersionCode() == null || updateVo.getVersionCode() <= 0) { if (updateVo.getVersionCode() == null || updateVo.getVersionCode() <= 0) {
Utils.i("version code is null"); Utils.i("version code is null");
return; return;
......
package com.ihaoin.hooloo.device.component; package com.ihaoin.hooloo.device.update;
import android.content.Context; import android.content.Context;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg; import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.util.CollectionUtils; import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils; import com.ihaoin.hooloo.device.util.JsonUtils;
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.io.IOException;
import io.socket.client.Ack; import io.socket.client.Ack;
import io.socket.client.IO; import io.socket.client.IO;
import io.socket.client.Socket; import io.socket.client.Socket;
/** Linux通信 交互屏 */ /** Linux通信 检查更新 */
public class InteractionSocket extends Thread { public class UpdateSocket extends Thread {
private Context mContext; private Context mContext;
private Socket mSocket; 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) { public UpdateSocket(Context context) {
this.mContext = context; this.mContext = context;
} }
...@@ -31,26 +31,11 @@ public class InteractionSocket extends Thread { ...@@ -31,26 +31,11 @@ public class InteractionSocket extends Thread {
private void connectSocket() { private void connectSocket() {
try { try {
// IO.Options opts = new IO.Options(); mSocket = IO.socket(Base.NSP_UPGRADE);
// opts.query = "notice"; mSocket.connect();
mSocket = IO.socket(mUrl + "/" + mNamespace); mSocket.on("upgrade", args -> process("upgrade", args));
mSocket.on("reply", args -> {
if (CollectionUtils.isEmpty(args)) { checkUpdate();
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) { } catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage()); Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
...@@ -70,18 +55,40 @@ public class InteractionSocket extends Thread { ...@@ -70,18 +55,40 @@ public class InteractionSocket extends Thread {
} }
} }
public void sendMessage(String content) { public void checkUpdate() {
if (mSocket == null) { if (mSocket == null) {
Utils.i("socket未连接"); Utils.i("socket未连接");
return; return;
} }
try { try {
mSocket.emit("notice", content, (Ack) args -> { mSocket.emit("state", "", (Ack) args -> process("state", args));
});
} catch (Exception e) { } catch (Exception e) {
Utils.i("发送消息失败,错误原因:" + e.getMessage()); Utils.i("发送消息失败,错误原因:" + e.getMessage());
e.printStackTrace(); e.printStackTrace();
} }
} }
private void process(String func, Object[] args) {
if (CollectionUtils.isEmpty(args)) {
Utils.i(func + " args empty");
return;
}
String content = args[0].toString();
if (StringUtils.isEmpty(content)) {
Utils.i(func + " content empty");
return;
}
try {
JsonNode node = JsonUtils.getMapper().readValue(content, JsonNode.class);
if (node == null) {
Utils.i(func + " msg empty");
return;
}
if (node.get("upgrade") != null && node.get("upgrade").asBoolean()) {
new UpdateService().start();
}
} catch (IOException e) {
e.printStackTrace();
}
}
} }
...@@ -3,7 +3,7 @@ package com.ihaoin.hooloo.device.util; ...@@ -3,7 +3,7 @@ package com.ihaoin.hooloo.device.util;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
public class SharedPreferencesUtils { public class SharedPreferencesUtils {
private final static String KEY_SEETINGS = "settings"; private final static String KEY_SEETINGS = "settings";
......
package com.ihaoin.hooloo.device.util; package com.ihaoin.hooloo.device.util;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
...@@ -16,8 +14,6 @@ import android.view.LayoutInflater; ...@@ -16,8 +14,6 @@ import android.view.LayoutInflater;
import android.view.TouchDelegate; import android.view.TouchDelegate;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.RadioGroup; import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
...@@ -30,21 +26,21 @@ import com.bumptech.glide.request.RequestOptions; ...@@ -30,21 +26,21 @@ import com.bumptech.glide.request.RequestOptions;
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.component.TouchDelegateComposite; import com.ihaoin.hooloo.device.component.TouchDelegateComposite;
import com.ihaoin.hooloo.device.config.AppConfig; import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.config.Base; import com.ihaoin.hooloo.device.base.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.InteractionMsg;
import com.ihaoin.hooloo.device.data.vo.KDSMsg; 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.home.dialog.ClearDialog;
import com.ihaoin.hooloo.device.view.ConfirmOrderDialog; import com.ihaoin.hooloo.device.home.dialog.ConfirmOrderDialog;
import com.ihaoin.hooloo.device.view.GoodsDetailDialog; import com.ihaoin.hooloo.device.home.dialog.GoodsDetailDialog;
import com.ihaoin.hooloo.device.view.PwdDialog; import com.ihaoin.hooloo.device.setting.dialog.PwdDialog;
import com.ihaoin.hooloo.device.view.SettingsActivity; import com.ihaoin.hooloo.device.setting.view.SettingsActivity;
import com.ihaoin.hooloo.device.view.TestDialog; import com.ihaoin.hooloo.device.setting.dialog.TestDialog;
import com.ihaoin.hooloo.device.view.TipsDialog; import com.ihaoin.hooloo.device.home.dialog.TipsDialog;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
...@@ -113,9 +109,11 @@ public class Utils { ...@@ -113,9 +109,11 @@ public class Utils {
} }
public static void showGoodsDetail(Context context, Goods goods) { public static void showGoodsDetail(Context context, Goods goods) {
// times = System.currentTimeMillis();
GoodsDetailDialog dialog = new GoodsDetailDialog(context, goods); GoodsDetailDialog dialog = new GoodsDetailDialog(context, goods);
dialog.show(); dialog.show();
} }
// public static Long times;
public static void showTips(Context context) { public static void showTips(Context context) {
TipsDialog dialog = new TipsDialog(context); TipsDialog dialog = new TipsDialog(context);
......
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);
registInteractionReceiver();
}
private void initViews() {
}
OnDismissListener dismissListener = new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
Utils.i("interaction present dismiss");
unregistInteractionReceiver();
}
};
InteractionReceiver interactionReceiver = null;
private void registInteractionReceiver() {
interactionReceiver = new InteractionReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Base.BROADCAST_ACTION_INTERACTION_INFO);
getContext().registerReceiver(interactionReceiver, filter);
}
private void unregistInteractionReceiver() {
if (interactionReceiver != null) {
getContext().unregisterReceiver(interactionReceiver);
interactionReceiver = null;
}
}
class InteractionReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
}
}
}
package test;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg;
import com.ihaoin.hooloo.device.data.vo.Sentence;
import java.util.Arrays;
import java.util.Random;
public class IAGen {
public static InteractionMsg getMsg() {
Integer num = getRandom(1, 4);
if (num == 1) {
return getMsg1();
} else if (num == 2) {
return getMsg2();
} else {
return getMsg3();
}
}
public static InteractionMsg getMsg1() {
InteractionMsg msg = new InteractionMsg();
msg.setBackground("https://img.zcool.cn/community/013f8b57bad91f0000018c1bc90051.gif"); // 背景图
msg.setPicture("https://testapi.pecktoy.com/files/upload_test/1.gif"); // 显示图
Sentence s1 = new Sentence();
s1.setTurn(1);
s1.setFontSize(80);
s1.setSentence("小哥哥你好");
Sentence s2 = new Sentence();
s2.setTurn(2);
s2.setFontSize(40);
s2.setSentence("HELLO");
Sentence s3 = new Sentence();
s3.setTurn(3);
s3.setFontSize(40);
s3.setSentence("不常来看我真可恶但你永远可爱\n手表好有个性");
msg.setSentences(Arrays.asList(s1, s2, s3));
msg.setRecommendGoods("经典美式");
msg.setRecommendSentence("来杯经典美式,补充原动力吧希望给你带来好心情");
msg.setGoodsIcon("https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/08/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%BC%A9%E7%95%A5%E5%9B%BE-%E7%BE%8E%E5%BC%8F.png");
return msg;
}
public static InteractionMsg getMsg2() {
InteractionMsg msg = new InteractionMsg();
msg.setBackground("https://img.zcool.cn/community/01ca285a71ac1da801213466b41ec4.jpg"); //背景图
msg.setCutToPicture("https://testapi.pecktoy.com/files/upload_test/2.gif"); // 过渡图
msg.setPicture("https://testapi.pecktoy.com/files/upload_test/1.gif"); // 显示图
Sentence s1 = new Sentence();
s1.setTurn(1);
s1.setFontSize(80);
s1.setSentence("小姑娘你好");
Sentence s2 = new Sentence();
s2.setTurn(2);
s2.setFontSize(40);
s2.setSentence("HELLO");
Sentence s3 = new Sentence();
s3.setTurn(3);
s3.setFontSize(40);
s3.setSentence("不常来看我真可恶但你永远可爱\n手表好有个性");
msg.setSentences(Arrays.asList(s1, s2, s3));
msg.setRecommendGoods("经典美式");
msg.setRecommendSentence("来杯经典美式,补充原动力吧希望给你带来好心情");
msg.setGoodsIcon("https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/04/%E7%82%B9%E5%8D%95%E5%B1%8F%E5%86%85%E5%AE%B9%E5%9B%BE3.png");
return msg;
}
public static InteractionMsg getMsg3() {
InteractionMsg msg = new InteractionMsg();
msg.setBackground("https://img.zcool.cn/community/01b7265a07a15aa80121985c4408c0.gif"); //背景图
msg.setCutToPicture("https://testapi.pecktoy.com/files/upload_test/2.gif"); // 过渡图
msg.setPicture("https://testapi.pecktoy.com/files/upload_test/3.gif"); // 显示图
Sentence s1 = new Sentence();
s1.setTurn(1);
s1.setFontSize(40);
s1.setSentence("小姐姐你好");
Sentence s2 = new Sentence();
s2.setTurn(2);
s2.setFontSize(40);
s2.setSentence("HELLO");
Sentence s3 = new Sentence();
s3.setTurn(3);
s3.setFontSize(40);
s3.setSentence("不常来看我真可恶但你永远可爱\n手表好有个性");
msg.setSentences(Arrays.asList(s1, s2, s3));
// msg.setRecommendGoods("拿铁");
// msg.setRecommendSentence("来杯拿铁,补充原动力吧\n漂亮每一天");
// msg.setGoodsIcon("https://hooloo-saas-test.oss-cn-beijing.aliyuncs.com/hooloo/2022/07/08/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%BC%A9%E7%95%A5%E5%9B%BE-%E9%9D%92%E6%8F%90%E8%8C%89%E8%8E%89.png");
return msg;
}
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);
}
}
package com.ihaoin.hooloo.device.test; package test;
import com.ihaoin.hooloo.device.data.vo.KDSMsg; import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.data.vo.KDSOrder; import com.ihaoin.hooloo.device.data.vo.KDSOrder;
......
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:fromAlpha="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toAlpha="1" />
<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:fromAlpha="1"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toAlpha="0" />
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:fromXDelta="100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="0%p" />
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:fromXDelta="0%"
android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:toXDelta="-100%" />
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="40" android:drawable="@mipmap/jindutiao_00000"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00001"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00002"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00003"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00004"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00005"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00006"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00007"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00008"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00009"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00010"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00011"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00012"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00013"/>
<item android:duration="40" android:drawable="@mipmap/jindutiao_00014"/>
</animation-list>
\ No newline at end of file
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
android:id="@+id/rec_recommend" android:id="@+id/rec_recommend"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:descendantFocusability="afterDescendants" /> android:descendantFocusability="afterDescendants"
android:overScrollMode="never" />
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -39,7 +40,8 @@ ...@@ -39,7 +40,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@color/white"
android:descendantFocusability="afterDescendants" /> android:descendantFocusability="afterDescendants"
android:overScrollMode="never" />
<include layout="@layout/item_goods_category" /> <include layout="@layout/item_goods_category" />
</FrameLayout> </FrameLayout>
<ScrollView <ScrollView
...@@ -47,6 +49,7 @@ ...@@ -47,6 +49,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="0.09792" android:layout_weight="0.09792"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:overScrollMode="never"
android:scrollbars="none"> android:scrollbars="none">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -69,7 +72,7 @@ ...@@ -69,7 +72,7 @@
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>
<com.ihaoin.hooloo.device.view.TrolleyView <com.ihaoin.hooloo.device.trolley.view.TrolleyView
android:id="@+id/view_trolley" android:id="@+id/view_trolley"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:overScrollMode="never"
android:scrollbars="none"> android:scrollbars="none">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:descendantFocusability="afterDescendants"> android:descendantFocusability="afterDescendants"
android:overScrollMode="never">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -133,7 +134,6 @@ ...@@ -133,7 +134,6 @@
android:textSize="@dimen/ts_detail_price" /> android:textSize="@dimen/ts_detail_price" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_operate"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
...@@ -165,7 +165,6 @@ ...@@ -165,7 +165,6 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/layout_butns"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/goods_detail_butn_margin_top" android:layout_marginTop="@dimen/goods_detail_butn_margin_top"
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
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:paddingTop="@dimen/category_padding_top" android:paddingTop="@dimen/category_padding_top_noimg"
android:paddingBottom="@dimen/category_padding_bottom" android:paddingBottom="@dimen/category_padding_bottom_noimg"
android:text="123123"
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"?>
<com.ihaoin.hooloo.device.interaction.view.AnimView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/interaction_padding_left"
android:paddingTop="@dimen/interaction_padding_top"
android:paddingRight="@dimen/interaction_padding_right"
android:paddingBottom="@dimen/interaction_padding_bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/txt_line_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/ts_interaction_line1"
android:textStyle="bold" />
<TextView
android:id="@+id/txt_line_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/interaction_text_space"
android:singleLine="false"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/ts_interaction_line2" />
<TextView
android:id="@+id/txt_line_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/interaction_text_space"
android:singleLine="false"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/ts_interaction_line3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="bottom"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_recommend"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="false"
android:text=""
android:textColor="@color/black"
android:textSize="@dimen/ts_interaction_recommend_small" />
<ImageView
android:id="@+id/img_goods_icon"
android:layout_width="@dimen/interaction_goods_icon_width"
android:layout_height="@dimen/interaction_goods_icon_height"
android:scaleType="centerCrop" />
</LinearLayout>
</com.ihaoin.hooloo.device.interaction.view.AnimView>
\ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<RelativeLayout 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" 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="@dimen/ts_order_number_height"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/txt_order_number" android:id="@+id/txt_order_number"
...@@ -20,9 +21,10 @@ ...@@ -20,9 +21,10 @@
android:layout_toRightOf="@id/txt_order_number" android:layout_toRightOf="@id/txt_order_number"
android:layout_weight="1"> android:layout_weight="1">
<ImageView <ImageView
android:id="@+id/bg_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_centerVertical="true" android:layout_marginBottom="1px"
android:background="@mipmap/pro_progress" /> android:background="@mipmap/pro_progress" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -45,7 +47,6 @@ ...@@ -45,7 +47,6 @@
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_centerVertical="true"
android:background="@mipmap/pro_bg" /> android:background="@mipmap/pro_bg" />
</RelativeLayout> </RelativeLayout>
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
<RelativeLayout android:background="@color/black">
android:id="@+id/layout_background" <ImageView
android:id="@+id/img_background1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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 <ImageView
android:id="@+id/img_ip" android:id="@+id/img_background2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="match_parent"
android:scaleType="centerCrop" android:visibility="invisible" />
android:src="@mipmap/mm_049"
app:layout_constraintBottom_toBottomOf="parent" />
<LinearLayout <ImageView
android:id="@+id/img_foreground"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/view1"
layout="@layout/layout_interaction"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/view2"
layout="@layout/layout_interaction"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent" />
android:background="@color/white" </RelativeLayout>
android:gravity="center" \ No newline at end of file
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"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="@color/colorLogo">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -11,8 +10,7 @@ ...@@ -11,8 +10,7 @@
<com.ihaoin.hooloo.device.component.IntroViewPager <com.ihaoin.hooloo.device.component.IntroViewPager
android:id="@+id/image_pager" android:id="@+id/image_pager"
android:layout_width="@dimen/menu_left" android:layout_width="@dimen/menu_left"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:background="@color/black" />
<LinearLayout <LinearLayout
android:layout_width="@dimen/menu_right" android:layout_width="@dimen/menu_right"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -45,12 +43,14 @@ ...@@ -45,12 +43,14 @@
android:id="@+id/progress1" android:id="@+id/progress1"
layout="@layout/layout_progress" layout="@layout/layout_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical" />
<include <include
android:id="@+id/progress2" android:id="@+id/progress2"
layout="@layout/layout_progress" layout="@layout/layout_progress"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/txt_waiting" android:id="@+id/txt_waiting"
...@@ -68,7 +68,8 @@ ...@@ -68,7 +68,8 @@
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/waiting1" android:id="@+id/waiting1"
...@@ -97,7 +98,8 @@ ...@@ -97,7 +98,8 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/waiting4" android:id="@+id/waiting4"
...@@ -151,7 +153,8 @@ ...@@ -151,7 +153,8 @@
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/completed1" android:id="@+id/completed1"
...@@ -180,7 +183,8 @@ ...@@ -180,7 +183,8 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/completed4" android:id="@+id/completed4"
...@@ -209,7 +213,8 @@ ...@@ -209,7 +213,8 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/ts_order_number_height"
android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/completed7" android:id="@+id/completed7"
......
...@@ -64,7 +64,8 @@ ...@@ -64,7 +64,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/trolley_item_height" android:layout_height="@dimen/trolley_item_height"
android:descendantFocusability="afterDescendants" android:descendantFocusability="afterDescendants"
android:divider="@null" /> android:divider="@null"
android:overScrollMode="never" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
......
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
<dimen name="goods_price_margin">5px</dimen> <dimen name="goods_price_margin">5px</dimen>
<dimen name="category_padding_top">17px</dimen> <dimen name="category_padding_top">17px</dimen>
<dimen name="category_padding_bottom">32px</dimen> <dimen name="category_padding_bottom">32px</dimen>
<dimen name="category_padding_top_noimg">28px</dimen>
<dimen name="category_padding_bottom_noimg">33px</dimen>
<dimen name="category_padding_hor">35px</dimen> <dimen name="category_padding_hor">35px</dimen>
<dimen name="category_drawable_padding">10px</dimen> <dimen name="category_drawable_padding">10px</dimen>
<dimen name="category_drawable_width">100px</dimen> <dimen name="category_drawable_width">100px</dimen>
...@@ -138,6 +140,38 @@ ...@@ -138,6 +140,38 @@
<dimen name="confirm_order_text_one">62px</dimen> <dimen name="confirm_order_text_one">62px</dimen>
<dimen name="confirm_order_text_two">7px</dimen> <dimen name="confirm_order_text_two">7px</dimen>
<dimen name="interaction_padding_top">117px</dimen>
<dimen name="interaction_padding_left">75px</dimen>
<dimen name="interaction_padding_bottom">66px</dimen>
<dimen name="interaction_padding_right">58px</dimen>
<dimen name="interaction_text_space">40px</dimen>
<dimen name="interaction_recommend_margin">55px</dimen>
<dimen name="interaction_goods_icon_width">230px</dimen>
<dimen name="interaction_goods_icon_height">230px</dimen>
<dimen name="ts_interaction_line1">130px</dimen>
<dimen name="ts_interaction_line2">50px</dimen>
<dimen name="ts_interaction_line3">50px</dimen>
<dimen name="ts_interaction_recommend_small">60px</dimen>
<dimen name="ts_interaction_recommend_big">75px</dimen>
<!-- <dimen name="interaction_padding_top">234px</dimen>-->
<!-- <dimen name="interaction_padding_left">150px</dimen>-->
<!-- <dimen name="interaction_padding_bottom">132px</dimen>-->
<!-- <dimen name="interaction_padding_right">106px</dimen>-->
<!-- <dimen name="interaction_text_space">80px</dimen>-->
<!-- <dimen name="interaction_recommend_margin">115px</dimen>-->
<!-- <dimen name="interaction_goods_icon_width">470px</dimen>-->
<!-- <dimen name="interaction_goods_icon_height">470px</dimen>-->
<!-- <dimen name="ts_interaction_line1">260px</dimen>-->
<!-- <dimen name="ts_interaction_line2">100px</dimen>-->
<!-- <dimen name="ts_interaction_line3">100px</dimen>-->
<!-- <dimen name="ts_interaction_recommend_small">120px</dimen>-->
<!-- <dimen name="ts_interaction_recommend_big">150px</dimen>-->
<dimen name="ic_recommend">17px</dimen> <dimen name="ic_recommend">17px</dimen>
<dimen name="ic_clear_size">20px</dimen> <dimen name="ic_clear_size">20px</dimen>
<dimen name="ic_add_size">40px</dimen> <dimen name="ic_add_size">40px</dimen>
...@@ -188,6 +222,7 @@ ...@@ -188,6 +222,7 @@
<dimen name="ts_menu_subtitle">36px</dimen> <dimen name="ts_menu_subtitle">36px</dimen>
<dimen name="ts_menu_subtitle1">24px</dimen> <dimen name="ts_menu_subtitle1">24px</dimen>
<dimen name="ts_order_number">44px</dimen> <dimen name="ts_order_number">44px</dimen>
<dimen name="ts_order_number_height">66px</dimen>
<dimen name="ts_menu_state">36px</dimen> <dimen name="ts_menu_state">36px</dimen>
<dimen name="ts_setting_name">18sp</dimen> <dimen name="ts_setting_name">18sp</dimen>
<dimen name="ts_setting_desc">16sp</dimen> <dimen name="ts_setting_desc">16sp</dimen>
......
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