Commit cb3908f0 by wjg

add update

parent 0ef0f1f0
......@@ -10,8 +10,8 @@ android {
applicationId "com.ihaoin.hooloo.device"
minSdkVersion 26
targetSdkVersion 30
versionCode 1
versionName "1.0"
versionCode 10
versionName "1.0.10"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
......@@ -51,7 +51,8 @@ dependencies {
implementation 'com.kyleduo.switchbutton:library:2.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.github.bumptech.glide:glide:4.9.0'
// implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.github.bumptech.glide:glide:4.13.2'
implementation 'com.squareup.okhttp3:okhttp:3.5.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
......@@ -74,4 +75,5 @@ dependencies {
implementation 'com.umeng.umsdk:apm:1.6.2'// U-APM产品包依赖(必选)
implementation 'io.socket:socket.io-client:1.0.0'
implementation 'com.blankj:utilcode:1.28.6'
// debugImplementation 'com.github.getActivity:Logcat:10.6'
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.ihaoin.hooloo.device"
android:versionCode="2"
android:versionName="1.0.2">
package="com.ihaoin.hooloo.device">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
......@@ -27,12 +25,20 @@
android:extractNativeLibs="true"
android:icon="@mipmap/hooloo_launcher"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:requestLegacyExternalStorage="true"
android:sharedUserId="android.uid.system"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true"
tools:replace="android:allowBackup,android:icon">
<!-- 悬浮窗入口 -->
<meta-data
android:name="LogcatWindowEntrance"
android:value="true" />
<!-- 通知栏入口 -->
<meta-data
android:name="LogcatNotifyEntrance"
android:value="true" />
<activity
android:name=".home.view.LauncherActivity"
android:exported="true"
......
......@@ -4,7 +4,6 @@ import android.app.Application;
import android.graphics.Typeface;
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.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.PresentState;
......@@ -24,7 +23,6 @@ import cn.jpush.android.api.JPushInterface;
public class HLApplication extends Application {
public static HLApplication SELF = null;
public static String RECOGNIZE_PERSON = "";
private UpdateSocket updateSocket = null;
@Override
public void onCreate() {
......@@ -41,8 +39,6 @@ public class HLApplication extends Application {
AppConfig.REGISTRATION_ID = JPushInterface.getRegistrationID(this);
HttpUtil.postRegistrationId();
startUpdateSocket();
}
@Override
......@@ -50,19 +46,6 @@ public class HLApplication extends Application {
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() {
......@@ -89,14 +72,10 @@ public class HLApplication extends Application {
// 第一个点单屏默认显示交互屏
if (AppConfig.DEFAULT_SCREEN_NO.equals("1")) {
AppConfig.DEFAULT_PRESENT = PresentState.MENU.getName();
AppConfig.DEFAULT_PRESENT = PresentState.KDS.getName();
} else {
AppConfig.DEFAULT_PRESENT = PresentState.INTERACTION.getName();
}
// if (AppConfig.DEBUG) { // TODO delete
// return "SN0091290001";
// }
}
private static MainData mainData = new MainData();
......
......@@ -7,7 +7,7 @@ public class AppConfig {
/** 点单屏编码, 1-菜单屏,2-交互屏 */
public static String DEFAULT_SCREEN_NO = "1"; // TODO 编译点单屏编码
/** 副屏内容 */
public static String DEFAULT_PRESENT = PresentState.MENU.getName();
public static String DEFAULT_PRESENT = PresentState.KDS.getName();
public static String HL = "HL";
public static String TAG = HL + "_TEST";
......
......@@ -24,7 +24,7 @@ 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_PRESENT_CHANGED = "ACTION_MENU_STATE_CHANGED";
public static final String BROADCAST_ACTION_PRESENT_CHANGED = "ACTION_PRESENT_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";
......
......@@ -12,6 +12,7 @@ import com.ihaoin.hooloo.device.util.Utils;
import io.socket.client.Ack;
import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
/** Linux通信 获取机器编码 */
public class MachineInfoSocket extends Thread {
......@@ -31,18 +32,27 @@ public class MachineInfoSocket extends Thread {
try {
mSocket = IO.socket(Base.NSP_MACHINE);
mSocket.connect();
mSocket.on("connect", onConnect);
mSocket.on("disconnect", onDisconnect);
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
Emitter.Listener onConnect = args -> Utils.i("machine socket connected");
Emitter.Listener onDisconnect = args -> Utils.i("machine socket disconnected");
public void close() {
try {
Utils.i("close machine socket");
if (mSocket != null) {
mSocket.disconnect();
mSocket.close();
mSocket = null;
mSocket.off("connect", onConnect);
mSocket.off("disconnect", onDisconnect);
// mSocket.close();
// mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
......
......@@ -4,7 +4,7 @@ import com.ihaoin.hooloo.device.util.StringUtils;
public enum PresentState {
NONE("不显示"),
MENU("菜单屏"),
KDS("菜单屏"),
INTERACTION("交互屏");
private String name;
......
......@@ -39,7 +39,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
protected void convert(BaseViewHolder helper, ScrollBean item) {
ScrollBean.ScrollItemBean t = item.t;
ViewGroup layoutItem = helper.getView(R.id.layout_item);
layoutItem.setForeground(null);
// layoutItem.setForeground(null);
Goods goods = (Goods) t.getObject();
helper.setText(R.id.txt_name, goods.getName());
......@@ -67,12 +67,9 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
}
ImageView imgThumbnail = helper.getView(R.id.img_thumbnail);
// RoundedCorners roundedCorners = new RoundedCorners(5);
// RequestOptions options = RequestOptions.bitmapTransform(roundedCorners);
if (goods.getPics() == null) {
imgThumbnail.setImageDrawable(null);
} else {
// Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).apply(options).into(imgThumbnail);
Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).into(imgThumbnail);
}
......
......@@ -193,8 +193,8 @@ public class GoodsDetailDialog extends Dialog {
txtName.setText(mGoods.getName());
butnSubtract.setOnClickListener(v -> subtractCount());
butnAdd.setOnClickListener(v -> addCount());
butnSubtract.setForeground(null);
butnAdd.setForeground(null);
// butnSubtract.setForeground(null);
// butnAdd.setForeground(null);
icoPrice.setPaintFlags(icoPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
txtPrice.setPaintFlags(txtPrice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
......
......@@ -17,10 +17,14 @@ import android.os.Message;
import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowManager;
import android.view.animation.LinearInterpolator;
import android.widget.OverScroller;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.NonNull;
......@@ -33,14 +37,9 @@ import com.bumptech.glide.request.target.CustomTarget;
import com.bumptech.glide.request.transition.Transition;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.base.MachineInfoSocket;
import com.ihaoin.hooloo.device.home.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.home.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.setting.SettingsQueue;
import com.ihaoin.hooloo.device.update.UpdateService;
import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.base.MachineInfoSocket;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.ScrollBean;
import com.ihaoin.hooloo.device.data.enums.PresentState;
......@@ -50,16 +49,22 @@ import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.Recommend;
import com.ihaoin.hooloo.device.data.vo.Sku;
import com.ihaoin.hooloo.device.data.vo.SkuStateChangedVo;
import com.ihaoin.hooloo.device.home.adapter.GoodsAdapter;
import com.ihaoin.hooloo.device.home.adapter.RecommendAdapter;
import com.ihaoin.hooloo.device.interaction.view.InteractionPresentation;
import com.ihaoin.hooloo.device.kds.view.KdsPresentation;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.setting.SettingsQueue;
import com.ihaoin.hooloo.device.trolley.view.TrolleyView;
import com.ihaoin.hooloo.device.update.UpdateSocket;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
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.interaction.view.InteractionPresentation;
import com.ihaoin.hooloo.device.kds.view.MenuPresentation;
import com.ihaoin.hooloo.device.trolley.view.TrolleyView;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
......@@ -68,6 +73,7 @@ public class LauncherActivity extends Activity {
private GoodsChangeReceiver goodsChangeReceiver;
private TouchReceiver touchReceiver;
private ScrollView scrollCategory;
private RadioGroup groupCategory;
private RecyclerView recGoods;
private RecyclerView recRecommends;
......@@ -87,8 +93,8 @@ public class LauncherActivity extends Activity {
//记录商品当前可见的第一个item的position
private int first = 0;
private TrolleyView trolleyView;
private MenuPresentation menuView;
private InteractionPresentation presentView;
private KdsPresentation kdsView;
private InteractionPresentation interactionView;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -116,16 +122,17 @@ public class LauncherActivity extends Activity {
initSettingsQueue();
// startUpdateSocket();
startMachineClient();
startTimeoutThread();
getMachineCode();
new UpdateService().start();
// new UpdateService().start();
}
private void initViews() {
txtCategory = findViewById(R.id.txt_category);
trolleyView = findViewById(R.id.view_trolley);
scrollCategory = findViewById(R.id.scroll_category);
groupCategory = findViewById(R.id.group_category);
recGoods = findViewById(R.id.rec_right);
recRecommends = findViewById(R.id.rec_recommend);
......@@ -139,7 +146,7 @@ public class LauncherActivity extends Activity {
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
Utils.i("dispatchTouchEvent");
// Utils.i("dispatchTouchEvent");
TIMESTAMP = Utils.getTimestamp();
return super.dispatchTouchEvent(ev);
}
......@@ -274,6 +281,7 @@ public class LauncherActivity extends Activity {
break;
}
groupCategory.check(category.getId());
smoothTo(groupCategory.findViewById(groupCategory.getCheckedRadioButtonId()));
}
}
......@@ -283,6 +291,15 @@ public class LauncherActivity extends Activity {
}
}
});
try {
Field field = ScrollView.class.getDeclaredField("mScroller");
field.setAccessible(true);
OverScroller scroller = new OverScroller(this, new LinearInterpolator());
scroller.setFriction(50);
field.set(scrollCategory, scroller);
} catch (Exception e) {
e.printStackTrace();
}
}
/** 判断RecyclerView是否滚动到最下面 */
......@@ -315,10 +332,13 @@ public class LauncherActivity extends Activity {
butnRadio.setText(category.getName());
butnRadio.setId(category.getId());
butnRadio.setTag(category);
if (StringUtils.isEmpty(category.getIcon())) {
if (i == 0) {
butnRadio.setChecked(true);
butnRadio.getPaint().setFakeBoldText(true);
addLayoutListener(butnRadio);
}
} else {
int finalIndex = i;
Utils.getGlide(LauncherActivity.this).load(category.getIcon()).into(new CustomTarget<Drawable>() {
@Override
public void onResourceReady(@NonNull Drawable drawable, @Nullable Transition<? super Drawable> transition) {
......@@ -330,16 +350,19 @@ public class LauncherActivity extends Activity {
Integer right = left;
Integer bottom = Utils.getDimens(LauncherActivity.this, R.dimen.category_padding_bottom);
butnRadio.setPadding(left, top, right, bottom);
if (finalIndex == 0) {
addLayoutListener(butnRadio);
}
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});
}
groupCategory.addView(butnRadio, layoutParams);
butnRadio.setForeground(null);
// butnRadio.setForeground(null);
butnRadio.setOnClickListener(v -> {
Integer checkedId = v.getId();
Category tagCategory = (Category) groupCategory.findViewById(checkedId).getTag();
......@@ -350,20 +373,61 @@ public class LauncherActivity extends Activity {
}
groupCategory.setOnCheckedChangeListener((group, checkedId) -> {
for (int i = 0; i < groupCategory.getChildCount(); i++) {
View child = groupCategory.getChildAt(i);
if (!(child instanceof RadioButton)) {
continue;
}
RadioButton butn = (RadioButton) child;
if (butn.getId() == checkedId) {
butn.getPaint().setFakeBoldText(true);
RadioButton butnRadio = (RadioButton) groupCategory.getChildAt(i);
if (butnRadio.getId() == checkedId) {
setShadowView(butnRadio);
butnRadio.getPaint().setFakeBoldText(true);
} else {
butn.getPaint().setFakeBoldText(false);
butnRadio.getPaint().setFakeBoldText(false);
}
}
});
}
private void smoothTo(RadioButton butnRadio) {
scrollCategory.smoothScrollTo(0, getSmoothHeight(butnRadio));
}
private void addLayoutListener(RadioButton butnRadio) {
butnRadio.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
butnRadio.getViewTreeObserver().removeOnGlobalLayoutListener(this);
butnRadio.performClick();
}
});
}
private void setShadowView(View butnRadio) {
View shadow = findViewById(R.id.shadow);
RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) shadow.getLayoutParams();
lp.topMargin = getShadowHeight(butnRadio);
shadow.setLayoutParams(lp);
}
private int getShadowHeight(View butnRadio) {
return getHeight(butnRadio, true);
}
private int getSmoothHeight(View butnRadio) {
return getHeight(butnRadio, false);
}
private int getHeight(View butnRadio, boolean self) {
int height = Utils.getDimens(this, R.dimen.category_margin);
for (int i = 0; i < groupCategory.getChildCount(); i++) {
View v = groupCategory.getChildAt(i);
if (!self && v.getId() == butnRadio.getId()) {
return height;
}
height += v.getHeight();
if (v.getId() == butnRadio.getId()) {
return height;
}
}
return height;
}
private void setGoodsData() {
List<Category> categorys = HLApplication.getMainData().getCategorys();
if (CollectionUtils.isEmpty(categorys)) {
......@@ -440,8 +504,8 @@ public class LauncherActivity extends Activity {
setRecommendsData();
initCategorys();
setGoodsData();
if (menuView != null) {
menuView.mainDataChanged();
if (kdsView != null) {
kdsView.mainDataChanged();
}
}
......@@ -460,6 +524,7 @@ public class LauncherActivity extends Activity {
this.unregistTouchReceiver();
this.unregistHdmiReceiver();
stopMachineClient();
stopUpdateSocket();
System.exit(0);
}
......@@ -551,6 +616,7 @@ public class LauncherActivity extends Activity {
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_PRESENT_CHANGED)) {
preparePresentView();
} else if (intent.getAction().equals(Base.BROADCAST_ACTION_LOGCAT_STATE_CHANGED)) {
if (AppConfig.DEBUG) {
if (SharedPreferencesUtils.getShowLogcat(LauncherActivity.this)) {
Utils.showToast(LauncherActivity.this, "展示Logcat");
} else {
......@@ -559,20 +625,20 @@ public class LauncherActivity extends Activity {
}
}
}
}
/** 显示副屏内容 */
private boolean preparePresentView() {
PresentState present = PresentState.get(SharedPreferencesUtils.getPresentation(LauncherActivity.this));
switch (present) {
case MENU:
case KDS:
hideInteractionView();
return showMenuView();
return showKdsView();
case INTERACTION:
hideMenuView();
hideKdsView();
return showInteractionView();
default:
hideMenuView();
hideInteractionView();
hidePresentView();
return false;
}
// return true;
......@@ -581,7 +647,7 @@ public class LauncherActivity extends Activity {
/** 隐藏副屏内容 */
private void hidePresentView() {
hideInteractionView();
hideMenuView();
hideKdsView();
}
/** 显示交互屏 */
......@@ -589,17 +655,17 @@ public class LauncherActivity extends Activity {
if (AppConfig.DEBUG) {
Utils.showToast(this, "展示交互屏");
}
if (presentView != null) {
if (interactionView != null) {
return true;
}
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
Utils.showToast(this, "未获取到菜单屏硬件");
Utils.showToast(this, "未获取到扩展屏幕");
return false;
}
presentView = new InteractionPresentation(this, displays[1]);
presentView.show();
interactionView = new InteractionPresentation(this, displays[1]);
interactionView.show();
return true;
}
......@@ -608,46 +674,47 @@ public class LauncherActivity extends Activity {
if (AppConfig.DEBUG) {
Utils.showToast(this, "隐藏交互屏");
}
if (presentView == null) {
if (interactionView == null) {
return;
}
presentView.dismiss();
presentView = null;
interactionView.dismiss();
interactionView = null;
}
/** 显示菜单屏KDS */
private boolean showMenuView() {
private boolean showKdsView() {
if (AppConfig.DEBUG) {
Utils.showToast(this, "展示菜单屏");
}
if (menuView != null) {
if (kdsView != null) {
return true;
}
DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
Display[] displays = displayManager.getDisplays();
if (CollectionUtils.isEmpty(displays) || displays.length < 2) {
Utils.showToast(this, "未获取到菜单屏硬件");
Utils.showToast(this, "未获取到扩展屏幕");
return false;
}
menuView = new MenuPresentation(this, displays[1]);
menuView.show();
kdsView = new KdsPresentation(this, displays[1]);
kdsView.show();
return true;
}
private void hideMenuView() {
private void hideKdsView() {
if (AppConfig.DEBUG) {
Utils.showToast(this, "隐藏菜单屏");
}
if (menuView == null) {
if (kdsView == null) {
return;
}
menuView.dismiss();
menuView = null;
kdsView.dismiss();
kdsView = null;
}
private UpdateSocket updateSocket = null;
private MachineInfoSocket machineSocket = null;
private void startMachineClient() {
machineSocket = new MachineInfoSocket(this);
machineSocket.start();
......@@ -660,6 +727,18 @@ public class LauncherActivity extends Activity {
}
}
private void startUpdateSocket() {
updateSocket = new UpdateSocket(this);
updateSocket.start();
}
private void stopUpdateSocket() {
if (updateSocket != null) {
updateSocket.close();
updateSocket = null;
}
}
private void requestPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
requestPermissions(new String[]{Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 100);
......@@ -822,8 +901,10 @@ public class LauncherActivity extends Activity {
@Override
public void onReceive(Context context, Intent intent) {
boolean state = intent.getBooleanExtra("state", false);
if (AppConfig.DEBUG) {
Utils.showToast(LauncherActivity.this, "hdmi state: " + state);
// TODO test
}
// TODO TEST
// if (state) {
// new Handler().postDelayed(() -> preparePresentView(), 1000 * 5);
// } else {
......
......@@ -2,11 +2,17 @@ package com.ihaoin.hooloo.device.interaction;
import android.content.Context;
import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
import com.ihaoin.hooloo.device.util.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
import io.socket.client.Ack;
import io.socket.client.IO;
import io.socket.client.Socket;
import test.IAGen;
import io.socket.emitter.Emitter;
/** Linux通信 交互屏 */
public class InteractionSocket extends Thread {
......@@ -24,47 +30,68 @@ public class InteractionSocket extends Thread {
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;
// 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);
// }
// Utils.sendInteractionMsgBroadcast(mContext, msg);
// });
mSocket = IO.socket(Base.NSP_INTERACTION);
mSocket.connect();
mSocket.on("connect", onConnect);
mSocket.on("disconnect", onDisconnect);
mSocket.on("reply", onReply);
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
Emitter.Listener onConnect = args -> {
Utils.i("interaction socket connected");
mSocket.emit("notice", "test", (Ack) ack -> process("notice", ack));
};
Emitter.Listener onDisconnect = args -> Utils.i("interaction socket disconnected");
Emitter.Listener onReply = args -> {
Utils.i("interaction socket reply");
process("reply", args);
};
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;
}
InteractionMsg msg = JsonUtils.readValue(content, InteractionMsg.class);
if (msg == null) {
Utils.i(func + " msg empty");
return;
}
Utils.i(func + " receive msg: " + content);
Utils.sendInteractionMsgBroadcast(mContext, msg);
}
public void close() {
try {
Utils.i("close interaction socket");
if (mSocket != null) {
mSocket.disconnect();
mSocket.close();
mSocket = null;
mSocket.off("connect", onConnect);
mSocket.off("disconnect", onDisconnect);
mSocket.off("reply", onReply);
// mSocket.close();
// mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
......
......@@ -92,7 +92,7 @@ public class InteractionPresentation extends Presentation {
while (true) {
InteractionMsg msg = mMsgQueue.poll();
if (msg == null) {
Utils.i("msg is null");
// Utils.i("msg is null");
continue;
}
try {
......
......@@ -12,6 +12,7 @@ import com.ihaoin.hooloo.device.util.Utils;
import io.socket.client.Ack;
import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
/** Linux通信 KDS 菜单屏 */
public class KDSSocket extends Thread {
......@@ -31,14 +32,24 @@ public class KDSSocket extends Thread {
try {
mSocket = IO.socket(Base.NSP_KDS);
mSocket.connect();
mSocket.emit("notice", "test", (Ack) args -> {
if (CollectionUtils.isEmpty(args)) {
Utils.i("notice args empty");
return;
mSocket.on("connect", onConnect);
mSocket.on("disconnect", onDisconnect);
mSocket.on("reply", onReply);
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
Utils.i("notice: " + args[0].toString());
});
mSocket.on("reply", args -> {
}
Emitter.Listener onConnect = args -> {
Utils.i("kds socket connected");
mSocket.emit("notice", "test", (Ack) ack -> Utils.i("notice: " + JsonUtils.toString(ack)));
};
Emitter.Listener onDisconnect = args -> Utils.i("kds socket disconnected");
Emitter.Listener onReply = args -> {
Utils.i("kds socket reply");
if (CollectionUtils.isEmpty(args)) {
Utils.i("reply args empty");
return;
......@@ -54,19 +65,18 @@ public class KDSSocket extends Thread {
return;
}
Utils.sendKdsMsgBroadcast(mContext, msg);
});
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
};
public void close() {
try {
Utils.i("close kds socket");
if (mSocket != null) {
mSocket.disconnect();
mSocket.close();
mSocket = null;
mSocket.off("connect", onConnect);
mSocket.off("disconnect", onDisconnect);
mSocket.off("reply", onReply);
// mSocket.close();
// mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
......
......@@ -33,15 +33,15 @@ public class MachineStateAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
switch (viewType) {
case 0:
return new ViewHolder0(inflater.inflate(R.layout.menu_line_0, parent, false));
return new ViewHolder0(inflater.inflate(R.layout.kds_line_0, parent, false));
case 1:
return new ViewHolder1(inflater.inflate(R.layout.menu_line_1, parent, false));
return new ViewHolder1(inflater.inflate(R.layout.kds_line_1, parent, false));
case 2:
return new ViewHolder2(inflater.inflate(R.layout.menu_line_2, parent, false));
return new ViewHolder2(inflater.inflate(R.layout.kds_line_2, parent, false));
case 3:
return new ViewHolder3(inflater.inflate(R.layout.menu_line_3, parent, false));
return new ViewHolder3(inflater.inflate(R.layout.kds_line_3, parent, false));
case 4:
return new ViewHolder4(inflater.inflate(R.layout.menu_line_4, parent, false));
return new ViewHolder4(inflater.inflate(R.layout.kds_line_4, parent, false));
}
return null;
}
......
......@@ -32,7 +32,6 @@ import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.component.FixedSpeedScroller;
import com.ihaoin.hooloo.device.component.IntroViewPager;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.vo.Images;
import com.ihaoin.hooloo.device.data.vo.KDSMsg;
import com.ihaoin.hooloo.device.data.vo.KDSOrder;
import com.ihaoin.hooloo.device.kds.KDSSocket;
......@@ -43,10 +42,9 @@ import com.ihaoin.hooloo.device.util.Utils;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MenuPresentation extends Presentation {
public class KdsPresentation extends Presentation {
private KDSMsg mKdsMsg;
......@@ -61,14 +59,14 @@ public class MenuPresentation extends Presentation {
private List<TextView> completedViews = new ArrayList<>();
private KDSSocket kdsSocket = null;
public MenuPresentation(Context outerContext, Display display) {
public KdsPresentation(Context outerContext, Display display) {
super(outerContext, display);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.present_menu);
setContentView(R.layout.present_kds);
initViews();
registerKDSMessageReceiver();
......@@ -142,10 +140,10 @@ public class MenuPresentation extends Presentation {
private void showImages() {
MainData mainData = HLApplication.getMainData();
// TODO TEST
List<String> imgs = Arrays.asList("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", "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", "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");
Images img = new Images();
img.setLeft(imgs);
mainData.setImages(img);
// List<String> imgs = Arrays.asList("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", "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", "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");
// Images img = new Images();
// img.setLeft(imgs);
// mainData.setImages(img);
if (mainData == null || mainData.getImages() == null) {
return;
}
......@@ -164,6 +162,7 @@ public class MenuPresentation extends Presentation {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
image.setLayoutParams(layoutParams);
image.setAdjustViewBounds(true);
image.setScaleType(ImageView.ScaleType.CENTER_CROP);
Utils.getGlide(getContext()).load(url).into(image);
return image;
}
......@@ -318,7 +317,7 @@ public class MenuPresentation extends Presentation {
}
OnDismissListener dismissListener = dialog -> {
Utils.i("menu present dismiss");
Utils.i("kds present dismiss");
unregistKDSMessageReceiver();
if (imagePagerHandler != null) {
......
......@@ -88,7 +88,7 @@ public class SettingsActivity extends Activity {
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()};
String[] items = new String[]{PresentState.NONE.getName(), PresentState.KDS.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));
......
......@@ -80,7 +80,7 @@ public class UpdateService extends Thread {
PackageInfo packageInfo = Utils.getPackageInfo();
if (updateVo.getVersionCode() <= packageInfo.versionCode) {
Utils.i(String.format("dont update, current: %s, update: %s", packageInfo.versionCode, updateVo.getVersionCode()));
Utils.i(String.format("do not update, current: %s, update: %s", packageInfo.versionCode, updateVo.getVersionCode()));
return;
}
......
......@@ -14,6 +14,7 @@ import java.io.IOException;
import io.socket.client.Ack;
import io.socket.client.IO;
import io.socket.client.Socket;
import io.socket.emitter.Emitter;
/** Linux通信 检查更新 */
public class UpdateSocket extends Thread {
......@@ -33,21 +34,37 @@ public class UpdateSocket extends Thread {
try {
mSocket = IO.socket(Base.NSP_UPGRADE);
mSocket.connect();
mSocket.on("upgrade", args -> process("upgrade", args));
checkUpdate();
mSocket.on("connect", onConnect);
mSocket.on("disconnect", onDisconnect);
mSocket.on("upgrade", onUpgrade);
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
Emitter.Listener onConnect = args -> {
Utils.i("update socket connected");
mSocket.emit("state", "", (Ack) ack -> process("state", ack));
};
Emitter.Listener onDisconnect = args -> Utils.i("update socket disconnected");
Emitter.Listener onUpgrade = args -> {
Utils.i("update socket upgrade");
process("upgrade", args);
};
public void close() {
try {
Utils.i("close update socket");
if (mSocket != null) {
mSocket.disconnect();
mSocket.close();
mSocket = null;
mSocket.off("connect", onConnect);
mSocket.off("disconnect", onDisconnect);
mSocket.off("upgrade", onUpgrade);
// mSocket.close();
// mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
......@@ -55,19 +72,6 @@ public class UpdateSocket extends Thread {
}
}
public void checkUpdate() {
if (mSocket == null) {
Utils.i("socket未连接");
return;
}
try {
mSocket.emit("state", "", (Ack) args -> process("state", args));
} catch (Exception e) {
Utils.i("发送消息失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
private void process(String func, Object[] args) {
if (CollectionUtils.isEmpty(args)) {
Utils.i(func + " args empty");
......
......@@ -5,27 +5,27 @@
android:height="33dp"
android:viewportWidth="33"
android:viewportHeight="33">
<!-- <path-->
<!-- android:pathData="M0,0L0,33"-->
<!-- android:strokeWidth="0.5"-->
<!-- android:strokeColor="@color/line" />-->
<path
android:pathData="M0,0L0,33"
android:strokeWidth="0.5"
android:strokeColor="@color/line" />
<path
android:pathData="M1,0L1,30"
android:pathData="M1,0L1,33"
android:strokeWidth="3"
android:strokeColor="@color/colorPrimary" />
<path
android:pathData="M18,30L18,33"
android:strokeWidth="31"
android:strokeColor="#FFFFFFFF">
<aapt:attr name="android:fillColor">
<gradient
android:endColor="#22DDDDDD"
android:endX="18"
android:endY="30"
android:startColor="#00FFFFFF"
android:startX="18"
android:startY="33"
android:type="linear"></gradient>
</aapt:attr>
</path>
<!-- <path-->
<!-- android:pathData="M17,30L17,33"-->
<!-- android:strokeWidth="34"-->
<!-- android:strokeColor="#FFFFFFFF">-->
<!-- <aapt:attr name="android:fillColor">-->
<!-- <gradient-->
<!-- android:endColor="#22DDDDDD"-->
<!-- android:endX="18"-->
<!-- android:endY="30"-->
<!-- android:startColor="#00FFFFFF"-->
<!-- android:startX="18"-->
<!-- android:startY="33"-->
<!-- android:type="linear"></gradient>-->
<!-- </aapt:attr>-->
<!-- </path>-->
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="33dp"
android:height="33dp"
android:viewportWidth="33"
android:viewportHeight="33">
<path
android:pathData="M0,0L0,33"
android:strokeWidth="0.5"
android:strokeColor="@color/line" />
<path
android:pathData="M1,0L1,30"
android:strokeWidth="3"
android:strokeColor="@color/colorPrimary" />
<path
android:pathData="M18,30L18,33"
android:strokeWidth="31"
android:strokeColor="#FFFFFFFF">
<aapt:attr name="android:fillColor">
<gradient
android:endColor="#22DDDDDD"
android:endX="18"
android:endY="30"
android:startColor="#00FFFFFF"
android:startX="18"
android:startY="33"
android:type="linear"></gradient>
</aapt:attr>
</path>
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="33dp"
android:height="3dp"
android:viewportWidth="33"
android:viewportHeight="3">
<path
android:pathData="M17,0L17,3"
android:strokeWidth="34"
android:strokeColor="#FFFFFFFF">
<aapt:attr name="android:fillColor">
<gradient
android:endColor="#22DDDDDD"
android:endX="17"
android:endY="0"
android:startColor="#00FFFFFF"
android:startX="17"
android:startY="3"
android:type="linear" />
</aapt:attr>
</path>
</vector>
\ No newline at end of file
......@@ -45,17 +45,16 @@
<include layout="@layout/item_goods_category" />
</FrameLayout>
<ScrollView
android:id="@+id/scroll_category"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.09792"
android:descendantFocusability="afterDescendants"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
android:layout_height="wrap_content">
<RadioGroup
android:id="@+id/group_category"
android:layout_width="match_parent"
......@@ -67,8 +66,14 @@
<include
layout="@layout/item_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content"
android:layout_below="@+id/group_category" />
<ImageView
android:id="@+id/shadow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ic_label_shadow" />
</RelativeLayout>
</ScrollView>
</LinearLayout>
......@@ -76,4 +81,5 @@
android:id="@+id/view_trolley"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</FrameLayout>
\ No newline at end of file
......@@ -19,7 +19,7 @@
android:id="@+id/layout_test"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -41,7 +41,7 @@
android:id="@+id/layout_sys_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -63,7 +63,7 @@
android:id="@+id/layout_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -88,7 +88,7 @@
android:id="@+id/layout_machine_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -118,7 +118,7 @@
android:id="@+id/layout_screen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -148,7 +148,7 @@
android:id="@+id/layout_presentation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -178,7 +178,7 @@
android:id="@+id/layout_logcat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
......@@ -194,7 +194,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding10"
android:foreground="?selectableItemBackground" />
android:foreground="@null" />
</LinearLayout>
</LinearLayout>
</ScrollView>
......
......@@ -25,7 +25,7 @@
android:layout_height="@dimen/clear_butn_height"
android:layout_weight="1"
android:background="@drawable/bg_clear_yes"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:text="是"
android:textColor="@color/textPrimary"
android:textSize="@dimen/clear_butn_text" />
......@@ -35,7 +35,7 @@
android:layout_height="@dimen/clear_butn_height"
android:layout_weight="1"
android:background="@drawable/bg_clear_no"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:text="否"
android:textColor="@color/white"
android:textSize="@dimen/clear_butn_text" />
......
......@@ -3,7 +3,10 @@
android:id="@+id/layout_root"
android:layout_width="@dimen/confirm_order_width"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="@color/white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/confirm_order_padding_top"
android:paddingBottom="@dimen/confirm_order_padding_bottom">
<TextView
......@@ -94,7 +97,7 @@
android:layout_centerInParent="true"
android:background="@drawable/anim_qrcode_loading"
android:visibility="invisible" />
</RelativeLayout>
<FrameLayout
android:id="@+id/butn_close"
android:layout_width="wrap_content"
......
......@@ -144,7 +144,7 @@
android:layout_width="@dimen/ic_detail_add_size"
android:layout_height="@dimen/ic_detail_add_size"
android:background="@mipmap/jianhao"
android:foreground="?selectableItemBackground" />
android:foreground="@null" />
<TextView
android:id="@+id/txt_count"
android:layout_width="wrap_content"
......@@ -161,7 +161,7 @@
android:layout_width="@dimen/ic_detail_add_size"
android:layout_height="@dimen/ic_detail_add_size"
android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" />
android:foreground="@null" />
</LinearLayout>
</LinearLayout>
<LinearLayout
......@@ -176,7 +176,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/bg_button"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:padding="@dimen/goods_detail_butn_padding"
android:text="加入购物袋"
android:textColor="@color/colorPrimary"
......@@ -188,7 +188,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:padding="@dimen/goods_detail_butn_padding"
android:text="立即购买"
android:textColor="@color/white"
......
......@@ -4,7 +4,7 @@
android:layout_height="wrap_content"
android:background="@drawable/sel_category_label"
android:button="@null"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center"
android:paddingHorizontal="@dimen/category_padding_hor"
android:paddingTop="@dimen/category_padding_top_noimg"
......
......@@ -3,7 +3,7 @@
android:id="@+id/layout_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingVertical="@dimen/goods_padding_ver">
......
......@@ -4,7 +4,7 @@
android:id="@+id/layout_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground">
android:foreground="@null">
<ImageView
android:id="@+id/img_recommend"
android:layout_width="match_parent"
......
......@@ -11,7 +11,7 @@
android:layout_marginTop="@dimen/goods_detail_rule_margin_top"
android:layout_marginEnd="@dimen/goods_detail_rule_margin_right"
android:background="@drawable/sel_spec_bg"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center"
android:minWidth="@dimen/goods_detail_rule_width"
android:paddingHorizontal="@dimen/goods_detail_rule_padding_hor"
......
......@@ -8,7 +8,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/tip_margin_top"
android:button="@null"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center"
android:lines="1"
android:paddingTop="@dimen/tip_padding_top"
......
......@@ -16,7 +16,7 @@
android:layout_height="@dimen/ic_checkbox"
android:background="@drawable/sel_butn_check"
android:checked="true"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:textOff=""
android:textOn="" />
<ImageView
......@@ -99,7 +99,7 @@
android:layout_width="@dimen/ic_subtract_size"
android:layout_height="@dimen/ic_subtract_size"
android:background="@mipmap/jianhao"
android:foreground="?selectableItemBackground" />
android:foreground="@null" />
<TextView
android:id="@+id/txt_count"
android:layout_width="wrap_content"
......@@ -116,6 +116,6 @@
android:layout_width="@dimen/ic_add_size"
android:layout_height="@dimen/ic_add_size"
android:background="@mipmap/jiahao"
android:foreground="?selectableItemBackground" />
android:foreground="@null" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
android:background="@android:color/holo_red_dark">
<ImageView
android:id="@+id/img_background1"
android:layout_width="match_parent"
......
......@@ -12,7 +12,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:padding="@dimen/padding10"
android:src="@drawable/ic_baseline_chevron_left_24" />
<TextView
......
......@@ -37,7 +37,7 @@
android:id="@+id/butn_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center"
android:orientation="horizontal">
<ImageView
......@@ -74,7 +74,7 @@
android:layout_height="@dimen/trolley_bar_height"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<RelativeLayout
......@@ -126,7 +126,7 @@
android:layout_width="@dimen/trolley_pay_width"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:foreground="?selectableItemBackground"
android:foreground="@null"
android:text="结算"
android:textColor="@color/white"
android:textSize="@dimen/ts_trolley_pay"
......
......@@ -34,8 +34,8 @@
<dimen name="goods_price_margin">5px</dimen>
<dimen name="category_padding_top">17px</dimen>
<dimen name="category_padding_bottom">32px</dimen>
<dimen name="category_padding_top_noimg">56px</dimen>
<dimen name="category_padding_bottom_noimg">70px</dimen>
<dimen name="category_padding_top_noimg">68px</dimen>
<dimen name="category_padding_bottom_noimg">68px</dimen>
<dimen name="category_padding_hor">35px</dimen>
<dimen name="category_drawable_padding">10px</dimen>
<dimen name="category_drawable_width">100px</dimen>
......@@ -140,37 +140,21 @@
<dimen name="confirm_order_text_one">62px</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_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">55px</dimen>
<dimen name="interaction_goods_icon_width">230px</dimen>
<dimen name="interaction_goods_icon_height">230px</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">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="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">100px</dimen>
<dimen name="ts_interaction_recommend_big">120px</dimen>
<dimen name="ic_recommend">17px</dimen>
<dimen name="ic_clear_size">20px</dimen>
......
......@@ -34,8 +34,8 @@
<dimen name="goods_price_margin">5px</dimen>
<dimen name="category_padding_top">17px</dimen>
<dimen name="category_padding_bottom">32px</dimen>
<dimen name="category_padding_top_noimg">20px</dimen>
<dimen name="category_padding_bottom_noimg">70px</dimen>
<dimen name="category_padding_top_noimg">68px</dimen>
<dimen name="category_padding_bottom_noimg">68px</dimen>
<dimen name="category_padding_hor">35px</dimen>
<dimen name="category_drawable_padding">10px</dimen>
<dimen name="category_drawable_width">100px</dimen>
......@@ -140,37 +140,37 @@
<dimen name="confirm_order_text_one">62px</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_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="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="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_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="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="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">100px</dimen>
<dimen name="ts_interaction_recommend_big">120px</dimen>
<dimen name="ic_recommend">17px</dimen>
<dimen name="ic_clear_size">20px</dimen>
......
......@@ -16,9 +16,13 @@ allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://maven.aliyun.com/nexus/content/repositories/releases/"
}
maven {
url 'https://jitpack.io'
}
}
}
......
## 未解决事项 TODO
*****
\ No newline at end of file
1、设置字体 购物袋总数量,购物袋item数量,商品详情数量
2、设置字体 购物袋总金额
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment