Commit 4749ba25 by wjg

v2

parent 3e1b1fe1
......@@ -6,7 +6,6 @@ import android.graphics.Typeface;
import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.data.MainData;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.PresentState;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.util.CollectionUtils;
......@@ -69,13 +68,6 @@ public class HLApplication extends Application {
AppConfig.HOST = AppConfig.HOST_PROD;
AppConfig.WX_URL = AppConfig.WX_URL_PROD;
}
// 第一个点单屏默认显示交互屏
if (AppConfig.DEFAULT_SCREEN_NO.equals("1")) {
AppConfig.DEFAULT_PRESENT = PresentState.KDS.getName();
} else {
AppConfig.DEFAULT_PRESENT = PresentState.INTERACTION.getName();
}
}
private static MainData mainData = new MainData();
......
package com.ihaoin.hooloo.device.base;
import com.ihaoin.hooloo.device.data.enums.PresentState;
public class AppConfig {
public static Boolean DEBUG = true; // TODO 编译环境
/** 点单屏编码, 1-菜单屏,2-交互屏 */
public static String DEFAULT_SCREEN_NO = "1"; // TODO 编译点单屏编码
/** 副屏内容 */
public static String DEFAULT_PRESENT = PresentState.KDS.getName();
public static Integer DEFAULT_SCREEN_NO = 1; // TODO 编译点单屏编码
public static String HL = "HL";
public static String TAG = HL + "_TEST";
public static String TAG_PUSH = HL + "_PUSH";
public static String TAG_NETWORK = HL + "_NETWORK";
public static String TAG_UPDATE = HL + "_UPDATE";
public static String UMENG_APPKEY = "6294708905844627b598aa78";
public static String UMENG_CHANNEL = "DEVICE_ORDER";
......
......@@ -16,7 +16,6 @@ public class Base {
public static final String NSP_MACHINE = SOCKET_HOST + "/getMachineInfo";
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_SKU_STATE_CHANGED = "SKU_STATE_CHANGED";
public static final String PUSH_ACTION_QRCODE_VISITED = "QRCODE_VISITED";
public static final String PUSH_ACTION_GOODS_CHANGED = "GOODS_CHANGED";
......@@ -36,6 +35,4 @@ public class Base {
public static final String BROADCAST_ACTION_KDS_INFO = "ACTION_KDS_INFO";
public static final String BROADCAST_ACTION_INTERACTION_INFO = "ACTION_INTERACTION_INFO";
public static final String BROADCAST_ACTION_GET_MACHINE_INFO = "ACTION_GET_MACHINE_INFO";
public static final String BROADCAST_ACTION_PLAY_NEXT = "BROADCAST_ACTION_PLAY_NEXT";
}
......@@ -40,9 +40,9 @@ public class MachineInfoSocket extends Thread {
}
}
Emitter.Listener onConnect = args -> Utils.i("machine socket connected");
private Emitter.Listener onConnect = args -> Utils.i("machine socket connected");
Emitter.Listener onDisconnect = args -> Utils.i("machine socket disconnected");
private Emitter.Listener onDisconnect = args -> Utils.i("machine socket disconnected");
public void close() {
try {
......
......@@ -2,20 +2,35 @@ package com.ihaoin.hooloo.device.component;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.Utils;
import java.util.List;
public class IntroViewPager extends ViewPager {
private boolean isCanScroll = true;
public boolean isCanScroll() {
return isCanScroll;
}
public void setCanScroll(boolean canScroll) {
isCanScroll = canScroll;
}
public IntroViewPager(@NonNull Context context) {
super(context);
}
......@@ -25,6 +40,25 @@ public class IntroViewPager extends ViewPager {
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (isCanScroll) {
return super.onTouchEvent(ev);
} else {
return false;
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (isCanScroll) {
return super.onInterceptTouchEvent(ev);
} else {
return false;
}
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (getAdapter() == null) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
......@@ -32,28 +66,29 @@ public class IntroViewPager extends ViewPager {
}
int index = getCurrentItem();
int height = 0;
View v = getView(index);
View v = getChildAt(index % introUrls.size());
if (v != null) {
v.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
height = v.getMeasuredHeight();
}
Utils.i("onMeasure v=" + (v != null) + ", index=" + index + ", h=" + height);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
private List<View> introViews;
private List<String> introUrls;
public void setIntroViews(List<View> introViews) {
this.introViews = introViews;
public void setIntroUrls(List<String> introUrls) {
this.introUrls = introUrls;
this.setAdapter(pagerAdapter);
}
public View getView(int index) {
if (CollectionUtils.isEmpty(introViews)) {
return null;
}
return introViews.get(index % introViews.size());
}
// public View getView(int index) {
// if (CollectionUtils.isEmpty(introViews)) {
// return null;
// }
// return introViews.get(index % introViews.size());
// }
public int getCount() {
return Integer.MAX_VALUE;
......@@ -66,7 +101,7 @@ public class IntroViewPager extends ViewPager {
private PagerAdapter pagerAdapter = new PagerAdapter() {
@Override
public int getCount() {
return CollectionUtils.isEmpty(introViews) ? 0 : Integer.MAX_VALUE;
return CollectionUtils.isEmpty(introUrls) ? 0 : Integer.MAX_VALUE;
}
@Override
......@@ -76,15 +111,14 @@ public class IntroViewPager extends ViewPager {
@Override
public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
View view = getView(position);
container.removeView(view);
container.removeView((View) object);
Utils.i("destroyItem: " + position);
}
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
if (CollectionUtils.isEmpty(introViews)) {
if (CollectionUtils.isEmpty(introUrls)) {
return null;
}
Utils.i("instantiateItem: " + position);
......@@ -93,4 +127,12 @@ public class IntroViewPager extends ViewPager {
return view;
}
};
private View getView(Integer position) {
ImageView imageView = (ImageView) LayoutInflater.from(getContext()).inflate(R.layout.intro_image, null);
String url = introUrls.get(position % introUrls.size());
Utils.i("getView: " + (position % introUrls.size()));
Utils.getGlide(getContext()).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView);
return imageView;
}
}
package com.ihaoin.hooloo.device.component;
import android.view.animation.BounceInterpolator;
public class MyBounceInterpolator extends BounceInterpolator {
private static float bounce(float t) {
return t * t * 8.0f;
}
@Override
public float getInterpolation(float t) {
// _b(t) = t * t * 8
// bs(t) = _b(t) for t < 0.3535
// bs(t) = _b(t - 0.54719) + 0.7 for t < 0.7408
// bs(t) = _b(t - 0.8526) + 0.9 for t < 0.9644
// bs(t) = _b(t - 1.0435) + 0.95 for t <= 1.0
// b(t) = bs(t * 1.1226)
t *= 1.1226f;
if (t < 0.3535f) return bounce(t + 0.02f);
else if (t < 0.7408f) return bounce(t - 0.54719f) + 0.85f;
else if (t < 0.9644f) return bounce(t - 0.8526f) + 0.95f;
else return bounce(t - 1.0435f) + 0.95f;
}
}
......@@ -125,6 +125,7 @@ public class ParticleSmasher extends View {
*/
public void reShowView(View view) {
view.animate().setDuration(100).setStartDelay(0).scaleX(1).scaleY(1).translationX(0).translationY(0).alpha(1).start();
// view.setVisibility(View.VISIBLE);
}
......
......@@ -58,7 +58,7 @@ public class SmashAnimator {
private long mStartDelay = 150L;
private float mHorizontalMultiple = 3; // 粒子水平变化幅度
private float mVerticalMultiple = 4; // 粒子垂直变化幅度
private int mRadius = Utils.dp2Px(2); // 粒子基础半径
private int mRadius = Utils.dp2Px(4); // 粒子基础半径
// 加速度插值器
private static final Interpolator DEFAULT_INTERPOLATOR = new AccelerateInterpolator(0.6f);
......@@ -290,8 +290,9 @@ public class SmashAnimator {
}
});
valueAnimator.start();
// 将View 缩放至0、透明至0
// 将View 缩放至0、透明至0
view.animate().setDuration(260).setStartDelay(startDelay).scaleX(0).scaleY(0).alpha(0).start();
// view.setVisibility(View.INVISIBLE);
}
......
package com.ihaoin.hooloo.device.data.enums;
import com.ihaoin.hooloo.device.util.StringUtils;
public enum PresentState {
NONE("不显示"),
KDS("菜单屏"),
INTERACTION("交互屏");
NONE(0, "不显示"),
KDS(1, "菜单屏"),
INTERACTION(2, "交互屏");
private Integer code;
private String name;
PresentState(String name) {
PresentState(Integer code, String name) {
this.code = code;
this.name = name;
}
public static PresentState get(String name) {
if (StringUtils.isEmpty(name)) {
public static PresentState get(Integer code) {
if (code == null) {
return NONE;
}
for (PresentState state : PresentState.values()) {
if (state.getName().equals(name)) {
if (state.getCode().equals(code)) {
return state;
}
}
......@@ -28,4 +28,13 @@ public enum PresentState {
public String getName() {
return name;
}
public Integer getCode() {
return code;
}
@Override
public String toString() {
return code + "-" + name;
}
}
package com.ihaoin.hooloo.device.data.vo;
import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.data.enums.ImageState;
import com.ihaoin.hooloo.device.util.Utils;
import java.io.Serializable;
import java.util.List;
......@@ -33,7 +33,7 @@ public class InteractionMsg implements Serializable {
private String backgroundDesc;
/** 推荐的商品id */
private Integer goodIds;
private Integer goodsId;
/** 推荐的商品 */
private String recommendGoods;
......@@ -61,7 +61,9 @@ public class InteractionMsg implements Serializable {
static {
mIdelMsg.setPicture(ImageState.IDEL.getCode());
mIdelMsg.setIsContinue(Base.TRUE);
mIdelMsg.setSentences(Utils.getSents("LOO感谢你", "感谢在美好的时间遇到了你"));
if (AppConfig.DEBUG) {
// mIdelMsg.setSentences(Utils.getSents("LOO感谢你", "感谢在美好的时间遇到了你"));
}
}
public static InteractionMsg getIdelMsg() {
......@@ -156,12 +158,12 @@ public class InteractionMsg implements Serializable {
this.recognizePerson = recognizePerson;
}
public Integer getGoodIds() {
return goodIds;
public Integer getGoodsId() {
return goodsId;
}
public void setGoodIds(Integer goodIds) {
this.goodIds = goodIds;
public void setGoodsId(Integer goodsId) {
this.goodsId = goodsId;
}
public Integer getIsContinue() {
......
......@@ -10,6 +10,9 @@ public class Sentence implements Serializable {
/** 字号 */
private Integer fontSize;
/** 间距 */
private Integer marginTop;
/** 文字 */
private String sentence;
......@@ -36,4 +39,12 @@ public class Sentence implements Serializable {
public void setSentence(String sentence) {
this.sentence = sentence;
}
public Integer getMarginTop() {
return marginTop;
}
public void setMarginTop(Integer marginTop) {
this.marginTop = marginTop;
}
}
......@@ -10,6 +10,7 @@ import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ihaoin.hooloo.device.R;
......@@ -71,7 +72,7 @@ public class GoodsAdapter extends BaseSectionQuickAdapter<ScrollBean, BaseViewHo
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);
Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).diskCacheStrategy(DiskCacheStrategy.ALL).into(imgThumbnail);
}
Sku sku = Utils.getDefaultSku(goods.getSkus());
......
......@@ -6,6 +6,7 @@ import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ihaoin.hooloo.device.R;
......@@ -35,7 +36,7 @@ public class RecommendAdapter extends BaseQuickAdapter<ScrollBean, BaseViewHolde
// RoundedCorners roundedCorners = new RoundedCorners(5);
// RequestOptions options = RequestOptions.bitmapTransform(roundedCorners);
Utils.getGlide(mContext).load(recommend.getPic()).into(imgRecommend);
Utils.getGlide(mContext).load(recommend.getPic()).diskCacheStrategy(DiskCacheStrategy.ALL).into(imgRecommend);
View layoutItem = helper.getView(R.id.layout_item);
layoutItem.setOnClickListener(v -> {
......
......@@ -155,7 +155,7 @@ public class ConfirmOrderDialog extends Dialog {
try {
ConfirmOrder confirmOrder = new ConfirmOrder();
confirmOrder.setMachineCode(AppConfig.MACHINE_CODE);
confirmOrder.setScreenNo(SharedPreferencesUtils.getScreenNo(getContext()));
confirmOrder.setScreenNo(String.valueOf(SharedPreferencesUtils.getScreenNo(getContext())));
confirmOrder.setSeqNo(genSeqNo());
confirmOrder.setGoods(confirmGoods);
String json = JsonUtils.getMapper().writeValueAsString(confirmOrder);
......
......@@ -24,6 +24,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.viewpager.widget.ViewPager;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
......@@ -75,8 +76,6 @@ public class GoodsDetailDialog extends Dialog {
private Button butnBuy;
private Button butnTrolley;
private List<View> introViews;
public GoodsDetailDialog(@NonNull Context context, Goods goods) {
super(context);
this.mGoods = goods;
......@@ -135,21 +134,19 @@ public class GoodsDetailDialog extends Dialog {
butnClose.setOnClickListener(x -> dismiss());
introViews = new ArrayList<>();
if (mGoods.getPics() != null && !CollectionUtils.isEmpty(mGoods.getPics().getIntroImages())) {
introPager.setIntroUrls(mGoods.getPics().getIntroImages());
for (int i = 0; i < mGoods.getPics().getIntroImages().size(); i++) {
String url = mGoods.getPics().getIntroImages().get(i);
View imgIntro = getIntroImage(url);
View btnIntro = getIntroButton(i);
introViews.add(imgIntro);
introIndicator.addView(btnIntro);
}
introPager.setIntroViews(introViews);
Utils.check(introIndicator, 0);
// introIndicator.check(0);
if (introIndicator.getChildCount() > 1) {
introIndicator.setVisibility(View.VISIBLE);
introIndicator.check(0);
if (mGoods.getPics().getIntroImages().size() <= 1) {
introPager.setCanScroll(false);
} else {
startPagerThread();
introIndicator.setVisibility(View.VISIBLE);
introPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
......@@ -158,7 +155,8 @@ public class GoodsDetailDialog extends Dialog {
@Override
public void onPageSelected(int position) {
Utils.check(introIndicator, position);
int index = position % introIndicator.getChildCount();
Utils.check(introIndicator, index);
}
@Override
......@@ -254,17 +252,13 @@ public class GoodsDetailDialog extends Dialog {
}
}
private Integer introPagerIndex = 0;
private class PagerHandler extends Handler {
@Override
public void handleMessage(@NonNull Message msg) {
int index = introPager.getCurrentItem();
int count = introPager.getCount();
if (index + 1 >= count) {
index = 0;
} else {
index++;
}
introPager.setCurrentItem(index, true);
introPagerIndex++;
introPager.setCurrentItem(introPagerIndex, true);
}
}
......@@ -288,7 +282,7 @@ public class GoodsDetailDialog extends Dialog {
ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
imgIntro.setLayoutParams(layoutParams);
imgIntro.setAdjustViewBounds(true);
Utils.getGlide(getContext()).load(url).into(imgIntro);
Utils.getGlide(getContext()).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(imgIntro);
return imgIntro;
}
......@@ -579,7 +573,7 @@ public class GoodsDetailDialog extends Dialog {
imageView.setAdjustViewBounds(true);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
// layoutParams.bottomMargin = Utils.getDimens(getContext(), R.dimen.padding5);
Utils.getGlide(getContext()).load(url).into(imageView);
Utils.getGlide(getContext()).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView);
layoutImages.addView(imageView, layoutParams);
});
}
......
......@@ -30,16 +30,6 @@ 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("connect", onConnect);
......@@ -51,14 +41,14 @@ public class InteractionSocket extends Thread {
}
}
Emitter.Listener onConnect = args -> {
private 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");
private Emitter.Listener onDisconnect = args -> Utils.i("interaction socket disconnected");
Emitter.Listener onReply = args -> {
private Emitter.Listener onReply = args -> {
Utils.i("interaction socket reply");
process("reply", args);
};
......
......@@ -41,14 +41,14 @@ public class KDSSocket extends Thread {
}
}
Emitter.Listener onConnect = args -> {
private 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");
private Emitter.Listener onDisconnect = args -> Utils.i("kds socket disconnected");
Emitter.Listener onReply = args -> {
private Emitter.Listener onReply = args -> {
Utils.i("kds socket reply");
if (CollectionUtils.isEmpty(args)) {
Utils.i("reply args empty");
......
......@@ -9,6 +9,7 @@ import android.widget.ImageView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.Utils;
......@@ -40,7 +41,14 @@ public class ImagePagerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder h, int position) {
BaseViewHolder holder = (BaseViewHolder) h;
String url = images.get(position % images.size());
Utils.getGlide(context).load(url).into(holder.image);
Utils.getGlide(context).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(holder.image);
}
public int getRealCount() {
if (CollectionUtils.isEmpty(images)) {
return 0;
}
return images.size();
}
@Override
......
......@@ -233,7 +233,7 @@ public class KdsPresentation extends Presentation {
private Integer statePosition = 3;
private void setNextImage() {
if (imagePagerAdapter == null || imagePagerAdapter.getItemCount() <= 1) {
if (imagePagerAdapter == null || imagePagerAdapter.getRealCount() <= 1) {
return;
}
imagePosition++;
......
......@@ -201,7 +201,7 @@ public class HttpUtil {
checkUpdate.setAppName(packageInfo.packageName);
checkUpdate.setVersionCode(packageInfo.versionCode);
checkUpdate.setVersionName(packageInfo.versionName);
checkUpdate.setType(SharedPreferencesUtils.getScreenNo(HLApplication.SELF));
checkUpdate.setType(String.valueOf(SharedPreferencesUtils.getScreenNo(HLApplication.SELF)));
String content = JsonUtils.toString(checkUpdate).replaceAll("\"", "'");
String params = String.format("{\"params\": \"%s\"}", content);
......
......@@ -15,7 +15,6 @@ import com.ihaoin.hooloo.device.base.Base;
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.StringUtils;
import com.ihaoin.hooloo.device.util.Utils;
public class SettingsActivity extends Activity {
......@@ -26,9 +25,7 @@ public class SettingsActivity extends Activity {
private TextView txtMachineCode;
private View layoutMachineCode;
private View layoutScreen;
private View layoutPresentation;
private TextView txtScreenNo;
private TextView txtPresentation;
private ToggleButton butnLogcat;
private View butnClose;
......@@ -50,15 +47,14 @@ public class SettingsActivity extends Activity {
layoutMachineCode = findViewById(R.id.layout_machine_code);
layoutScreen = findViewById(R.id.layout_screen);
txtScreenNo = findViewById(R.id.txt_screen_no);
layoutPresentation = findViewById(R.id.layout_presentation);
txtPresentation = findViewById(R.id.txt_presentation);
butnLogcat = findViewById(R.id.butn_logcat);
butnClose = findViewById(R.id.butn_close);
txtVersion.setText(getAppVersionName());
txtMachineCode.setText(SharedPreferencesUtils.getMachineCode(this));
txtScreenNo.setText(SharedPreferencesUtils.getScreenNo(this));
txtPresentation.setText(SharedPreferencesUtils.getPresentation(this));
PresentState state = PresentState.get(SharedPreferencesUtils.getScreenNo(this));
txtScreenNo.setText(state.toString());
butnLogcat.setChecked(SharedPreferencesUtils.getShowLogcat(this));
layoutTest.setOnClickListener(v -> Utils.showTest(SettingsActivity.this));
......@@ -69,29 +65,17 @@ public class SettingsActivity extends Activity {
butnClose.setOnClickListener(v -> finish());
layoutScreen.setOnClickListener(v -> showEditScreen());
layoutMachineCode.setOnClickListener(v -> showMachineCode());
layoutPresentation.setOnClickListener(v -> showEditPresentation());
layoutSysSettings.setOnClickListener(v -> Utils.openSystemSettings(getApplicationContext()));
}
private void showEditScreen() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("修改点单屏编码");
String[] items = new String[]{"1", "2"};
builder.setSingleChoiceItems(items, StringUtils.indexOf(items, SharedPreferencesUtils.getScreenNo(SettingsActivity.this)), (dialog, which) -> {
SharedPreferencesUtils.setScreenNo(SettingsActivity.this, items[which]);
txtScreenNo.setText(SharedPreferencesUtils.getScreenNo(SettingsActivity.this));
dialog.dismiss();
});
builder.create().show();
}
private void showEditPresentation() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("修改副屏内容");
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));
String[] items = new String[]{PresentState.NONE.toString(), PresentState.KDS.toString(), PresentState.INTERACTION.toString()};
builder.setSingleChoiceItems(items, SharedPreferencesUtils.getScreenNo(this), (dialog, which) -> {
PresentState stateRslt = PresentState.get(which);
SharedPreferencesUtils.setScreenNo(SettingsActivity.this, stateRslt.getCode());
txtScreenNo.setText(stateRslt.toString());
dialog.dismiss();
Utils.fastBroadcast(SettingsActivity.this, Base.BROADCAST_ACTION_PRESENT_CHANGED);
});
......
......@@ -11,6 +11,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.ToggleButton;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.R;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
......@@ -90,7 +91,7 @@ public class TrolleyAdapter extends BaseAdapter {
txtCount.setText(trolleyGoods.getCount().toString());
butnSubtract.setOnClickListener(v -> trolleyView.subtractGoods(position));
butnAdd.setOnClickListener(v -> trolleyView.addGoods(position));
Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).into(imgThumbnail);
Utils.getGlide(mContext).load(Utils.getThumbnailUrl(goods.getPics().getThumbnail())).diskCacheStrategy(DiskCacheStrategy.ALL).into(imgThumbnail);
ViewGroup layoutItem = convertView.findViewById(R.id.layout_item);
Utils.setTouchDelegate(layoutItem, Arrays.asList(butnAdd, butnSubtract));
......
package com.ihaoin.hooloo.device.update;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.Environment;
import android.os.Handler;
......@@ -9,10 +10,12 @@ import android.os.Message;
import androidx.annotation.NonNull;
import com.ihaoin.hooloo.device.HLApplication;
import com.ihaoin.hooloo.device.network.NetworkHandler;
import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.data.vo.CheckUpdateVo;
import com.ihaoin.hooloo.device.network.HttpUtil;
import com.ihaoin.hooloo.device.network.NetworkHandler;
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.Utils;
......@@ -20,6 +23,11 @@ import java.io.File;
@SuppressLint("HandlerLeak")
public class UpdateService extends Thread {
private Context mContext;
public UpdateService(Context context) {
this.mContext = context;
}
// @Nullable
// @Override
// public IBinder onBind(Intent intent) {
......@@ -29,7 +37,7 @@ public class UpdateService extends Thread {
@Override
public void run() {
checkUpdate();
HttpUtil.checkUpdate(checkUpdateHandler);
// while (true) {
// try {
......@@ -45,61 +53,57 @@ public class UpdateService extends Thread {
// }
}
private void checkUpdate() {
HttpUtil.checkUpdate(checkUpdateHandler);
}
private CheckUpdateHandler checkUpdateHandler = new CheckUpdateHandler();
private class CheckUpdateHandler extends NetworkHandler {
@Override
public void handleMessage(@NonNull Message msg) {
try {
CheckUpdateVo updateVo = new CheckUpdateVo();
updateVo.setUrl("https://testapi.pecktoy.com/files/upload_test/signed-v10.apk");
updateVo.setVersion("1.0.10");
updateVo.setVersionCode(10);
// Object obj = msg.obj;
// if (msg.what == 0 || obj == null) {
// Utils.i("check update error");
// return;
// }
// CheckUpdateVo updateVo = JsonUtils.readValue(obj, CheckUpdateVo.class);
// CheckUpdateVo updateVo = new CheckUpdateVo();
// updateVo.setUrl("https://testapi.pecktoy.com/files/upload_test/signed-v10.apk");
// updateVo.setVersion("1.0.10");
// updateVo.setVersionCode(10);
Object obj = msg.obj;
if (msg.what == 0 || obj == null) {
Utils.i(AppConfig.TAG_UPDATE, "检查更新返回¬失败");
return;
}
CheckUpdateVo updateVo = JsonUtils.readValue(obj, CheckUpdateVo.class);
if (updateVo.getVersionCode() == null || updateVo.getVersionCode() <= 0) {
Utils.i("version code is null");
Utils.i(AppConfig.TAG_UPDATE, "version code 为空");
return;
}
if (StringUtils.isEmpty(updateVo.getUrl())) {
Utils.i("url is null");
Utils.i(AppConfig.TAG_UPDATE, "url 为空");
return;
}
if (StringUtils.isEmpty(updateVo.getVersion())) {
Utils.i("version name is null");
Utils.i(AppConfig.TAG_UPDATE, "version 为空");
return;
}
PackageInfo packageInfo = Utils.getPackageInfo();
if (updateVo.getVersionCode() <= packageInfo.versionCode) {
Utils.i(String.format("do not update, current: %s, update: %s", packageInfo.versionCode, updateVo.getVersionCode()));
Utils.i(AppConfig.TAG_UPDATE, String.format("不需要更新, current: %s, update: %s", packageInfo.versionCode, updateVo.getVersionCode()));
return;
}
startDownload(updateVo);
} catch (Exception e) {
e.printStackTrace();
Utils.i("check update error");
Utils.i(AppConfig.TAG_UPDATE, "检查更新失败");
}
}
}
private void startDownload(CheckUpdateVo updateVo) {
String filename = "hooloo-device_" + updateVo.getVersion() + "_" + updateVo.getVersionCode() + ".apk";
String filename = "hooloo-device_" + updateVo.getVersion() + "_" + updateVo.getVersionCode() + "_" + System.currentTimeMillis() + ".apk";
String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/hooloo";
if (!new File(path).exists()) {
new File(path).mkdirs();
}
String file = path + "/" + filename;
Utils.i(String.format("start download url: %s, file: %s", updateVo.getUrl(), file));
Utils.i(AppConfig.TAG_UPDATE, String.format("开始下载文件 url: %s, file: %s", updateVo.getUrl(), file));
HttpUtil.download(updateVo.getUrl(), file, downloadHandler);
}
......@@ -109,14 +113,17 @@ public class UpdateService extends Thread {
try {
Object obj = msg.obj;
if (msg.what == 0 || obj == null) {
Utils.i("download file error");
Utils.i(AppConfig.TAG_UPDATE, "download file error");
return;
}
if (AppConfig.DEBUG) {
return; // 测试不实际升级
}
ApkUtils.install(HLApplication.SELF, obj.toString());
} catch (Exception e) {
e.printStackTrace();
Utils.i("download file error");
Utils.i(AppConfig.TAG_UPDATE, "下载文件错误");
}
}
};
......
......@@ -3,6 +3,7 @@ package com.ihaoin.hooloo.device.update;
import android.content.Context;
import com.fasterxml.jackson.databind.JsonNode;
import com.ihaoin.hooloo.device.base.AppConfig;
import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.util.CollectionUtils;
import com.ihaoin.hooloo.device.util.JsonUtils;
......@@ -38,26 +39,26 @@ public class UpdateSocket extends Thread {
mSocket.on("disconnect", onDisconnect);
mSocket.on("upgrade", onUpgrade);
} catch (Exception e) {
Utils.i("连接server失败,错误原因:" + e.getMessage());
Utils.i(AppConfig.TAG_UPDATE, "连接server失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
Emitter.Listener onConnect = args -> {
Utils.i("update socket connected");
private Emitter.Listener onConnect = args -> {
Utils.i(AppConfig.TAG_UPDATE, "update socket connected");
mSocket.emit("state", "", (Ack) ack -> process("state", ack));
};
Emitter.Listener onDisconnect = args -> Utils.i("update socket disconnected");
private Emitter.Listener onDisconnect = args -> Utils.i(AppConfig.TAG_UPDATE, "update socket disconnected");
Emitter.Listener onUpgrade = args -> {
Utils.i("update socket upgrade");
private Emitter.Listener onUpgrade = args -> {
Utils.i(AppConfig.TAG_UPDATE, "update socket upgrade");
process("upgrade", args);
};
public void close() {
try {
Utils.i("close update socket");
Utils.i(AppConfig.TAG_UPDATE, "close update socket");
if (mSocket != null) {
mSocket.disconnect();
mSocket.off("connect", onConnect);
......@@ -67,29 +68,29 @@ public class UpdateSocket extends Thread {
// mSocket = null;
}
} catch (Exception e) {
Utils.i("close失败,错误原因:" + e.getMessage());
Utils.i(AppConfig.TAG_UPDATE, "close失败,错误原因:" + e.getMessage());
e.printStackTrace();
}
}
private void process(String func, Object[] args) {
if (CollectionUtils.isEmpty(args)) {
Utils.i(func + " args empty");
Utils.i(AppConfig.TAG_UPDATE, func + " args empty");
return;
}
String content = args[0].toString();
if (StringUtils.isEmpty(content)) {
Utils.i(func + " content empty");
Utils.i(AppConfig.TAG_UPDATE, func + " content empty");
return;
}
try {
JsonNode node = JsonUtils.getMapper().readValue(content, JsonNode.class);
if (node == null) {
Utils.i(func + " msg empty");
Utils.i(AppConfig.TAG_UPDATE, func + " msg empty");
return;
}
if (node.get("upgrade") != null && node.get("upgrade").asBoolean()) {
new UpdateService().start();
new UpdateService(mContext).start();
}
} catch (IOException e) {
e.printStackTrace();
......
......@@ -13,6 +13,7 @@ import androidx.annotation.RequiresPermission;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.DeviceUtils;
import com.blankj.utilcode.util.ShellUtils;
import com.ihaoin.hooloo.device.base.AppConfig;
import java.io.File;
import java.util.Locale;
......@@ -34,14 +35,14 @@ public class ApkUtils {
@SuppressLint("PackageManagerGetSignatures")
@RequiresPermission(Manifest.permission.INSTALL_PACKAGES)
public static synchronized boolean install(Context context, String apkFile) {
Utils.i("start install: " + apkFile);
Utils.i(AppConfig.TAG_UPDATE, "start install: " + apkFile);
File file;
if (TextUtils.isEmpty(apkFile) || !(file = new File(apkFile)).exists())
return false;
//加上apk合法性判断
AppUtils.AppInfo apkInfo = AppUtils.getApkInfo(file);
if (apkInfo == null || TextUtils.isEmpty(apkInfo.getPackageName())) {
Utils.i("apk info is null, the file maybe damaged: " + file.getAbsolutePath());
Utils.i(AppConfig.TAG_UPDATE, "apk info is null, the file maybe damaged: " + file.getAbsolutePath());
return false;
}
......@@ -71,7 +72,7 @@ public class ApkUtils {
if (appPackageInfo != null && apkPackageInfo != null &&
!compareSharedUserId(appPackageInfo.sharedUserId, apkPackageInfo.sharedUserId)) {
Utils.i("Apk sharedUserId is not match, app shellUid: " + appPackageInfo.sharedUserId + ", apk shellUid: " + apkPackageInfo.sharedUserId);
Utils.i(AppConfig.TAG_UPDATE, "Apk sharedUserId is not match, app shellUid: " + appPackageInfo.sharedUserId + ", apk shellUid: " + apkPackageInfo.sharedUserId);
return false;
}
} catch (Throwable ignored) {
......@@ -105,10 +106,10 @@ public class ApkUtils {
if (installByShell(file, DeviceUtils.isDeviceRooted())) {
// if (sPreferences != null)
// sPreferences.edit().putBoolean(apkInfo.getPackageName(), true).apply();
Utils.i("Install Success[Shell]: " + file.getPath());
Utils.i(AppConfig.TAG_UPDATE, "Install Success[Shell]: " + file.getPath());
return true;
}
Utils.i("Install Failure: " + file.getAbsolutePath());
Utils.i(AppConfig.TAG_UPDATE, "Install Failure: " + file.getAbsolutePath());
return false;
}
......@@ -181,9 +182,9 @@ public class ApkUtils {
// }
private static boolean executeShell(String cmd, boolean isRoot) {
Utils.i("ShellCommand: " + cmd + ", isRoot: " + isRoot);
Utils.i(AppConfig.TAG_UPDATE, "ShellCommand: " + cmd + ", isRoot: " + isRoot);
ShellUtils.CommandResult result = ShellUtils.execCmd(cmd, isRoot);
Utils.i("ShellCommand Result: " + result.toString());
Utils.i(AppConfig.TAG_UPDATE, "ShellCommand Result: " + result.toString());
return result.successMsg != null && result.successMsg.toLowerCase(Locale.US).contains("success");
}
......
......@@ -12,17 +12,20 @@ public class SharedPreferencesUtils {
private final static String KEY_SHOW_LOGCAT = "SHOW_LOGCAT";
private final static String KEY_MACHINE_CODE = "MACHINE_CODE";
public static String getScreenNo(Context context) {
public static Integer getScreenNo(Context context) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getString(KEY_SCREEN_NO, AppConfig.DEFAULT_SCREEN_NO);
return sp.getInt(KEY_SCREEN_NO, AppConfig.DEFAULT_SCREEN_NO);
}
public static void setScreenNo(Context context, String val) {
public static void setScreenNo(Context context, Integer val) {
SharedPreferences sp = getSharedPreferences(context);
sp.edit().putString(KEY_SCREEN_NO, val).commit();
sp.edit().putInt(KEY_SCREEN_NO, val).commit();
}
public static String getMachineCode(Context context) {
if (AppConfig.DEBUG) {
return "SN0091290001";
}
SharedPreferences sp = getSharedPreferences(context);
return sp.getString(KEY_MACHINE_CODE, "");
}
......@@ -32,16 +35,6 @@ public class SharedPreferencesUtils {
sp.edit().putString(KEY_MACHINE_CODE, val).commit();
}
public static String getPresentation(Context context) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getString(KEY_PRESENTATION, AppConfig.DEFAULT_PRESENT);
}
public static void setPresentation(Context context, String val) {
SharedPreferences sp = getSharedPreferences(context);
sp.edit().putString(KEY_PRESENTATION, val).commit();
}
public static Boolean getShowLogcat(Context context) {
SharedPreferences sp = getSharedPreferences(context);
return sp.getBoolean(KEY_SHOW_LOGCAT, false);
......
......@@ -33,7 +33,6 @@ import com.ihaoin.hooloo.device.base.Base;
import com.ihaoin.hooloo.device.component.TouchDelegateComposite;
import com.ihaoin.hooloo.device.data.TrolleyGoods;
import com.ihaoin.hooloo.device.data.enums.SkuState;
import com.ihaoin.hooloo.device.data.vo.Category;
import com.ihaoin.hooloo.device.data.vo.Goods;
import com.ihaoin.hooloo.device.data.vo.InteractionMsg;
import com.ihaoin.hooloo.device.data.vo.KDSMsg;
......@@ -58,29 +57,6 @@ import java.util.List;
import java.util.Optional;
public class Utils {
public static Goods getGoods(Integer goodsId) {
if (goodsId == null || goodsId <= 0) {
return null;
}
if (HLApplication.getMainData() == null || CollectionUtils.isEmpty(HLApplication.getMainData().getCategorys())) {
return null;
}
for (Category category : HLApplication.getMainData().getCategorys()) {
if (category == null || CollectionUtils.isEmpty(category.getGoods())) {
continue;
}
for (Goods goods : category.getGoods()) {
if (goods == null || goods.getGoodsId() == null) {
continue;
}
if (goods.getGoodsId().equals(goodsId)) {
return goods;
}
}
}
return null;
}
public static List<Sentence> getSents(String... strs) {
if (CollectionUtils.isEmpty(strs)) {
return null;
......@@ -90,6 +66,7 @@ public class Utils {
Sentence sent = new Sentence();
sent.setSentence(s);
sent.setFontSize(80);
sent.setMarginTop(-120);
list.add(sent);
}
return list;
......@@ -325,11 +302,15 @@ public class Utils {
}
public static void showToast(Context context, String text) {
showToast(context, text, Toast.LENGTH_SHORT);
}
public static void showToast(Context context, String text, int t) {
View view = LayoutInflater.from(context).inflate(R.layout.view_toast, null);
TextView textView = view.findViewById(R.id.txt_toast);
textView.setText(text);
Toast toast = Toast.makeText(context, text, Toast.LENGTH_SHORT);
Toast toast = Toast.makeText(context, text, t);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.setView(view);
toast.show();
......@@ -343,6 +324,10 @@ public class Utils {
return url;
}
public static Typeface getInteractionFont(Context context) {
return Typeface.createFromAsset(context.getAssets(), "fonts/SourceHanSansCN-Bold.otf");
}
public static Typeface getAmountFont(Context context) {
return Typeface.createFromAsset(context.getAssets(), "fonts/futura_regular.ttf");
}
......
......@@ -94,18 +94,36 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="hoo感谢" />
<!-- <Button-->
<!-- android:id="@+id/butn_2"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_weight="1"-->
<!-- android:text="hoo感谢2" />-->
<Button
android:id="@+id/butn_2"
android:id="@+id/butn_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="hoo感谢2" />
android:text="hoo接待1" />
<Button
android:id="@+id/butn_3"
android:id="@+id/butn_4"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="hoo接待2" />
<Button
android:id="@+id/butn_41"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="hoo接待3" />
<Button
android:id="@+id/butn_5"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="hoo接待" />
android:text="hoo接待4" />
<Button
android:id="@+id/butn_6"
android:layout_width="0dp"
......
......@@ -145,36 +145,6 @@
</LinearLayout>
<include layout="@layout/view_line" />
<LinearLayout
android:id="@+id/layout_presentation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="@null"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/padding10"
android:text="副屏内容"
android:textColor="@color/textPrimary"
android:textSize="@dimen/ts_setting_name" />
<TextView
android:id="@+id/txt_presentation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding10"
android:text="不显示"
android:textColor="@color/textDisable"
android:textSize="@dimen/ts_setting_desc" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/padding10"
android:src="@drawable/ic_baseline_chevron_right_24_grey" />
</LinearLayout>
<include layout="@layout/view_line" />
<LinearLayout
android:id="@+id/layout_logcat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true" />
......@@ -23,6 +23,8 @@
android:id="@+id/layout_lines"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="75px"
android:layout_marginTop="75px"
android:orientation="vertical">
<com.ihaoin.hooloo.device.component.WarpLinearLayout
android:id="@+id/layout_line_1"
......@@ -32,7 +34,7 @@
app:grivate="left"
app:horizontal_Space="10px"
app:isFull="false"
app:vertical_Space="5px" />
app:vertical_Space="0px" />
<com.ihaoin.hooloo.device.component.WarpLinearLayout
android:id="@+id/layout_line_2"
android:layout_width="match_parent"
......@@ -41,7 +43,7 @@
app:grivate="left"
app:horizontal_Space="10px"
app:isFull="false"
app:vertical_Space="5px" />
app:vertical_Space="0px" />
<com.ihaoin.hooloo.device.component.WarpLinearLayout
android:id="@+id/layout_line_3"
android:layout_width="match_parent"
......@@ -50,7 +52,7 @@
app:grivate="left"
app:horizontal_Space="10px"
app:isFull="false"
app:vertical_Space="5px" />
app:vertical_Space="0px" />
<com.ihaoin.hooloo.device.component.WarpLinearLayout
android:id="@+id/layout_line_4"
android:layout_width="match_parent"
......@@ -59,7 +61,7 @@
app:grivate="left"
app:horizontal_Space="10px"
app:isFull="false"
app:vertical_Space="5px" />
app:vertical_Space="0px" />
</LinearLayout>
<LinearLayout
......@@ -87,27 +89,73 @@
android:layout_height="@dimen/interaction_goods_icon_height"
android:scaleType="centerCrop" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignTop="@+id/layout_recommend"
android:layout_alignBottom="@+id/layout_recommend"
android:layout_marginTop="-40px"
android:layout_marginBottom="-40px">
<ImageView
android:id="@+id/light1"
android:layout_width="300px"
android:layout_height="300px"
android:layout_alignParentLeft="true"
android:src="@mipmap/light1"
android:visibility="invisible" />
<ImageView
android:id="@+id/light2"
android:layout_width="300px"
android:layout_height="300px"
android:layout_alignParentRight="true"
android:src="@mipmap/light2"
android:visibility="invisible" />
</RelativeLayout>
<ImageView
android:id="@+id/view_start"
android:layout_width="180px"
android:layout_height="50px"
android:layout_marginLeft="500px"
android:layout_marginTop="1005px"
android:background="#55FF0000" />
android:layout_marginTop="1005px" />
<AbsoluteLayout
android:id="@+id/layout_chars_fly"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_x="520px"-->
<!-- android:layout_y="1030px"-->
<!-- android:text="中国人s"-->
<!-- android:textColor="@android:color/white"-->
<!-- android:textSize="40px" />-->
<!-- <TextView-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_x="520px"-->
<!-- android:layout_y="1030px"-->
<!-- android:text="中国人s"-->
<!-- android:textColor="@android:color/white"-->
<!-- android:textSize="40px" />-->
</AbsoluteLayout>
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:orientation="vertical">-->
<!-- <TextView-->
<!-- android:id="@+id/test1"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:background="@color/black"-->
<!-- android:text="12345"-->
<!-- android:textColor="@android:color/holo_red_dark"-->
<!-- android:textSize="60px" />-->
<!-- <TextView-->
<!-- android:id="@+id/test2"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="40px"-->
<!-- android:background="@color/black"-->
<!-- android:text="12345"-->
<!-- android:textColor="@android:color/holo_red_dark"-->
<!-- android:textSize="120px" />-->
<!-- </LinearLayout>-->
</RelativeLayout>
\ No newline at end of file
......@@ -154,7 +154,7 @@
<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">40px</dimen>
<dimen name="ts_interaction_recommend_small">50px</dimen>
<dimen name="ts_interaction_recommend_big">60px</dimen>
<dimen name="ic_recommend">17px</dimen>
......
......@@ -11,6 +11,7 @@
<color name="textGrayF0">#FFF0F0F0</color>
<color name="textGrayF6">#FFF6F6F6</color>
<color name="textGrayD8">#FFD8D8D8</color>
<color name="textGray11">#FF111111</color>
<color name="line">#FFECECEC</color>
<color name="white">#FFFFFFFF</color>
<color name="black">#FF000000</color>
......@@ -19,4 +20,12 @@
<color name="menu_order_bg">#FF4A71FF</color>
<color name="menu_state_bg">#FFDEF0FF</color>
<color name="menu_state_text">#FF006ECF</color>
<color name="fly_text1">#FF006ECF</color>
<color name="fly_text2">#FF0000</color>
<color name="fly_text3">#FF7F00</color>
<color name="fly_text4">#FFFF00</color>
<color name="fly_text5">#00FF00</color>
<color name="fly_text6">#00FFFF</color>
<color name="fly_text7">#0000FF</color>
<color name="fly_text8">#8B00FF</color>
</resources>
......@@ -170,7 +170,7 @@
<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">40px</dimen>
<dimen name="ts_interaction_recommend_small">50px</dimen>
<dimen name="ts_interaction_recommend_big">60px</dimen>
<dimen name="ic_recommend">17px</dimen>
......
## 未解决事项 TODO
*****
\ No newline at end of file
## 未解决事项
1、update socket联调
2、App静默升级验证
\ 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