Commit f33082d6 authored by 姜天宇's avatar 姜天宇

feat(v1.0.2): 增加数据管理页、学习页、AIDL服务

parent dfa400a3
......@@ -63,10 +63,10 @@ dependencies {
implementation project(path: ':common')
implementation project(path: ':core')
implementation project(path: ':module-demo')
implementation project(path: ':module-setting')
implementation project(path: ':data-remote')
implementation project(path: ':data-local')
implementation project(path: ':service')
implementation 'com.alibaba:arouter-api:1.5.2'
annotationProcessor 'com.alibaba:arouter-compiler:1.5.2'
......
......@@ -12,7 +12,7 @@ import com.wmdigit.common.R;
import com.wmdigit.common.adapter.diffutils.DrawerMenuDiffUtils;
import com.wmdigit.common.base.adapter.BaseDiffRecyclerViewAdapter;
import com.wmdigit.common.base.viewholder.BaseViewHolder;
import com.wmdigit.common.model.DrawerMenuItemModel;
import com.wmdigit.common.model.DrawerMenuItemVO;
import java.util.List;
......@@ -20,9 +20,9 @@ import java.util.List;
* 抽屉菜单适配器
* @author dizi
*/
public class DrawerMenuAdapter extends BaseDiffRecyclerViewAdapter<DrawerMenuAdapter.DrawerMenuViewHolder, DrawerMenuItemModel, DrawerMenuDiffUtils> {
public class DrawerMenuAdapter extends BaseDiffRecyclerViewAdapter<DrawerMenuAdapter.DrawerMenuViewHolder, DrawerMenuItemVO, DrawerMenuDiffUtils> {
public DrawerMenuAdapter(Context mContext, List<DrawerMenuItemModel> mList) {
public DrawerMenuAdapter(Context mContext, List<DrawerMenuItemVO> mList) {
super(mContext, mList);
}
......@@ -41,7 +41,7 @@ public class DrawerMenuAdapter extends BaseDiffRecyclerViewAdapter<DrawerMenuAda
return new DrawerMenuViewHolder(itemView, onItemClickListener);
}
public static class DrawerMenuViewHolder extends BaseViewHolder<DrawerMenuItemModel> {
public static class DrawerMenuViewHolder extends BaseViewHolder<DrawerMenuItemVO> {
private ImageView imgMenu;
private TextView tvTitle;
......@@ -55,8 +55,8 @@ public class DrawerMenuAdapter extends BaseDiffRecyclerViewAdapter<DrawerMenuAda
}
@Override
public void bind(DrawerMenuItemModel item) {
if (item.isChecked()){
public void bind(DrawerMenuItemVO item) {
if (item.getChecked()){
// 被选中
rootView.setBackgroundResource(R.drawable.sel_rect_10_orange_gray);
}
......
package com.wmdigit.common.adapter.diffutils;
import com.wmdigit.common.base.diffutil.BaseDiffUtil;
import com.wmdigit.common.model.DrawerMenuItemModel;
import com.wmdigit.common.model.DrawerMenuItemVO;
import java.util.List;
......@@ -9,14 +9,19 @@ import java.util.List;
* 抽屉菜单差异比较器
* @author dizi
*/
public class DrawerMenuDiffUtils extends BaseDiffUtil<DrawerMenuItemModel> {
public DrawerMenuDiffUtils(List<DrawerMenuItemModel> oldList, List<DrawerMenuItemModel> newList) {
public class DrawerMenuDiffUtils extends BaseDiffUtil<DrawerMenuItemVO> {
public DrawerMenuDiffUtils(List<DrawerMenuItemVO> oldList, List<DrawerMenuItemVO> newList) {
super(oldList, newList);
}
@Override
protected boolean checkContentsTheSame(DrawerMenuItemModel oldItem, DrawerMenuItemModel newItem) {
if (oldItem.isChecked() != newItem.isChecked()){
protected boolean areItemsTheSame(DrawerMenuItemVO oldItem, DrawerMenuItemVO newItem) {
return oldItem.getIconResId() == newItem.getIconResId();
}
@Override
protected boolean checkContentsTheSame(DrawerMenuItemVO oldItem, DrawerMenuItemVO newItem) {
if (!oldItem.getChecked().equals(newItem.getChecked())){
return false;
}
return true;
......
......@@ -30,7 +30,7 @@ public abstract class BaseDiffUtil<T extends BaseDiffUtilModel> extends DiffUtil
@Override
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
return oldList.get(oldItemPosition).getUuid().equals(newList.get(newItemPosition).getUuid());
return areItemsTheSame(oldList.get(oldItemPosition), newList.get(newItemPosition));
}
@Override
......@@ -38,6 +38,14 @@ public abstract class BaseDiffUtil<T extends BaseDiffUtilModel> extends DiffUtil
return checkContentsTheSame(oldList.get(oldItemPosition), newList.get(newItemPosition));
}
/**
* 判断两个Item是否一样
* @param oldItem
* @param newItem
* @return
*/
protected abstract boolean areItemsTheSame(T oldItem, T newItem);
/**
* 判断两个对象内容是否一致
* @param oldItem
......
......@@ -8,16 +8,5 @@ import java.util.UUID;
* @author dizi
*/
public class BaseDiffUtilModel implements Serializable {
/**
* 用于比较两个对象是否一致
*/
private String uuid;
public BaseDiffUtilModel() {
uuid = UUID.randomUUID().toString();
}
public String getUuid() {
return uuid;
}
}
package com.wmdigit.common.base.mvvm;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
......@@ -14,7 +13,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.wmdigit.common.adapter.DrawerMenuAdapter;
import com.wmdigit.common.model.DrawerMenuItemModel;
import com.wmdigit.common.model.DrawerMenuItemVO;
import java.util.List;
......@@ -106,7 +105,7 @@ public abstract class BaseMvvmNaviDrawerActivity<VM extends BaseViewModel, DB ex
* 获取菜单数据
* @return
*/
protected abstract List<DrawerMenuItemModel> getMenuData();
protected abstract List<DrawerMenuItemVO> getMenuData();
/**
* 获取DrawerLayout,一般是根布局
......@@ -147,4 +146,9 @@ public abstract class BaseMvvmNaviDrawerActivity<VM extends BaseViewModel, DB ex
return super.onOptionsItemSelected(item);
}
@Override
protected void onDestroy() {
super.onDestroy();
mDrawerMenuAdapter = null;
}
}
package com.wmdigit.common.model;
import androidx.annotation.NonNull;
/**
* 裁剪坐标
* @author dizi
*/
public class CropValue {
public class CropValueDTO {
private int left, top, width, height;
private Integer left, top, width, height;
public CropValue(int left, int top, int width, int height) {
public CropValueDTO(int left, int top, int width, int height) {
this.left = left;
this.top = top;
this.width = width;
......@@ -46,4 +48,10 @@ public class CropValue {
public void setHeight(int height) {
this.height = height;
}
@NonNull
@Override
public String toString() {
return super.toString();
}
}
package com.wmdigit.common.model;
import androidx.annotation.NonNull;
import com.wmdigit.common.base.diffutil.BaseDiffUtilModel;
/**
* 导航菜单Item
* @author dizi
*/
public class DrawerMenuItemModel extends BaseDiffUtilModel {
public class DrawerMenuItemVO extends BaseDiffUtilModel {
/**
* 图标资源ID
*/
......@@ -18,9 +20,9 @@ public class DrawerMenuItemModel extends BaseDiffUtilModel {
/**
* 是否选中
*/
private boolean isChecked = false;
private Boolean isChecked;
public DrawerMenuItemModel(int iconResId, String title, boolean isChecked) {
public DrawerMenuItemVO(int iconResId, String title, boolean isChecked) {
this.iconResId = iconResId;
this.title = title;
this.isChecked = isChecked;
......@@ -42,11 +44,17 @@ public class DrawerMenuItemModel extends BaseDiffUtilModel {
this.title = title;
}
public boolean isChecked() {
public Boolean getChecked() {
return isChecked;
}
public void setChecked(boolean checked) {
public void setChecked(Boolean checked) {
isChecked = checked;
}
@NonNull
@Override
public String toString() {
return super.toString();
}
}
package com.wmdigit.common.model;
import androidx.annotation.NonNull;
/**
* 商品DTO
* @author dizi
*/
public class ProductsDTO {
/**
* 品名
*/
private String productName;
/**
* 商品代码
*/
private String productCode;
/**
* 商品助记码
*/
private String productMnemonicCode;
/**
* 商品单价(元/份)
*/
private String unitPrice;
/**
* 在售状态,1:在售 2:下架
*/
private Integer onSale;
public ProductsDTO() {
}
public ProductsDTO(String productName, String productCode, String productMnemonicCode, String unitPrice, Integer onSale) {
this.productName = productName;
this.productCode = productCode;
this.productMnemonicCode = productMnemonicCode;
this.unitPrice = unitPrice;
this.onSale = onSale;
}
@NonNull
@Override
public String toString() {
return super.toString();
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductMnemonicCode() {
return productMnemonicCode;
}
public void setProductMnemonicCode(String productMnemonicCode) {
this.productMnemonicCode = productMnemonicCode;
}
public String getUnitPrice() {
return unitPrice;
}
public Integer getOnSale() {
return onSale;
}
public void setOnSale(Integer onSale) {
this.onSale = onSale;
}
public void setUnitPrice(String unitPrice) {
this.unitPrice = unitPrice;
}
}
package com.wmdigit.common.model;
import androidx.annotation.NonNull;
import com.wmdigit.common.base.diffutil.BaseDiffUtilModel;
/**
* 商品信息
* @author dizi
*/
public class ProductsVO extends BaseDiffUtilModel {
/**
* 品名
*/
private String productName;
/**
* 商品代码
*/
private String productCode;
/**
* 商品助记码
*/
private String productMnemonicCode;
/**
* 商品单价(元/份)
*/
private String unitPrice;
/**
* 是否被选中
*/
private Boolean isChecked;
public ProductsVO() {
isChecked = false;
}
public ProductsVO(String productName, String productCode, String productMnemonicCode, String unitPrice) {
this.productName = productName;
this.productCode = productCode;
this.productMnemonicCode = productMnemonicCode;
this.unitPrice = unitPrice;
this.isChecked = false;
}
public boolean isChecked() {
return isChecked;
}
public void setChecked(boolean checked) {
isChecked = checked;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductMnemonicCode() {
return productMnemonicCode;
}
public void setProductMnemonicCode(String productMnemonicCode) {
this.productMnemonicCode = productMnemonicCode;
}
public String getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(String unitPrice) {
this.unitPrice = unitPrice;
}
@NonNull
@Override
public String toString() {
return super.toString();
}
}
......@@ -9,8 +9,7 @@ import androidx.databinding.BindingAdapter;
import androidx.databinding.InverseBindingAdapter;
import androidx.databinding.InverseBindingListener;
import com.elvishew.xlog.XLog;
import com.wmdigit.common.model.CropValue;
import com.wmdigit.common.model.CropValueDTO;
/**
* 支持双向数据绑定的CropView
......@@ -72,16 +71,16 @@ public class BidirectionalDataBindingCropView extends CropView{
* @param value
*/
@BindingAdapter("preset_crop_value")
public static void presetCropValue(CropView view, CropValue value){
public static void presetCropValue(CropView view, CropValueDTO value){
if (value != null){
view.setPresetCropCoordinate(new Rect(value.getLeft(), value.getTop(), value.getWidth() + value.getLeft(), value.getHeight() + value.getTop()));
}
}
@InverseBindingAdapter(attribute = "preset_crop_value", event = "preset_crop_valueAttrChanged")
public static CropValue getCropValue(CropView view){
public static CropValueDTO getCropValue(CropView view){
Rect rect = view.getCropRect();
CropValue cropValue = new CropValue( 0, 0, 0, 0);
CropValueDTO cropValue = new CropValueDTO( 0, 0, 0, 0);
if (rect != null){
cropValue.setLeft(rect.left);
cropValue.setTop(rect.top);
......
package com.wmdigit.common.view.keyboard;
import android.content.Context;
import android.graphics.Bitmap;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.databinding.BindingAdapter;
import androidx.databinding.InverseBindingAdapter;
import androidx.databinding.InverseBindingListener;
import com.wmdigit.common.R;
import com.wmdigit.common.view.imageview.CropView;
/**
* 英文和数字键盘
* @author dizi
*/
public class EnglishAndNumberKeyboard extends ConstraintLayout {
private TextView keyA, keyB, keyC, keyD, keyE, keyF, keyG, keyH, keyI, keyJ, keyK, keyL, keyM,
keyN, keyO, keyP, keyQ, keyR, keyS, keyT, keyU, keyV, keyW, keyX, keyY, keyZ;
private TextView key0, key1, key2, key3, key4, key5, key6, key7, key8, key9, keyPoint;
private ConstraintLayout clEnglishKeyboard, clNumberKeyboard;
private TextView keySwitch123, keySwitchAbc;
private TextView tvKeywords, tvKeywordsHint, tvClear;
private static InverseBindingListener inverseBindingListener;
private final TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
if (s.toString().length() > 0){
tvKeywordsHint.setVisibility(INVISIBLE);
}
else{
tvKeywordsHint.setVisibility(VISIBLE);
}
if (inverseBindingListener != null){
inverseBindingListener.onChange();
}
}
};
public EnglishAndNumberKeyboard(Context context) {
this(context, null);
}
public EnglishAndNumberKeyboard(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public EnglishAndNumberKeyboard(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
this(context, attrs, defStyleAttr, 0);
}
public EnglishAndNumberKeyboard(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
LayoutInflater.from(context).inflate(R.layout.layout_english_number_keyboard, this, true);
initView();
initListener();
}
private void initListener() {
// 切换按钮监听
keySwitch123.setOnClickListener(v-> {
clEnglishKeyboard.setVisibility(INVISIBLE);
clNumberKeyboard.setVisibility(VISIBLE);
});
keySwitchAbc.setOnClickListener(v-> {
clEnglishKeyboard.setVisibility(VISIBLE);
clNumberKeyboard.setVisibility(INVISIBLE);
});
// 关键词内容监听
tvKeywords.addTextChangedListener(watcher);
// 键盘按键监听
keyA.setOnClickListener(v-> tvKeywords.append("A"));
keyB.setOnClickListener(v-> tvKeywords.append("B"));
keyC.setOnClickListener(v-> tvKeywords.append("C"));
keyD.setOnClickListener(v-> tvKeywords.append("D"));
keyE.setOnClickListener(v-> tvKeywords.append("E"));
keyF.setOnClickListener(v-> tvKeywords.append("F"));
keyG.setOnClickListener(v-> tvKeywords.append("G"));
keyH.setOnClickListener(v-> tvKeywords.append("H"));
keyI.setOnClickListener(v-> tvKeywords.append("I"));
keyJ.setOnClickListener(v-> tvKeywords.append("J"));
keyK.setOnClickListener(v-> tvKeywords.append("K"));
keyL.setOnClickListener(v-> tvKeywords.append("L"));
keyM.setOnClickListener(v-> tvKeywords.append("M"));
keyN.setOnClickListener(v-> tvKeywords.append("N"));
keyO.setOnClickListener(v-> tvKeywords.append("O"));
keyP.setOnClickListener(v-> tvKeywords.append("P"));
keyQ.setOnClickListener(v-> tvKeywords.append("Q"));
keyR.setOnClickListener(v-> tvKeywords.append("R"));
keyS.setOnClickListener(v-> tvKeywords.append("S"));
keyT.setOnClickListener(v-> tvKeywords.append("T"));
keyU.setOnClickListener(v-> tvKeywords.append("U"));
keyV.setOnClickListener(v-> tvKeywords.append("V"));
keyW.setOnClickListener(v-> tvKeywords.append("W"));
keyX.setOnClickListener(v-> tvKeywords.append("X"));
keyY.setOnClickListener(v-> tvKeywords.append("Y"));
keyZ.setOnClickListener(v-> tvKeywords.append("Z"));
key0.setOnClickListener(v-> tvKeywords.append("0"));
key1.setOnClickListener(v-> tvKeywords.append("1"));
key2.setOnClickListener(v-> tvKeywords.append("2"));
key3.setOnClickListener(v-> tvKeywords.append("3"));
key4.setOnClickListener(v-> tvKeywords.append("4"));
key5.setOnClickListener(v-> tvKeywords.append("5"));
key6.setOnClickListener(v-> tvKeywords.append("6"));
key7.setOnClickListener(v-> tvKeywords.append("7"));
key8.setOnClickListener(v-> tvKeywords.append("8"));
key9.setOnClickListener(v-> tvKeywords.append("9"));
keyPoint.setOnClickListener(v-> tvKeywords.append("."));
// 清空
tvClear.setOnClickListener(v -> tvKeywords.setText(""));
}
private void initView(){
clEnglishKeyboard = findViewById(R.id.cl_english_keyboard);
clEnglishKeyboard.setVisibility(VISIBLE);
clNumberKeyboard = findViewById(R.id.cl_number_keyboard);
clNumberKeyboard.setVisibility(INVISIBLE);
keySwitch123 = findViewById(R.id.tv_switch_123);
keySwitchAbc = findViewById(R.id.tv_switch_abc);
keyA = findViewById(R.id.tv_a);
keyB = findViewById(R.id.tv_b);
keyC = findViewById(R.id.tv_c);
keyD = findViewById(R.id.tv_d);
keyE = findViewById(R.id.tv_e);
keyF = findViewById(R.id.tv_f);
keyG = findViewById(R.id.tv_g);
keyH = findViewById(R.id.tv_h);
keyI = findViewById(R.id.tv_i);
keyJ = findViewById(R.id.tv_j);
keyK = findViewById(R.id.tv_k);
keyL = findViewById(R.id.tv_l);
keyM = findViewById(R.id.tv_m);
keyN = findViewById(R.id.tv_n);
keyO = findViewById(R.id.tv_o);
keyP = findViewById(R.id.tv_p);
keyQ = findViewById(R.id.tv_q);
keyR = findViewById(R.id.tv_r);
keyS = findViewById(R.id.tv_s);
keyT = findViewById(R.id.tv_t);
keyU = findViewById(R.id.tv_u);
keyV = findViewById(R.id.tv_v);
keyW = findViewById(R.id.tv_w);
keyX = findViewById(R.id.tv_x);
keyY = findViewById(R.id.tv_y);
keyZ = findViewById(R.id.tv_z);
key0 = findViewById(R.id.tv_0);
key1 = findViewById(R.id.tv_1);
key2 = findViewById(R.id.tv_2);
key3 = findViewById(R.id.tv_3);
key4 = findViewById(R.id.tv_4);
key5 = findViewById(R.id.tv_5);
key6 = findViewById(R.id.tv_6);
key7 = findViewById(R.id.tv_7);
key8 = findViewById(R.id.tv_8);
key9 = findViewById(R.id.tv_9);
keyPoint = findViewById(R.id.tv_point);
tvKeywords = findViewById(R.id.tv_keywords);
tvKeywordsHint = findViewById(R.id.tv_keywords_hint);
tvClear = findViewById(R.id.tv_clear);
}
public void setKeywords(String keywords){
tvKeywords.setText(keywords);
}
public String getKeywords(){
if (TextUtils.isEmpty(tvKeywords.getText())){
return "";
}
else{
return tvKeywords.getText().toString();
}
}
/**
* 退格
*/
private void backspace(TextView textView){
String text = textView.getText().toString();
if (text.length() > 0){
text = text.substring(0, text.length() - 1);
textView.setText(text);
}
}
@BindingAdapter("keywords")
public static void setKeywords(EnglishAndNumberKeyboard view, String keywords){
view.setKeywords(keywords);
}
@InverseBindingAdapter(attribute = "keywords", event = "keywordsAttrChanged")
public static String getKeywords(EnglishAndNumberKeyboard view){
return view.getKeywords();
}
@BindingAdapter(value = "keywordsAttrChanged")
public static void setKeywordsChanged(EnglishAndNumberKeyboard view, InverseBindingListener listener){
if (listener != null){
inverseBindingListener = listener;
}
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
inverseBindingListener = null;
tvKeywords.removeTextChangedListener(watcher);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/dp_10"/>
<solid android:color="@color/gray_999999"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/orange_e49940"/>
<corners android:radius="@dimen/dp_10"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/gray_999999" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/black_333b4b" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/gray_999999" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/blue_2C5988" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/gray_999999" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/orange_e49940" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/gray_999999" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/red_c44032" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_10"/>
<solid android:color="@color/gray_999999" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_10"/>
<solid android:color="@color/black_333b4b" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_10"/>
<solid android:color="@color/gray_999999" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<corners android:radius="@dimen/dp_10"/>
<solid android:color="@color/white" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/gray_999999" />
<corners android:radius="@dimen/dp_16"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius="@dimen/dp_16"/>
</shape>
</item>
</selector>
\ No newline at end of file
This diff is collapsed.
......@@ -390,11 +390,13 @@
<dimen name="dp_480">455.1111dp</dimen>
<dimen name="dp_492">466.4889dp</dimen>
<dimen name="dp_500">474.0741dp</dimen>
<dimen name="dp_540">512.0000dp</dimen>
<dimen name="dp_590">559.4074dp</dimen>
<dimen name="dp_600">568.8889dp</dimen>
<dimen name="dp_640">606.8148dp</dimen>
<dimen name="dp_690">654.2222dp</dimen>
<dimen name="dp_700">663.7037dp</dimen>
<dimen name="dp_720">682.6667dp</dimen>
<dimen name="dp_760">720.5926dp</dimen>
<dimen name="dp_784">743.3481dp</dimen>
<dimen name="dp_822">779.3778dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">480.0000dp</dimen>
<dimen name="dp_492">492.0000dp</dimen>
<dimen name="dp_500">500.0000dp</dimen>
<dimen name="dp_540">540.0000dp</dimen>
<dimen name="dp_590">590.0000dp</dimen>
<dimen name="dp_600">600.0000dp</dimen>
<dimen name="dp_640">640.0000dp</dimen>
<dimen name="dp_690">690.0000dp</dimen>
<dimen name="dp_700">700.0000dp</dimen>
<dimen name="dp_720">720.0000dp</dimen>
<dimen name="dp_760">760.0000dp</dimen>
<dimen name="dp_784">784.0000dp</dimen>
<dimen name="dp_822">822.0000dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">568.8889dp</dimen>
<dimen name="dp_492">583.1111dp</dimen>
<dimen name="dp_500">592.5926dp</dimen>
<dimen name="dp_540">640.0000dp</dimen>
<dimen name="dp_590">699.2593dp</dimen>
<dimen name="dp_600">711.1111dp</dimen>
<dimen name="dp_640">758.5185dp</dimen>
<dimen name="dp_690">817.7778dp</dimen>
<dimen name="dp_700">829.6296dp</dimen>
<dimen name="dp_720">853.3333dp</dimen>
<dimen name="dp_760">900.7407dp</dimen>
<dimen name="dp_784">929.1852dp</dimen>
<dimen name="dp_822">974.2222dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">606.6667dp</dimen>
<dimen name="dp_492">621.8333dp</dimen>
<dimen name="dp_500">631.9444dp</dimen>
<dimen name="dp_540">682.5000dp</dimen>
<dimen name="dp_590">745.6944dp</dimen>
<dimen name="dp_600">758.3333dp</dimen>
<dimen name="dp_640">808.8889dp</dimen>
<dimen name="dp_690">872.0833dp</dimen>
<dimen name="dp_700">884.7222dp</dimen>
<dimen name="dp_720">910.0000dp</dimen>
<dimen name="dp_760">960.5556dp</dimen>
<dimen name="dp_784">990.8889dp</dimen>
<dimen name="dp_822">1038.9167dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">106.6667dp</dimen>
<dimen name="dp_492">109.3333dp</dimen>
<dimen name="dp_500">111.1111dp</dimen>
<dimen name="dp_540">120.0000dp</dimen>
<dimen name="dp_590">131.1111dp</dimen>
<dimen name="dp_600">133.3333dp</dimen>
<dimen name="dp_640">142.2222dp</dimen>
<dimen name="dp_690">153.3333dp</dimen>
<dimen name="dp_700">155.5556dp</dimen>
<dimen name="dp_720">160.0000dp</dimen>
<dimen name="dp_760">168.8889dp</dimen>
<dimen name="dp_784">174.2222dp</dimen>
<dimen name="dp_822">182.6667dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">142.2222dp</dimen>
<dimen name="dp_492">145.7778dp</dimen>
<dimen name="dp_500">148.1481dp</dimen>
<dimen name="dp_540">160.0000dp</dimen>
<dimen name="dp_590">174.8148dp</dimen>
<dimen name="dp_600">177.7778dp</dimen>
<dimen name="dp_640">189.6296dp</dimen>
<dimen name="dp_690">204.4444dp</dimen>
<dimen name="dp_700">207.4074dp</dimen>
<dimen name="dp_720">213.3333dp</dimen>
<dimen name="dp_760">225.1852dp</dimen>
<dimen name="dp_784">232.2963dp</dimen>
<dimen name="dp_822">243.5556dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">170.6667dp</dimen>
<dimen name="dp_492">174.9333dp</dimen>
<dimen name="dp_500">177.7778dp</dimen>
<dimen name="dp_540">192.0000dp</dimen>
<dimen name="dp_590">209.7778dp</dimen>
<dimen name="dp_600">213.3333dp</dimen>
<dimen name="dp_640">227.5556dp</dimen>
<dimen name="dp_690">245.3333dp</dimen>
<dimen name="dp_700">248.8889dp</dimen>
<dimen name="dp_720">256.0000dp</dimen>
<dimen name="dp_760">270.2222dp</dimen>
<dimen name="dp_784">278.7556dp</dimen>
<dimen name="dp_822">292.2667dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">174.2222dp</dimen>
<dimen name="dp_492">178.5778dp</dimen>
<dimen name="dp_500">181.4815dp</dimen>
<dimen name="dp_540">196.0000dp</dimen>
<dimen name="dp_590">214.1481dp</dimen>
<dimen name="dp_600">217.7778dp</dimen>
<dimen name="dp_640">232.2963dp</dimen>
<dimen name="dp_690">250.4444dp</dimen>
<dimen name="dp_700">254.0741dp</dimen>
<dimen name="dp_720">261.3333dp</dimen>
<dimen name="dp_760">275.8519dp</dimen>
<dimen name="dp_784">284.5630dp</dimen>
<dimen name="dp_822">298.3556dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">177.7778dp</dimen>
<dimen name="dp_492">182.2222dp</dimen>
<dimen name="dp_500">185.1852dp</dimen>
<dimen name="dp_540">200.0000dp</dimen>
<dimen name="dp_590">218.5185dp</dimen>
<dimen name="dp_600">222.2222dp</dimen>
<dimen name="dp_640">237.0370dp</dimen>
<dimen name="dp_690">255.5556dp</dimen>
<dimen name="dp_700">259.2593dp</dimen>
<dimen name="dp_720">266.6667dp</dimen>
<dimen name="dp_760">281.4815dp</dimen>
<dimen name="dp_784">290.3704dp</dimen>
<dimen name="dp_822">304.4444dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">182.2222dp</dimen>
<dimen name="dp_492">186.7778dp</dimen>
<dimen name="dp_500">189.8148dp</dimen>
<dimen name="dp_540">205.0000dp</dimen>
<dimen name="dp_590">223.9815dp</dimen>
<dimen name="dp_600">227.7778dp</dimen>
<dimen name="dp_640">242.9630dp</dimen>
<dimen name="dp_690">261.9444dp</dimen>
<dimen name="dp_700">265.7407dp</dimen>
<dimen name="dp_720">273.3333dp</dimen>
<dimen name="dp_760">288.5185dp</dimen>
<dimen name="dp_784">297.6296dp</dimen>
<dimen name="dp_822">312.0556dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">182.6667dp</dimen>
<dimen name="dp_492">187.2333dp</dimen>
<dimen name="dp_500">190.2778dp</dimen>
<dimen name="dp_540">205.5000dp</dimen>
<dimen name="dp_590">224.5278dp</dimen>
<dimen name="dp_600">228.3333dp</dimen>
<dimen name="dp_640">243.5556dp</dimen>
<dimen name="dp_690">262.5833dp</dimen>
<dimen name="dp_700">266.3889dp</dimen>
<dimen name="dp_720">274.0000dp</dimen>
<dimen name="dp_760">289.2222dp</dimen>
<dimen name="dp_784">298.3556dp</dimen>
<dimen name="dp_822">312.8167dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">192.0000dp</dimen>
<dimen name="dp_492">196.8000dp</dimen>
<dimen name="dp_500">200.0000dp</dimen>
<dimen name="dp_540">216.0000dp</dimen>
<dimen name="dp_590">236.0000dp</dimen>
<dimen name="dp_600">240.0000dp</dimen>
<dimen name="dp_640">256.0000dp</dimen>
<dimen name="dp_690">276.0000dp</dimen>
<dimen name="dp_700">280.0000dp</dimen>
<dimen name="dp_720">288.0000dp</dimen>
<dimen name="dp_760">304.0000dp</dimen>
<dimen name="dp_784">313.6000dp</dimen>
<dimen name="dp_822">328.8000dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">213.3333dp</dimen>
<dimen name="dp_492">218.6667dp</dimen>
<dimen name="dp_500">222.2222dp</dimen>
<dimen name="dp_540">240.0000dp</dimen>
<dimen name="dp_590">262.2222dp</dimen>
<dimen name="dp_600">266.6667dp</dimen>
<dimen name="dp_640">284.4444dp</dimen>
<dimen name="dp_690">306.6667dp</dimen>
<dimen name="dp_700">311.1111dp</dimen>
<dimen name="dp_720">320.0000dp</dimen>
<dimen name="dp_760">337.7778dp</dimen>
<dimen name="dp_784">348.4444dp</dimen>
<dimen name="dp_822">365.3333dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">236.8889dp</dimen>
<dimen name="dp_492">242.8111dp</dimen>
<dimen name="dp_500">246.7593dp</dimen>
<dimen name="dp_540">266.5000dp</dimen>
<dimen name="dp_590">291.1759dp</dimen>
<dimen name="dp_600">296.1111dp</dimen>
<dimen name="dp_640">315.8519dp</dimen>
<dimen name="dp_690">340.5278dp</dimen>
<dimen name="dp_700">345.4630dp</dimen>
<dimen name="dp_720">355.3333dp</dimen>
<dimen name="dp_760">375.0741dp</dimen>
<dimen name="dp_784">386.9185dp</dimen>
<dimen name="dp_822">405.6722dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">263.1111dp</dimen>
<dimen name="dp_492">269.6889dp</dimen>
<dimen name="dp_500">274.0741dp</dimen>
<dimen name="dp_540">296.0000dp</dimen>
<dimen name="dp_590">323.4074dp</dimen>
<dimen name="dp_600">328.8889dp</dimen>
<dimen name="dp_640">350.8148dp</dimen>
<dimen name="dp_690">378.2222dp</dimen>
<dimen name="dp_700">383.7037dp</dimen>
<dimen name="dp_720">394.6667dp</dimen>
<dimen name="dp_760">416.5926dp</dimen>
<dimen name="dp_784">429.7481dp</dimen>
<dimen name="dp_822">450.5778dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">266.6667dp</dimen>
<dimen name="dp_492">273.3333dp</dimen>
<dimen name="dp_500">277.7778dp</dimen>
<dimen name="dp_540">300.0000dp</dimen>
<dimen name="dp_590">327.7778dp</dimen>
<dimen name="dp_600">333.3333dp</dimen>
<dimen name="dp_640">355.5556dp</dimen>
<dimen name="dp_690">383.3333dp</dimen>
<dimen name="dp_700">388.8889dp</dimen>
<dimen name="dp_720">400.0000dp</dimen>
<dimen name="dp_760">422.2222dp</dimen>
<dimen name="dp_784">435.5556dp</dimen>
<dimen name="dp_822">456.6667dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">275.5556dp</dimen>
<dimen name="dp_492">282.4444dp</dimen>
<dimen name="dp_500">287.0370dp</dimen>
<dimen name="dp_540">310.0000dp</dimen>
<dimen name="dp_590">338.7037dp</dimen>
<dimen name="dp_600">344.4444dp</dimen>
<dimen name="dp_640">367.4074dp</dimen>
<dimen name="dp_690">396.1111dp</dimen>
<dimen name="dp_700">401.8519dp</dimen>
<dimen name="dp_720">413.3333dp</dimen>
<dimen name="dp_760">436.2963dp</dimen>
<dimen name="dp_784">450.0741dp</dimen>
<dimen name="dp_822">471.8889dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">284.4444dp</dimen>
<dimen name="dp_492">291.5556dp</dimen>
<dimen name="dp_500">296.2963dp</dimen>
<dimen name="dp_540">320.0000dp</dimen>
<dimen name="dp_590">349.6296dp</dimen>
<dimen name="dp_600">355.5556dp</dimen>
<dimen name="dp_640">379.2593dp</dimen>
<dimen name="dp_690">408.8889dp</dimen>
<dimen name="dp_700">414.8148dp</dimen>
<dimen name="dp_720">426.6667dp</dimen>
<dimen name="dp_760">450.3704dp</dimen>
<dimen name="dp_784">464.5926dp</dimen>
<dimen name="dp_822">487.1111dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">294.2222dp</dimen>
<dimen name="dp_492">301.5778dp</dimen>
<dimen name="dp_500">306.4815dp</dimen>
<dimen name="dp_540">331.0000dp</dimen>
<dimen name="dp_590">361.6481dp</dimen>
<dimen name="dp_600">367.7778dp</dimen>
<dimen name="dp_640">392.2963dp</dimen>
<dimen name="dp_690">422.9444dp</dimen>
<dimen name="dp_700">429.0741dp</dimen>
<dimen name="dp_720">441.3333dp</dimen>
<dimen name="dp_760">465.8519dp</dimen>
<dimen name="dp_784">480.5630dp</dimen>
<dimen name="dp_822">503.8556dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">320.0000dp</dimen>
<dimen name="dp_492">328.0000dp</dimen>
<dimen name="dp_500">333.3333dp</dimen>
<dimen name="dp_540">360.0000dp</dimen>
<dimen name="dp_590">393.3333dp</dimen>
<dimen name="dp_600">400.0000dp</dimen>
<dimen name="dp_640">426.6667dp</dimen>
<dimen name="dp_690">460.0000dp</dimen>
<dimen name="dp_700">466.6667dp</dimen>
<dimen name="dp_720">480.0000dp</dimen>
<dimen name="dp_760">506.6667dp</dimen>
<dimen name="dp_784">522.6667dp</dimen>
<dimen name="dp_822">548.0000dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">341.3333dp</dimen>
<dimen name="dp_492">349.8667dp</dimen>
<dimen name="dp_500">355.5556dp</dimen>
<dimen name="dp_540">384.0000dp</dimen>
<dimen name="dp_590">419.5556dp</dimen>
<dimen name="dp_600">426.6667dp</dimen>
<dimen name="dp_640">455.1111dp</dimen>
<dimen name="dp_690">490.6667dp</dimen>
<dimen name="dp_700">497.7778dp</dimen>
<dimen name="dp_720">512.0000dp</dimen>
<dimen name="dp_760">540.4444dp</dimen>
<dimen name="dp_784">557.5111dp</dimen>
<dimen name="dp_822">584.5333dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">355.5556dp</dimen>
<dimen name="dp_492">364.4444dp</dimen>
<dimen name="dp_500">370.3704dp</dimen>
<dimen name="dp_540">400.0000dp</dimen>
<dimen name="dp_590">437.0370dp</dimen>
<dimen name="dp_600">444.4444dp</dimen>
<dimen name="dp_640">474.0741dp</dimen>
<dimen name="dp_690">511.1111dp</dimen>
<dimen name="dp_700">518.5185dp</dimen>
<dimen name="dp_720">533.3333dp</dimen>
<dimen name="dp_760">562.9630dp</dimen>
<dimen name="dp_784">580.7407dp</dimen>
<dimen name="dp_822">608.8889dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">360.4444dp</dimen>
<dimen name="dp_492">369.4556dp</dimen>
<dimen name="dp_500">375.4630dp</dimen>
<dimen name="dp_540">405.5000dp</dimen>
<dimen name="dp_590">443.0463dp</dimen>
<dimen name="dp_600">450.5556dp</dimen>
<dimen name="dp_640">480.5926dp</dimen>
<dimen name="dp_690">518.1389dp</dimen>
<dimen name="dp_700">525.6481dp</dimen>
<dimen name="dp_720">540.6667dp</dimen>
<dimen name="dp_760">570.7037dp</dimen>
<dimen name="dp_784">588.7259dp</dimen>
<dimen name="dp_822">617.2611dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">364.4444dp</dimen>
<dimen name="dp_492">373.5556dp</dimen>
<dimen name="dp_500">379.6296dp</dimen>
<dimen name="dp_540">410.0000dp</dimen>
<dimen name="dp_590">447.9630dp</dimen>
<dimen name="dp_600">455.5556dp</dimen>
<dimen name="dp_640">485.9259dp</dimen>
<dimen name="dp_690">523.8889dp</dimen>
<dimen name="dp_700">531.4815dp</dimen>
<dimen name="dp_720">546.6667dp</dimen>
<dimen name="dp_760">577.0370dp</dimen>
<dimen name="dp_784">595.2593dp</dimen>
<dimen name="dp_822">624.1111dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">400.0000dp</dimen>
<dimen name="dp_492">410.0000dp</dimen>
<dimen name="dp_500">416.6667dp</dimen>
<dimen name="dp_540">450.0000dp</dimen>
<dimen name="dp_590">491.6667dp</dimen>
<dimen name="dp_600">500.0000dp</dimen>
<dimen name="dp_640">533.3333dp</dimen>
<dimen name="dp_690">575.0000dp</dimen>
<dimen name="dp_700">583.3333dp</dimen>
<dimen name="dp_720">600.0000dp</dimen>
<dimen name="dp_760">633.3333dp</dimen>
<dimen name="dp_784">653.3333dp</dimen>
<dimen name="dp_822">685.0000dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">426.6667dp</dimen>
<dimen name="dp_492">437.3333dp</dimen>
<dimen name="dp_500">444.4444dp</dimen>
<dimen name="dp_540">480.0000dp</dimen>
<dimen name="dp_590">524.4444dp</dimen>
<dimen name="dp_600">533.3333dp</dimen>
<dimen name="dp_640">568.8889dp</dimen>
<dimen name="dp_690">613.3333dp</dimen>
<dimen name="dp_700">622.2222dp</dimen>
<dimen name="dp_720">640.0000dp</dimen>
<dimen name="dp_760">675.5556dp</dimen>
<dimen name="dp_784">696.8889dp</dimen>
<dimen name="dp_822">730.6667dp</dimen>
......
......@@ -390,11 +390,13 @@
<dimen name="dp_480">427.1111dp</dimen>
<dimen name="dp_492">437.7889dp</dimen>
<dimen name="dp_500">444.9074dp</dimen>
<dimen name="dp_540">480.5000dp</dimen>
<dimen name="dp_590">524.9907dp</dimen>
<dimen name="dp_600">533.8889dp</dimen>
<dimen name="dp_640">569.4815dp</dimen>
<dimen name="dp_690">613.9722dp</dimen>
<dimen name="dp_700">622.8704dp</dimen>
<dimen name="dp_720">640.6667dp</dimen>
<dimen name="dp_760">676.2593dp</dimen>
<dimen name="dp_784">697.6148dp</dimen>
<dimen name="dp_822">731.4278dp</dimen>
......
......@@ -13,6 +13,7 @@
<color name="black_41424a">#41424A</color>
<color name="black_3c4a55">#3C4A55</color>
<color name="black_414141">#414141</color>
<color name="black_272E3D">#272E3D</color>
<!--灰色-->
<color name="gray_999999">#999999</color>
<color name="gray_e9e9e9">#e9e9e9</color>
......@@ -54,6 +55,7 @@
<color name="blue">#0000FF</color>
<color name="blue_17598c">#17598C</color>
<color name="blue_559DF1">#559DF1</color>
<color name="blue_2C5988">#2C5988</color>
<!--绿色-->
<color name="green">#00FF00</color>
<color name="green_03dac5">#03DAC5</color>
......
......@@ -392,11 +392,13 @@
<dimen name="dp_480">480dp</dimen>
<dimen name="dp_492">492dp</dimen>
<dimen name="dp_500">500dp</dimen>
<dimen name="dp_540">540dp</dimen>
<dimen name="dp_590">590dp</dimen>
<dimen name="dp_600">600dp</dimen>
<dimen name="dp_640">640dp</dimen>
<dimen name="dp_690">690dp</dimen>
<dimen name="dp_700">700dp</dimen>
<dimen name="dp_720">720dp</dimen>
<dimen name="dp_760">760dp</dimen>
<dimen name="dp_784">784dp</dimen>
<dimen name="dp_822">822dp</dimen>
......
......@@ -18,4 +18,61 @@
<string name="please_confirm_whether_quit">请确认是否关闭页面</string>
<string name="please_check_input">请检查输入内容</string>
<string name="please_enter_keywords">关键词搜索</string>
<string name="search">搜索</string>
<string name="learned_history">学习记录</string>
<string name="empty">清空</string>
<string name="re_detect">重新识别</string>
<string name="save">保存</string>
<string name="camera_opening">相机启动中…</string>
<string name="camera_open_error">相机启动异常</string>
<string name="please_select_correct_goods_for_every_rect">请为照片中的每个框对应正确的商品</string>
<string name="key_1">1</string>
<string name="key_2">2</string>
<string name="key_3">3</string>
<string name="key_4">4</string>
<string name="key_5">5</string>
<string name="key_6">6</string>
<string name="key_7">7</string>
<string name="key_8">8</string>
<string name="key_9">9</string>
<string name="key_0">0</string>
<string name="key_q">Q</string>
<string name="key_w">W</string>
<string name="key_e">E</string>
<string name="key_r">R</string>
<string name="key_t">T</string>
<string name="key_y">Y</string>
<string name="key_u">U</string>
<string name="key_i">I</string>
<string name="key_o">O</string>
<string name="key_p">P</string>
<string name="key_a">A</string>
<string name="key_s">S</string>
<string name="key_d">D</string>
<string name="key_f">F</string>
<string name="key_g">G</string>
<string name="key_h">H</string>
<string name="key_j">J</string>
<string name="key_k">K</string>
<string name="key_l">L</string>
<string name="key_z">Z</string>
<string name="key_x">X</string>
<string name="key_c">C</string>
<string name="key_v">V</string>
<string name="key_b">B</string>
<string name="key_n">N</string>
<string name="key_m">M</string>
<string name="key_delete_1"></string>
<string name="key_delete_2">退格</string>
<string name="no_data">暂无数据</string>
<string name="previous_page">上一页</string>
<string name="next_page">下一页</string>
<string name="page_number">第 %s 页\u0020\u0020\u0020\u0020共 %s 页</string>
</resources>
\ No newline at end of file
......@@ -261,6 +261,26 @@
<item name="android:layout_marginStart">@dimen/dp_14</item>
</style>
<!--TextView 键盘按钮-->
<style name="text_base.keyboard_button">
<item name="android:layout_width">0dp</item>
<item name="android:textSize">@dimen/sp_40</item>
<item name="android:textColor">@color/white</item>
<item name="android:gravity">center</item>
<item name="android:textStyle">bold</item>
<item name="android:paddingTop">@dimen/dp_15</item>
<item name="android:paddingBottom">@dimen/dp_15</item>
<item name="android:layout_marginStart">@dimen/dp_4</item>
<item name="android:layout_marginEnd">@dimen/dp_4</item>
<item name="android:background">@drawable/sel_rect_0_black_gray</item>
</style>
<!--TextView 键盘按钮 红色-->
<style name="text_base.keyboard_button.red">
<item name="android:textSize">@dimen/sp_40</item>
<item name="android:background">@drawable/sel_rect_0_red_gray</item>
</style>
<!--TextView 角标-->
<style name="text_base.subscript">
<item name="android:textSize">@dimen/sp_22</item>
......
......@@ -31,6 +31,9 @@ public class CoreModule {
TargetDetectionManager.getInstance().initTargetDetection();
// 初始化视频流
VideoPipeManager.getInstance().initVideoPipe();
// todo 初始化索引库
// todo 初始化特征对比库
}
public static Context getAppContext() {
......
......@@ -68,4 +68,7 @@ dependencies {
implementation "androidx.room:room-paging:$room_version"
// mmkv
implementation 'com.tencent:mmkv:1.3.0'
implementation "org.mapstruct:mapstruct:1.5.2.Final"
annotationProcessor "org.mapstruct:mapstruct-processor:1.5.2.Final"
}
\ No newline at end of file
......@@ -11,9 +11,11 @@ import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteOpenHelper;
import com.wmdigit.data.database.dao.IngredientDao;
import com.wmdigit.data.database.dao.ProductsDao;
import com.wmdigit.data.database.dao.SetMenuAndIngredientDao;
import com.wmdigit.data.database.dao.SetMenuDao;
import com.wmdigit.data.database.entity.Ingredient;
import com.wmdigit.data.database.entity.ProductsPO;
import com.wmdigit.data.database.entity.SetMenu;
import com.wmdigit.data.database.entity.SetMenuAndIngredient;
......@@ -21,9 +23,7 @@ import com.wmdigit.data.database.entity.SetMenuAndIngredient;
* @author dizi
*/
@Database(entities = {
SetMenu.class,
Ingredient.class,
SetMenuAndIngredient.class
ProductsPO.class
},
version = 1,
exportSchema = false)
......@@ -73,6 +73,12 @@ public abstract class AppDatabase extends RoomDatabase {
*/
public abstract SetMenuAndIngredientDao getSetMenuAndIngredientDao();
/**
* 获取商品表DAO
* @return
*/
public abstract ProductsDao getProductsDao();
@Override
public void clearAllTables() {
......
package com.wmdigit.data.database.base;
import androidx.room.Ignore;
/**
* PO基类
* @author dizi
*/
public class BasePO {
/**
* 创建时间戳
*/
private long createTime;
/**
* 更新时间戳
*/
private long updateTime;
public BasePO() {
}
@Ignore
public BasePO(long createTime, long updateTime) {
this.createTime = createTime;
this.updateTime = updateTime;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
public long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(long updateTime) {
this.updateTime = updateTime;
}
}
package com.wmdigit.data.database.dao;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import com.wmdigit.data.database.entity.ProductsPO;
import java.util.List;
/**
* 商品DAO
* @author dizi
*/
@Dao
public interface ProductsDao {
/**
* 批量插入
* @param list
*/
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertBatch(List<ProductsPO> list);
/**
* 查询全部数据
* @return
*/
@Query("SELECT * FROM Products")
List<ProductsPO> getAll();
/**
* 根据关键词获取总数
* @param keywords
* @return
*/
@Query("SELECT COUNT(*) FROM Products WHERE productMnemonicCode LIKE :keywords OR productCode LIKE :keywords")
int getCountByKeywords(String keywords);
/**
* 根据关键词查询商品信息
* @param keywords
* @param offset
* @param limit
* @return
*/
@Query("SELECT * FROM Products WHERE productMnemonicCode LIKE :keywords OR productCode LIKE :keywords LIMIT :offset, :limit")
List<ProductsPO> getProductsByKeywords(String keywords, int offset, int limit);
}
......@@ -16,10 +16,10 @@ public interface SetMenuAndIngredientDao {
* @param setMenuCodes
* @return
*/
@Query("SELECT setMenuCode FROM " +
"(SELECT setMenuCode, COUNT(*) AS result FROM SetMenuAndIngredient WHERE setMenuCode IN (:setMenuCodes) GROUP BY setMenuCode) " +
"AS subquery ORDER BY subquery.result")
List<String> orderSetMenusByIngredientCounts(String[] setMenuCodes);
// @Query("SELECT setMenuCode FROM " +
// "(SELECT setMenuCode, COUNT(*) AS result FROM SetMenuAndIngredient WHERE setMenuCode IN (:setMenuCodes) GROUP BY setMenuCode) " +
// "AS subquery ORDER BY subquery.result")
// List<String> orderSetMenusByIngredientCounts(String[] setMenuCodes);
/**
* 根据原料编码和对应数量查询
......@@ -27,8 +27,8 @@ public interface SetMenuAndIngredientDao {
* @param quantity
* @return
*/
@Query("SELECT setMenuCode FROM SetMenuAndIngredient WHERE ingredientCode = :ingredientCode AND quantity >= :quantity")
List<String> queryAllSetMenuByIngredientsAndQuantity(String ingredientCode, int quantity);
// @Query("SELECT setMenuCode FROM SetMenuAndIngredient WHERE ingredientCode = :ingredientCode AND quantity >= :quantity")
// List<String> queryAllSetMenuByIngredientsAndQuantity(String ingredientCode, int quantity);
/**
* 根据原料编码和对应数量以及套餐编码查询
......@@ -37,6 +37,6 @@ public interface SetMenuAndIngredientDao {
* @param setMenuCodes
* @return
*/
@Query("SELECT setMenuCode FROM SetMenuAndIngredient WHERE ingredientCode = :ingredientCode AND quantity >= :quantity AND setMenuCode IN (:setMenuCodes)")
List<String> queryAllSetMenuByIngredientsAndQuantityAndSetMenuCode(String ingredientCode, int quantity, List<String> setMenuCodes);
// @Query("SELECT setMenuCode FROM SetMenuAndIngredient WHERE ingredientCode = :ingredientCode AND quantity >= :quantity AND setMenuCode IN (:setMenuCodes)")
// List<String> queryAllSetMenuByIngredientsAndQuantityAndSetMenuCode(String ingredientCode, int quantity, List<String> setMenuCodes);
}
......@@ -21,27 +21,27 @@ public interface SetMenuDao {
* @param ingredientCodesLength
* @return
*/
@Query("SELECT DISTINCT a.* FROM SetMenu a " +
"JOIN SetMenuAndIngredient b ON a.setMenuCode = b.setMenuCode " +
"JOIN Ingredient c ON b.ingredientCode = c.ingredientCode " +
"WHERE c.ingredientCode IN (:ingredientCodes) " +
"GROUP BY a.setMenuCode " +
"HAVING COUNT( DISTINCT c.ingredientCode ) >= :ingredientCodesLength")
List<SetMenu> queryAllSetMenuByIngredients(String[] ingredientCodes, int ingredientCodesLength);
// @Query("SELECT DISTINCT a.* FROM SetMenu a " +
// "JOIN SetMenuAndIngredient b ON a.setMenuCode = b.setMenuCode " +
// "JOIN Ingredient c ON b.ingredientCode = c.ingredientCode " +
// "WHERE c.ingredientCode IN (:ingredientCodes) " +
// "GROUP BY a.setMenuCode " +
// "HAVING COUNT( DISTINCT c.ingredientCode ) >= :ingredientCodesLength")
// List<SetMenu> queryAllSetMenuByIngredients(String[] ingredientCodes, int ingredientCodesLength);
/**
* 查询所有套餐
* @return
*/
@Query("SELECT * FROM SetMenu WHERE setMenuCode IN (:codes)")
List<SetMenu> queryAllSetMenuByCodes(List<String> codes);
// @Query("SELECT * FROM SetMenu WHERE setMenuCode IN (:codes)")
// List<SetMenu> queryAllSetMenuByCodes(List<String> codes);
/**
* 根据编码查询套餐
* @param setMenuCode
* @return
*/
@Query("SELECT * FROM SetMenu where setMenuCode = :setMenuCode")
SetMenu querySetMenuByCode(String setMenuCode);
// @Query("SELECT * FROM SetMenu where setMenuCode = :setMenuCode")
// SetMenu querySetMenuByCode(String setMenuCode);
}
package com.wmdigit.data.database.entity;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import com.wmdigit.data.database.base.BasePO;
/**
* 商品表实体类
* @author dizi
*/
@Entity(tableName = "Products", indices = {
@Index(value = "productCode", unique = true),
@Index(value = "productMnemonicCode", unique = false)
})
public class ProductsPO{
@PrimaryKey(autoGenerate = true)
private long id;
/**
* 商品名称
*/
private String productName;
/**
* 商品编码
*/
private String productCode;
/**
* 助记码(中文名拼音缩写)
*/
private String productMnemonicCode;
/**
* 单价
*/
private String unitPrice;
/**
* 在售状态,1:在售 0:下架
*/
private int onSale;
public ProductsPO() {
super();
}
@Ignore
public ProductsPO(long id, String productName, String productCode, String productMnemonicCode, String unitPrice, int onSale) {
this.id = id;
this.productName = productName;
this.productCode = productCode;
this.productMnemonicCode = productMnemonicCode;
this.unitPrice = unitPrice;
this.onSale = onSale;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getProductName() {
return productName;
}
public void setProductName(String productName) {
this.productName = productName;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
public String getProductMnemonicCode() {
return productMnemonicCode;
}
public void setProductMnemonicCode(String productMnemonicCode) {
this.productMnemonicCode = productMnemonicCode;
}
public String getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(String unitPrice) {
this.unitPrice = unitPrice;
}
public int getOnSale() {
return onSale;
}
public void setOnSale(int onSale) {
this.onSale = onSale;
}
}
package com.wmdigit.data.database.mapper;
import com.wmdigit.common.model.ProductsDTO;
import com.wmdigit.common.model.ProductsVO;
import com.wmdigit.data.database.entity.ProductsPO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import java.util.List;
/**
* Products转换器
* @author dizi
*/
@Mapper
public interface ProductsMapper {
ProductsMapper INSTANCE = Mappers.getMapper(ProductsMapper.class);
/**
* ProductsList dto=>po
* @param dtoList
* @return
*/
List<ProductsPO> toPoList(List<ProductsDTO> dtoList);
List<ProductsVO> toVoList(List<ProductsPO> poList);
}
package com.wmdigit.data.database.repository;
import com.wmdigit.common.model.ProductsDTO;
import com.wmdigit.common.model.ProductsVO;
import com.wmdigit.data.database.AppDatabase;
import com.wmdigit.data.database.dao.ProductsDao;
import com.wmdigit.data.database.entity.ProductsPO;
import com.wmdigit.data.database.mapper.ProductsMapper;
import java.util.ArrayList;
import java.util.List;
/**
* 商品表Repository
* @author dizi
*/
public class ProductsRepository {
private static volatile ProductsRepository instance;
public static ProductsRepository getInstance() {
if (instance == null){
synchronized (ProductsRepository.class){
if (instance == null){
instance = new ProductsRepository();
}
}
}
return instance;
}
private ProductsDao getProductsDao(){
return AppDatabase.getInstance().getProductsDao();
}
/**
* 批量插入
* @param products
*/
public void insertBatch(List<ProductsDTO> products){
getProductsDao().insertBatch(ProductsMapper.INSTANCE.toPoList(products));
}
/**
* 查询所有数据
* @return
*/
public List<ProductsVO> queryAll(){
return ProductsMapper.INSTANCE.toVoList(getProductsDao().getAll());
}
/**
* 获取商品总数
* @param keywords
* @return
*/
public int queryCount(String keywords){
keywords = "%" + keywords + "%";
return getProductsDao().getCountByKeywords(keywords);
}
/**
* 根据关键词查询
* @param keywords
* @param page
* @param pageSize
* @return
*/
public List<ProductsVO> queryByKeywords(String keywords, int page, int pageSize){
int offset = (page - 1) * pageSize;
List<ProductsPO> result = getProductsDao().getProductsByKeywords("%" + keywords + "%", offset, pageSize);
if (result == null){
result = new ArrayList<>();
}
return ProductsMapper.INSTANCE.toVoList(result);
}
}
......@@ -43,7 +43,8 @@ public class SetMenuAndIngredientRepository {
* @return
*/
public SetMenu querySetMenuByCode(String setMenuCode){
return getSetMenuDao().querySetMenuByCode(setMenuCode);
return null;
// return getSetMenuDao().querySetMenuByCode(setMenuCode);
}
/**
......@@ -59,18 +60,18 @@ public class SetMenuAndIngredientRepository {
AtomicInteger index = new AtomicInteger();
map.forEach((key, value) -> {
if (index.get() == 0){
filteredSetMenuCodes.addAll(getSetMenuAndIngredientDao().queryAllSetMenuByIngredientsAndQuantity(key, Math.toIntExact(value)));
// filteredSetMenuCodes.addAll(getSetMenuAndIngredientDao().queryAllSetMenuByIngredientsAndQuantity(key, Math.toIntExact(value)));
}
else{
List<String> temp = getSetMenuAndIngredientDao().queryAllSetMenuByIngredientsAndQuantityAndSetMenuCode(key, Math.toIntExact(value), filteredSetMenuCodes);
filteredSetMenuCodes.clear();
filteredSetMenuCodes.addAll(temp);
// List<String> temp = getSetMenuAndIngredientDao().queryAllSetMenuByIngredientsAndQuantityAndSetMenuCode(key, Math.toIntExact(value), filteredSetMenuCodes);
// filteredSetMenuCodes.clear();
// filteredSetMenuCodes.addAll(temp);
}
index.getAndIncrement();
});
List<SetMenu> result = new ArrayList<>();
if (filteredSetMenuCodes.size() > 0){
result.addAll(getSetMenuDao().queryAllSetMenuByCodes(filteredSetMenuCodes));
// result.addAll(getSetMenuDao().queryAllSetMenuByCodes(filteredSetMenuCodes));
}
return result;
......@@ -82,6 +83,7 @@ public class SetMenuAndIngredientRepository {
* @return
*/
public List<String> orderSetMenusByIngredientCounts(String[] setMenuCodes){
return getSetMenuAndIngredientDao().orderSetMenusByIngredientCounts(setMenuCodes);
// return getSetMenuAndIngredientDao().orderSetMenusByIngredientCounts(setMenuCodes);
return null;
}
}
package com.wmdigit.data.mmkv.repository;
import com.elvishew.xlog.XLog;
import com.tencent.mmkv.MMKV;
import com.wmdigit.common.model.CropValue;
import com.wmdigit.common.model.CropValueDTO;
import com.wmdigit.data.mmkv.constant.MmkvCons;
/**
......@@ -36,7 +35,7 @@ public class CropLocalRepository {
* 保存裁剪坐标
* @param value
*/
public void saveCropValue(CropValue value){
public void saveCropValue(CropValueDTO value){
MMKV.defaultMMKV().putInt(MmkvCons.MMKV_KEY_CROP_WIDTH, value.getWidth());
MMKV.defaultMMKV().putInt(MmkvCons.MMKV_KEY_CROP_HEIGHT, value.getHeight());
MMKV.defaultMMKV().putInt(MmkvCons.MMKV_KEY_CROP_X, value.getLeft());
......@@ -47,8 +46,8 @@ public class CropLocalRepository {
* 获取裁剪坐标
* @return
*/
public CropValue getCropValue(){
CropValue value = new CropValue(
public CropValueDTO getCropValue(){
CropValueDTO value = new CropValueDTO(
MMKV.defaultMMKV().getInt(MmkvCons.MMKV_KEY_CROP_X, 0),
MMKV.defaultMMKV().getInt(MmkvCons.MMKV_KEY_CROP_Y, 0),
MMKV.defaultMMKV().getInt(MmkvCons.MMKV_KEY_CROP_WIDTH, 0),
......
......@@ -5,4 +5,6 @@ v1.0.2 2024/08/06 1.增加系统信息页
2.增加设置-注册页
3.对接注册、找回接口
4.增加秤盘裁剪页
5.todo 增加AIDL服务
\ No newline at end of file
5.增加数据管理页
6.增加学习页
7.增加AIDL服务
\ No newline at end of file
......@@ -17,6 +17,11 @@ public class DemoImagesDiffUtil extends BaseDiffUtil<DemoImageItem> {
super(oldList, newList);
}
@Override
protected boolean areItemsTheSame(DemoImageItem oldItem, DemoImageItem newItem) {
return false;
}
@Override
protected boolean checkContentsTheSame(DemoImageItem oldItem, DemoImageItem newItem) {
if (!oldItem.getImagePath().equals(newItem.getImagePath())){
......
......@@ -14,6 +14,11 @@ public class ShoppingCartDiffUtil extends BaseDiffUtil<ShoppingCartItem> {
super(oldList, newList);
}
@Override
protected boolean areItemsTheSame(ShoppingCartItem oldItem, ShoppingCartItem newItem) {
return false;
}
@Override
protected boolean checkContentsTheSame(ShoppingCartItem oldItem, ShoppingCartItem newItem) {
if (oldItem.getUnitPrice().compareTo(newItem.getUnitPrice()) != 0){
......
......@@ -6,13 +6,16 @@ import androidx.drawerlayout.widget.DrawerLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.elvishew.xlog.XLog;
import com.wmdigit.common.base.mvvm.BaseMvvmNaviDrawerActivity;
import com.wmdigit.common.constants.RouteConstant;
import com.wmdigit.common.model.DrawerMenuItemModel;
import com.wmdigit.common.model.DrawerMenuItemVO;
import com.wmdigit.common.model.ProductsDTO;
import com.wmdigit.data.database.entity.ProductsPO;
import com.wmdigit.data.database.repository.ProductsRepository;
import com.wmdigit.setting.databinding.ActivitySettingBinding;
import com.wmdigit.setting.viewmodel.SettingViewModel;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -40,6 +43,18 @@ public class SettingActivity extends BaseMvvmNaviDrawerActivity<SettingViewModel
@Override
protected void initData() {
// 测试
// List<ProductsDTO> list = new ArrayList<>();
// list.add(new ProductsDTO("西红柿炒鸡蛋","000323", "XHSCJD", "12.80", 1));
// list.add(new ProductsDTO("红烧茄子","000324", "HSQZ", "13.80", 1));
// list.add(new ProductsDTO("套餐A","000325", "TCA", "10.80", 1));
// list.add(new ProductsDTO("套餐B","000326", "TCB", "5.80", 1));
// list.add(new ProductsDTO("套餐C","000327", "TCC", "3.80", 1));
// list.add(new ProductsDTO("套餐D","000328", "TCD", "60.00", 1));
// list.add(new ProductsDTO("套餐E","000329", "TCF", "20.10", 1));
// ProductsRepository.getInstance().insertBatch(list);
//
// List<ProductsPO> a = ProductsRepository.getInstance().queryAll();
}
@Override
......@@ -86,7 +101,7 @@ public class SettingActivity extends BaseMvvmNaviDrawerActivity<SettingViewModel
}
@Override
protected List<DrawerMenuItemModel> getMenuData() {
protected List<DrawerMenuItemVO> getMenuData() {
// 初始化导航菜单
return mViewModel.getDrawerMenuItemModels();
}
......
package com.wmdigit.setting.adapter;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.wmdigit.common.base.adapter.BaseRecyclerViewAdapter;
import com.wmdigit.common.base.viewholder.BaseViewHolder;
import com.wmdigit.setting.R;
import com.wmdigit.setting.model.FuncButton;
import java.util.List;
/**
* 数据管理页功能按钮列表 适配器
* @author dizi
*/
public class FuncButtonAdapter extends BaseRecyclerViewAdapter<FuncButtonAdapter.ViewHolder, FuncButton> {
public FuncButtonAdapter(Context mContext, List<FuncButton> mList) {
super(mContext, mList);
}
@Override
protected int getItemLayoutResId() {
return R.layout.layout_data_manager_item;
}
@Override
protected ViewHolder createViewHolder(View itemView, BaseViewHolder.OnItemClickListener onItemClickListener) {
return new ViewHolder(itemView, onItemClickListener);
}
public static class ViewHolder extends BaseViewHolder<FuncButton>{
private ImageView icFuncButton;
private TextView tvFuncButton;
public ViewHolder(@NonNull View itemView, OnItemClickListener itemListener) {
super(itemView, itemListener);
icFuncButton = itemView.findViewById(R.id.ic_button);
tvFuncButton = itemView.findViewById(R.id.tv_function_name);
}
@Override
public void bind(FuncButton item) {
icFuncButton.setImageResource(item.getIconResId());
tvFuncButton.setText(item.getName());
}
}
}
package com.wmdigit.setting.adapter;
import android.content.Context;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.wmdigit.common.base.adapter.BaseDiffRecyclerViewAdapter;
import com.wmdigit.common.base.viewholder.BaseViewHolder;
import com.wmdigit.common.model.ProductsVO;
import com.wmdigit.setting.R;
import com.wmdigit.setting.adapter.diff.ProductsDiffUtil;
import java.util.List;
/**
* 商品列表适配器
* @author dizi
*/
public class ProductsAdapter extends BaseDiffRecyclerViewAdapter<ProductsAdapter.ViewHolder, ProductsVO, ProductsDiffUtil> {
public ProductsAdapter(Context mContext, List<ProductsVO> mList) {
super(mContext, mList);
}
@Override
protected ProductsDiffUtil createDiffUtil(List<ProductsVO> oldList, List<ProductsVO> newList) {
return new ProductsDiffUtil(oldList, newList);
}
@Override
protected int getItemLayoutResId() {
return R.layout.layout_product_item;
}
@Override
protected ViewHolder createViewHolder(View itemView, BaseViewHolder.OnItemClickListener onItemClickListener) {
return new ViewHolder(itemView, onItemClickListener);
}
public static class ViewHolder extends BaseViewHolder<ProductsVO>{
private TextView tvProductName, tvProductCode, tvProductPrice;
public ViewHolder(@NonNull View itemView, OnItemClickListener itemListener) {
super(itemView, itemListener);
tvProductName = itemView.findViewById(R.id.tv_product_name);
tvProductCode = itemView.findViewById(R.id.tv_product_code);
tvProductPrice = itemView.findViewById(R.id.tv_product_price);
}
@Override
public void bind(ProductsVO item) {
tvProductName.setText(item.getProductName());
tvProductCode.setText(item.getProductCode());
tvProductPrice.setText("¥" + item.getUnitPrice());
if (item.isChecked()){
}
else{
}
}
}
}
package com.wmdigit.setting.adapter.diff;
import com.wmdigit.common.base.diffutil.BaseDiffUtil;
import com.wmdigit.common.model.ProductsVO;
import java.util.List;
/**
* 商品列表比较器
* @author dizi
*/
public class ProductsDiffUtil extends BaseDiffUtil<ProductsVO> {
public ProductsDiffUtil(List<ProductsVO> oldList, List<ProductsVO> newList) {
super(oldList, newList);
}
@Override
protected boolean areItemsTheSame(ProductsVO oldItem, ProductsVO newItem) {
return oldItem.getProductCode().equals(newItem.getProductCode());
}
@Override
protected boolean checkContentsTheSame(ProductsVO oldItem, ProductsVO newItem) {
if (!oldItem.getProductCode().equals(newItem.getProductCode())){
return false;
}
if (oldItem.isChecked() != newItem.isChecked()){
return false;
}
return true;
}
}
package com.wmdigit.setting.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.lifecycle.Observer;
import androidx.recyclerview.widget.GridLayoutManager;
import com.wmdigit.common.base.mvvm.BaseMvvmFragment;
import com.wmdigit.setting.R;
import com.wmdigit.setting.adapter.ProductsAdapter;
import com.wmdigit.setting.databinding.FragmentDataLearningBinding;
import com.wmdigit.setting.viewmodel.DataLearningViewModel;
/**
* A simple {@link Fragment} subclass.
* Use the {@link DataLearningFragment#newInstance} factory method to
* create an instance of this fragment.
* 菜品页
* @author dizi
*/
public class DataLearningFragment extends Fragment {
public class DataLearningFragment extends BaseMvvmFragment<DataLearningViewModel, FragmentDataLearningBinding> {
private ProductsAdapter productsAdapter;
@Override
protected int getLayoutId() {
return R.layout.fragment_data_learning;
}
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
@Override
protected void initObserve() {
super.initObserve();
// 观察关键字变化
mViewModel.keywords.observe(this, keyword -> {
mViewModel.onKeywordsChangedEvent(keyword);
productsAdapter.diffAndUpdate();
});
// 观察页码变化
mViewModel.currentPage.observe(this, page -> {
mViewModel.onPageChangedEvent(page);
productsAdapter.diffAndUpdate();
});
}
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
@Override
protected void initView() {
mDataBinding.rvProducts.setLayoutManager(new GridLayoutManager(requireContext(), 4));
}
public DataLearningFragment() {
// Required empty public constructor
@Override
protected void initData() {
mDataBinding.setViewModel(mViewModel);
productsAdapter = new ProductsAdapter(requireContext(), mViewModel.products);
mDataBinding.rvProducts.setAdapter(productsAdapter);
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment DataLearningFragment.
*/
// TODO: Rename and change types and number of parameters
public static DataLearningFragment newInstance(String param1, String param2) {
DataLearningFragment fragment = new DataLearningFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
@Override
protected void initListener() {
// 注册商品列表Item点击事件
productsAdapter.setOnItemClickListener(position -> {
});
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
protected Class<DataLearningViewModel> getViewModel() {
return DataLearningViewModel.class;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_data_learning, container, false);
public void onDestroyView() {
super.onDestroyView();
productsAdapter = null;
}
}
\ No newline at end of file
package com.wmdigit.setting.fragment;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.GridLayoutManager;
import com.wmdigit.common.base.mvvm.BaseMvvmFragment;
import com.wmdigit.common.base.viewholder.BaseViewHolder;
import com.wmdigit.setting.R;
import com.wmdigit.setting.adapter.FuncButtonAdapter;
import com.wmdigit.setting.databinding.FragmentDataManagerBinding;
import com.wmdigit.setting.viewmodel.DataManagerViewModel;
/**
* A simple {@link Fragment} subclass.
* Use the {@link DataManagerFragment#newInstance} factory method to
* create an instance of this fragment.
* 数据管理页
* @author dizi
*/
public class DataManagerFragment extends Fragment {
public class DataManagerFragment extends BaseMvvmFragment<DataManagerViewModel, FragmentDataManagerBinding> {
// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
private static final String ARG_PARAM1 = "param1";
private static final String ARG_PARAM2 = "param2";
private FuncButtonAdapter adapter;
// TODO: Rename and change types of parameters
private String mParam1;
private String mParam2;
@Override
protected int getLayoutId() {
return R.layout.fragment_data_manager;
}
public DataManagerFragment() {
// Required empty public constructor
@Override
protected void initView() {
mDataBinding.rvDataManager.setLayoutManager(new GridLayoutManager(requireContext(), 6));
}
/**
* Use this factory method to create a new instance of
* this fragment using the provided parameters.
*
* @param param1 Parameter 1.
* @param param2 Parameter 2.
* @return A new instance of fragment DataManagerFragment.
*/
// TODO: Rename and change types and number of parameters
public static DataManagerFragment newInstance(String param1, String param2) {
DataManagerFragment fragment = new DataManagerFragment();
Bundle args = new Bundle();
args.putString(ARG_PARAM1, param1);
args.putString(ARG_PARAM2, param2);
fragment.setArguments(args);
return fragment;
@Override
protected void initData() {
// 初始化适配器
adapter = new FuncButtonAdapter(requireContext(), mViewModel.funcButtons);
adapter.setOnItemClickListener(position -> {
});
mDataBinding.rvDataManager.setAdapter(adapter);
}
@Override
protected void initListener() {
}
@Override
protected void initObserve() {
super.initObserve();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
mParam1 = getArguments().getString(ARG_PARAM1);
mParam2 = getArguments().getString(ARG_PARAM2);
}
protected Class<DataManagerViewModel> getViewModel() {
return DataManagerViewModel.class;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_data_manager, container, false);
public void onDestroyView() {
super.onDestroyView();
adapter = null;
}
}
\ No newline at end of file
package com.wmdigit.setting.model;
/**
* 功能按钮
* @author dizi
*/
public class FuncButton {
private String name;
private int iconResId;
public FuncButton(String name, int iconResId) {
this.name = name;
this.iconResId = iconResId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getIconResId() {
return iconResId;
}
public void setIconResId(int iconResId) {
this.iconResId = iconResId;
}
}
......@@ -9,7 +9,7 @@ import androidx.lifecycle.MutableLiveData;
import com.wmdigit.camera.listener.OnImageAnalyzeListener;
import com.wmdigit.common.base.mvvm.BaseViewModel;
import com.wmdigit.common.base.mvvm.SingleLiveEvent;
import com.wmdigit.common.model.CropValue;
import com.wmdigit.common.model.CropValueDTO;
import com.wmdigit.common.utils.ParcelHelper;
import com.wmdigit.data.mmkv.repository.CropLocalRepository;
......@@ -25,7 +25,7 @@ public class CameraCropViewModel extends BaseViewModel {
/**
* 裁剪坐标
*/
public MutableLiveData<CropValue> croppedValue = new MutableLiveData<>();
public MutableLiveData<CropValueDTO> croppedValue = new MutableLiveData<>();
/**
* 相机图片回调
......@@ -56,7 +56,7 @@ public class CameraCropViewModel extends BaseViewModel {
* 保存裁剪坐标
* @param value
*/
public void saveCropValue(CropValue value){
public void saveCropValue(CropValueDTO value){
CropLocalRepository.getInstance().saveCropValue(value);
}
}
package com.wmdigit.setting.viewmodel;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;
import androidx.lifecycle.MutableLiveData;
import com.elvishew.xlog.XLog;
import com.wmdigit.common.base.mvvm.BaseViewModel;
import com.wmdigit.common.base.mvvm.SingleLiveEvent;
import com.wmdigit.common.model.ProductsVO;
import com.wmdigit.data.database.repository.ProductsRepository;
import java.util.ArrayList;
import java.util.List;
/**
* 学习菜品的ViewModel
* @author dizi
*/
public class DataLearningViewModel extends BaseViewModel {
/**
* 每页数量
*/
public final int PAGE_SIZE = 24;
/**
* 当前页码
*/
public MutableLiveData<Integer> currentPage = new MutableLiveData<>();
/**
* 总页码
*/
public ObservableField<Integer> totalPage = new ObservableField<>();
/**
* 关键字
*/
public SingleLiveEvent<String> keywords = new SingleLiveEvent<>();
/**
* 商品信息
*/
public List<ProductsVO> products = new ArrayList<>();
public DataLearningViewModel(@NonNull Application application) {
super(application);
getData();
}
private void getData() {
keywords.postValue("");
}
/**
* 关键词变化时事件
*/
public void onKeywordsChangedEvent(String keyword){
products.clear();
// 查询首页商品
products.addAll(ProductsRepository.getInstance().queryByKeywords(keyword, 1, PAGE_SIZE));
// 查询商品总数
int total = ProductsRepository.getInstance().queryCount(keyword);
// 计算总页数
totalPage.set(total / PAGE_SIZE + ((total % PAGE_SIZE) == 0 ? 0 : 1));
// 计算当前页码
if (total == 0){
currentPage.postValue(0);
}
else{
currentPage.postValue(1);
}
}
/**
* 页码改变事件
* @param page
*/
public void onPageChangedEvent(int page){
String keyword = keywords.getValue();
products.clear();
// 查询当前页码商品
products.addAll(ProductsRepository.getInstance().queryByKeywords(keyword, page, PAGE_SIZE));
}
/**
* 下一页商品列表
*/
public void nextPage(){
if (currentPage.getValue() >= totalPage.get()){
return;
}
currentPage.postValue(currentPage.getValue() + 1);
}
public void previousPage(){
if (currentPage.getValue() <= 1){
return;
}
currentPage.postValue(currentPage.getValue() - 1);
}
}
package com.wmdigit.setting.viewmodel;
import android.app.Application;
import androidx.annotation.NonNull;
import com.wmdigit.common.base.mvvm.BaseViewModel;
import com.wmdigit.setting.R;
import com.wmdigit.setting.model.FuncButton;
import java.util.ArrayList;
import java.util.List;
/**
* 数据管理页ViewModel
* @author dizi
*/
public class DataManagerViewModel extends BaseViewModel {
public List<FuncButton> funcButtons = new ArrayList<>();
public DataManagerViewModel(@NonNull Application application) {
super(application);
getData();
}
private void getData(){
// 初始化功能键列表
funcButtons.add(new FuncButton(getApplication().getString(R.string.module_setting_upload_database_to_server), R.drawable.ic_upload_learning_data));
funcButtons.add(new FuncButton(getApplication().getString(R.string.module_setting_download_database_from_server), R.drawable.ic_download_learning_data));
funcButtons.add(new FuncButton(getApplication().getString(R.string.module_setting_clear_learning_data), R.drawable.ic_clear_data_red));
funcButtons.add(new FuncButton(getApplication().getString(R.string.module_setting_clear_products), R.drawable.ic_clean_learning_data));
funcButtons.add(new FuncButton(getApplication().getString(R.string.module_setting_unbind), R.drawable.ic_unbind));
funcButtons.add(new FuncButton(getApplication().getString(R.string.module_setting_download_remote_tool), R.drawable.ic_download_remote));
}
}
......@@ -6,7 +6,7 @@ import androidx.annotation.NonNull;
import com.wmdigit.common.base.mvvm.BaseViewModel;
import com.wmdigit.common.base.mvvm.SingleLiveEvent;
import com.wmdigit.common.model.DrawerMenuItemModel;
import com.wmdigit.common.model.DrawerMenuItemVO;
import com.wmdigit.setting.R;
import java.util.ArrayList;
......@@ -30,24 +30,24 @@ public class SettingViewModel extends BaseViewModel {
/**
* 抽屉菜单列表
*/
private List<DrawerMenuItemModel> list = new ArrayList<>();
private List<DrawerMenuItemVO> list = new ArrayList<>();
public SettingViewModel(@NonNull Application application) {
super(application);
pagePosition.postValue(0);
// 初始化抽屉菜单
list.add(new DrawerMenuItemModel(R.drawable.ic_menu_system, getApplication().getString(R.string.module_setting_system), true));
list.add(new DrawerMenuItemModel(R.drawable.ic_menu_register, getApplication().getString(R.string.module_setting_register), false));
list.add(new DrawerMenuItemModel(R.drawable.ic_menu_data, getApplication().getString(R.string.module_setting_data_manager), false));
list.add(new DrawerMenuItemModel(R.drawable.ic_menu_learning, getApplication().getString(R.string.module_setting_data_learning), false));
list.add(new DrawerMenuItemModel(R.drawable.ic_menu_camera, getApplication().getString(R.string.module_setting_camera_area), false));
list.add(new DrawerMenuItemVO(R.drawable.ic_menu_system, getApplication().getString(R.string.module_setting_system), true));
list.add(new DrawerMenuItemVO(R.drawable.ic_menu_register, getApplication().getString(R.string.module_setting_register), false));
list.add(new DrawerMenuItemVO(R.drawable.ic_menu_data, getApplication().getString(R.string.module_setting_data_manager), false));
list.add(new DrawerMenuItemVO(R.drawable.ic_menu_learning, getApplication().getString(R.string.module_setting_data_learning), false));
list.add(new DrawerMenuItemVO(R.drawable.ic_menu_camera, getApplication().getString(R.string.module_setting_camera_area), false));
}
/**
* 获取导航菜单列表
* @return
*/
public List<DrawerMenuItemModel> getDrawerMenuItemModels(){
public List<DrawerMenuItemVO> getDrawerMenuItemModels(){
return list;
}
......@@ -56,7 +56,7 @@ public class SettingViewModel extends BaseViewModel {
* @param position
*/
public void selectDrawerMenuItem(int position){
for (DrawerMenuItemModel item : list){
for (DrawerMenuItemVO item : list){
item.setChecked(false);
}
list.get(position).setChecked(true);
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.DataLearningFragment">
xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- TODO: Update blank fragment layout -->
<TextView
<data>
<import type="android.view.View"/>
<variable
name="viewModel"
type="com.wmdigit.setting.viewmodel.DataLearningViewModel" />
</data>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
tools:context=".fragment.DataLearningFragment">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_v_46"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.46"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_0"
android:background="@color/black_272E3D"
android:padding="@dimen/dp_10"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_v_46"
app:layout_constraintBottom_toTopOf="@+id/keyboard">
<TextView
android:id="@+id/tv_image_desc"
style="@style/text_base.content.white"
android:text="@string/please_select_correct_goods_for_every_rect"
app:layout_constraintStart_toStartOf="@+id/img_preview"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/img_preview"/>
<ImageView
android:id="@+id/img_preview"
android:layout_width="@dimen/dp_720"
android:layout_height="@dimen/dp_540"
android:adjustViewBounds="true"
android:src="@color/black"
android:layout_marginTop="@dimen/dp_10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_image_desc"
/>
<TextView
android:id="@+id/tv_camera_status"
style="@style/text_base.content.white"
android:text="@string/camera_opening"
app:layout_constraintStart_toStartOf="@+id/img_preview"
app:layout_constraintTop_toTopOf="@+id/img_preview"
app:layout_constraintEnd_toEndOf="@+id/img_preview"
app:layout_constraintBottom_toBottomOf="@+id/img_preview"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!--商品列表-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_products"
android:layout_width="@dimen/dp_0"
android:layout_height="@dimen/dp_0"
android:layout_margin="@dimen/dp_5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_v_46"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
<!--空数据的图-->
<ImageView
android:id="@+id/img_empty"
android:layout_width="@dimen/dp_300"
android:layout_height="wrap_content"
android:src="@drawable/img_no_data"
android:visibility="@{viewModel.totalPage > 0 ? View.INVISIBLE : View.VISIBLE}"
android:adjustViewBounds="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_v_46"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/tv_page"/>
<!--暂无数据-->
<TextView
style="@style/text_base.content"
android:text="@string/no_data"
android:visibility="@{viewModel.totalPage > 0 ? View.INVISIBLE : View.VISIBLE}"
android:textColor="@color/black_333b4b"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_v_46"
app:layout_constraintBottom_toBottomOf="@+id/img_empty"/>
<!--键盘-->
<com.wmdigit.common.view.keyboard.EnglishAndNumberKeyboard
android:id="@+id/keyboard"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:keywords="@={viewModel.keywords}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/gl_v_46"/>
<!--上一页-->
<Button
style="@style/button_base.w130"
android:background="@{viewModel.currentPage > 1 ? @drawable/sel_rect_10_black_gray : @drawable/rect_10_gray}"
android:text="@string/previous_page"
android:layout_marginEnd="@dimen/dp_40"
android:onClick="@{()->viewModel.previousPage()}"
app:layout_constraintEnd_toStartOf="@+id/tv_page"
app:layout_constraintBottom_toBottomOf="@+id/tv_page"
app:layout_constraintTop_toTopOf="@+id/tv_page"
/>
<!--当前页码-->
<TextView
android:id="@+id/tv_page"
style="@style/text_base.content"
android:text="@{String.format(@string/page_number, viewModel.currentPage, viewModel.totalPage)}"
android:layout_marginBottom="@dimen/dp_34"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/gl_v_46"
app:layout_constraintBottom_toBottomOf="parent"/>
<!--下一页-->
<Button
style="@style/button_base.w130"
android:text="@string/next_page"
android:layout_marginStart="@dimen/dp_40"
android:background="@{viewModel.currentPage &lt; viewModel.totalPage ? @drawable/sel_rect_10_black_gray : @drawable/rect_10_gray}"
android:onClick="@{()->viewModel.nextPage()}"
app:layout_constraintStart_toEndOf="@+id/tv_page"
app:layout_constraintBottom_toBottomOf="@+id/tv_page"
app:layout_constraintTop_toTopOf="@+id/tv_page"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
\ No newline at end of file
</FrameLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.DataManagerFragment">
xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- TODO: Update blank fragment layout -->
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
<data>
<import type="com.wmdigit.setting.viewmodel.DataManagerViewModel"/>
<variable
name="viewModel"
type="DataManagerViewModel" />
</data>
</FrameLayout>
\ No newline at end of file
<FrameLayout
style="@style/fragment_root"
tools:context=".fragment.DataManagerFragment">
<androidx.constraintlayout.widget.ConstraintLayout
style="@style/setting_module"
android:layout_height="match_parent"
android:layout_marginBottom="@dimen/dp_20"
android:background="@color/gray_d9d9d9">
<!--绿色图标-->
<View
android:id="@+id/icon_data_manager"
style="@style/icon_title_green"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_data_manager"
app:layout_constraintBottom_toBottomOf="@+id/tv_data_manager"/>
<!--标题-->
<TextView
android:id="@+id/tv_data_manager"
style="@style/text_base.title.module_title"
android:text="@string/module_setting_data_manager"
app:layout_constraintStart_toEndOf="@+id/icon_data_manager"
app:layout_constraintTop_toTopOf="parent" />
<!--功能按钮列表-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_data_manager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_40"
app:layout_constraintTop_toBottomOf="@+id/tv_data_manager"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/sel_rect_16_white_gray">
<!--图标-->
<ImageView
android:id="@+id/ic_button"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_120"
android:adjustViewBounds="true"
android:layout_marginHorizontal="@dimen/dp_60"
android:layout_marginTop="@dimen/dp_30"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
<!--功能名称-->
<TextView
android:id="@+id/tv_function_name"
style="@style/text_base.content"
android:layout_marginVertical="@dimen/dp_30"
android:layout_marginHorizontal="@dimen/dp_20"
app:layout_constraintTop_toBottomOf="@+id/ic_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingHorizontal="@dimen/dp_10"
android:paddingVertical="@dimen/dp_10"
android:layout_margin="@dimen/dp_5"
android:background="@drawable/sel_rect_10_white_gray">
<TextView
android:id="@+id/tv_product_name"
style="@style/text_base.title"
android:text="商品名称"
android:maxLines="1"
android:ellipsize="end"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
/>
<TextView
android:id="@+id/tv_product_code"
style="@style/text_base.content"
android:text="00000000"
android:layout_marginTop="@dimen/dp_2"
app:layout_constraintStart_toStartOf="@+id/tv_product_name"
app:layout_constraintTop_toBottomOf="@+id/tv_product_name"
/>
<TextView
android:id="@+id/tv_product_price"
style="@style/text_base.content"
android:text="¥00.00"
android:layout_marginTop="@dimen/dp_2"
app:layout_constraintStart_toStartOf="@+id/tv_product_name"
app:layout_constraintTop_toBottomOf="@+id/tv_product_code"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -27,6 +27,12 @@
<string name="module_setting_forget_register_info">忘记注册信息</string>
<string name="module_setting_forget_register">注册</string>
<string name="module_setting_tip_crop_camera">调整识别区域,使其完全包裹置物台</string>
<string name="module_setting_upload_database_to_server">备份数据库到云端</string>
<string name="module_setting_download_database_from_server">从云端下载数据库</string>
<string name="module_setting_clear_learning_data">清空学习数据</string>
<string name="module_setting_clear_products">清空商品数据</string>
<string name="module_setting_unbind">SN解绑</string>
<string name="module_setting_download_remote_tool">下载远程工具</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
\ No newline at end of file
/build
\ No newline at end of file
plugins {
id 'com.android.library'
}
android {
namespace 'com.wmdigit.service'
compileSdk 33
defaultConfig {
minSdk 24
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures{
aidl true
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
implementation project(path: ':common')
implementation project(path: ':core')
implementation project(path: ':data-local')
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
package com.wmdigit.service;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.wmdigit.service.test", appContext.getPackageName());
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
\ No newline at end of file
package com.wmdigit.service;
import com.wmdigit.service.IOnInitListener;
interface ICateringInterface {
void init(IOnInitListener listener);
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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