更新res资源,和新模块2

This commit is contained in:
fengjingqi
2026-11-14 09:49:10 +08:00
parent dcbbe60fe7
commit add6e352f1
32 changed files with 737 additions and 173 deletions

View File

@@ -207,7 +207,7 @@ public class DeviceManageActivity extends BaseActivity<DeviceManageLayoutBinding
viewBinding.tvTotalDevices.setText(
getString(R.string.device_manage_total_devices, result.getTotal()));
} else {
mPendingAdapter.setData(rows);
mPendingAdapter.setNewData(rows);
viewBinding.tvPendingTotal.setText(String.valueOf(result.getTotal()));
updatePendingCount(rows);
}
@@ -262,7 +262,7 @@ public class DeviceManageActivity extends BaseActivity<DeviceManageLayoutBinding
filtered.add(device);
}
}
mAllAdapter.setData(filtered);
mAllAdapter.setNewData(filtered);
}
/**

View File

@@ -17,28 +17,36 @@ import android.view.inputmethod.EditorInfo;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.king.camera.scan.CameraScan;
import com.ckkj.griddlebiz.R;
import com.ckkj.griddlebiz.base.BaseActivity;
import com.ckkj.griddlebiz.databinding.DialogProductInboundDeleteLayoutBinding;
import com.ckkj.griddlebiz.databinding.DialogProductInboundManualLayoutBinding;
import com.ckkj.griddlebiz.databinding.ProductInboundLayoutBinding;
import com.ckkj.griddlebiz.network.BaseBean;
import com.ckkj.griddlebiz.product.adapter.PendingInboundAdapter;
import com.ckkj.griddlebiz.product.entity.InboundPendingEntity;
import com.ckkj.griddlebiz.product.entity.ScanPreviewEntity;
import com.ckkj.griddlebiz.product.mvp.ProductInboundContract;
import com.ckkj.griddlebiz.product.mvp.ProductInboundImpl;
import com.ckkj.griddlebiz.product.mvp.ProductInboundPresenter;
import com.ckkj.griddlebiz.utils.show.ToastUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import butterknife.OnClick;
import pub.devrel.easypermissions.EasyPermissions;
/**
* 商品入库:扫描设备外箱条码,扫码失败时输入 SN 码。
* 商品入库:扫描设备外箱条码,扫码失败时手动输入 SN 码,
* 扫描结果通过 5.3 预览接口确认后加入待入库列表。
*/
public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBinding, ProductInboundPresenter>
public class ProductInboundActivity
extends BaseActivity<ProductInboundLayoutBinding, ProductInboundPresenter>
implements ProductInboundContract.ProductInboundView, EasyPermissions.PermissionCallbacks {
private static final int REQUEST_CAMERA_SCAN = 0x140;
@@ -54,14 +62,23 @@ public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBin
if (TextUtils.isEmpty(code)) {
ToastUtil.showShort(mContext, R.string.product_scan_empty);
} else {
showLoadingDialog();
mPresenter.previewDevice(code);
// TODO 临时逻辑:扫码结果直接加入待入库列表,后续再按 JSON 格式校验并接入 5.3 预览
addPendingCode(code);
}
});
private Dialog mManualCodeDialog;
private DialogProductInboundManualLayoutBinding mManualBinding;
private Dialog mDeleteDialog;
private DialogProductInboundDeleteLayoutBinding mDeleteBinding;
/** 待入库列表 */
private final List<InboundPendingEntity> mPendingList = new ArrayList<>();
/** 当前等待确认删除的商品 */
private final List<InboundPendingEntity> mDeleteTargets = new ArrayList<>();
private PendingInboundAdapter mPendingAdapter;
@Override
public ProductInboundPresenter createPresenter() {
return new ProductInboundPresenter(new ProductInboundImpl());
@@ -80,13 +97,30 @@ public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBin
@Override
public void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
// 点击事件统一由下方 onClick 处理。
// 待入库列表
mPendingAdapter = new PendingInboundAdapter(mPendingList,
new PendingInboundAdapter.Listener() {
@Override
public void onSelectedChanged() {
// 勾选变化只刷新顶部数量
updatePendingTotal();
}
@Override
public void onDelete(InboundPendingEntity item) {
showDeleteDialog(Collections.singletonList(item));
}
});
viewBinding.rvPending.setLayoutManager(new LinearLayoutManager(this));
viewBinding.rvPending.setAdapter(mPendingAdapter);
updatePendingTotal();
}
/**
* 商品入库页点击事件。
*/
@OnClick({R.id.iv_back, R.id.iv_scan, R.id.tv_manual_entry})
@OnClick({R.id.iv_back, R.id.iv_scan, R.id.tv_manual_entry, R.id.iv_delete_selected,
R.id.tv_delete_selected, R.id.btn_submit})
public void onClick(View v) {
switch (v.getId()) {
case R.id.iv_back:
@@ -104,6 +138,17 @@ public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBin
showManualCodeDialog();
break;
case R.id.iv_delete_selected:
case R.id.tv_delete_selected:
// 删除已勾选的待入库商品
deleteSelected();
break;
case R.id.btn_submit:
// 提交勾选的商品整批入库
submitInbound();
break;
default:
break;
}
@@ -226,8 +271,9 @@ public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBin
ToastUtil.showShort(mContext, R.string.product_manual_code_empty);
return;
}
showLoadingDialog();
mPresenter.previewDevice(code);
// 手动输入与扫码结果保持一致,先直接加入待入库列表
dismissManualCodeDialog();
addPendingCode(code);
}
private void dismissManualCodeDialog() {
@@ -239,19 +285,164 @@ public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBin
}
/**
* 扫码预览成功(文档 5.3):先提示识别到的设备,后续再接入整批入库。
* 扫码预览成功(文档 5.3):加入待入库列表,重复扫码只做标记
*/
@Override
public void onPreviewSuccess(ScanPreviewEntity preview) {
hideDialogLoading();
dismissManualCodeDialog();
if (preview == null) {
if (preview == null || TextUtils.isEmpty(preview.getDeviceCode())) {
return;
}
String name = TextUtils.isEmpty(preview.getDeviceName())
? preview.getDeviceCode() : preview.getDeviceName();
ToastUtil.showShort(mContext, getString(R.string.product_preview_success,
name, preview.getDeviceCode()));
appendPendingDevice(preview.getDeviceCode(), preview.getDeviceId(), preview.getDeviceName());
}
/**
* 临时逻辑:不调用预览接口,直接把扫码 / 手动输入的原始内容加入列表
*/
private void addPendingCode(String content) {
if (TextUtils.isEmpty(content)) {
ToastUtil.showShort(mContext, R.string.product_scan_empty);
return;
}
appendPendingDevice(content.trim(), null, null);
}
/**
* 追加一条待入库设备,已存在时只标记角标,不重复添加
*/
private void appendPendingDevice(String deviceCode, Long deviceId, String deviceName) {
for (InboundPendingEntity item : mPendingList) {
if (deviceCode.equals(item.getDeviceCode())) {
// 重复扫码标记为已入库,并保持默认勾选
item.setAlreadyInbound(true);
item.setSelected(true);
refreshPendingList();
ToastUtil.showShort(mContext, R.string.product_inbound_duplicate);
return;
}
}
InboundPendingEntity item = new InboundPendingEntity();
item.setDeviceId(deviceId);
item.setDeviceCode(deviceCode);
item.setDeviceName(deviceName);
// 扫码加入的条目默认勾选,方便直接提交入库
item.setSelected(true);
mPendingList.add(item);
refreshPendingList();
scrollToBottom();
ToastUtil.showShort(mContext, getString(R.string.product_inbound_added, deviceCode));
}
/**
* 新数据加入后滚动到底部,保证刚扫到的设备可见
*/
private void scrollToBottom() {
viewBinding.scrollContent.post(() ->
viewBinding.scrollContent.fullScroll(View.FOCUS_DOWN));
}
/**
* 刷新列表并同步顶部已选数量
*/
private void refreshPendingList() {
mPendingAdapter.setNewData(mPendingList);
updatePendingTotal();
}
/**
* 顶部数量只统计当前勾选的商品
*/
private void updatePendingTotal() {
int selectedCount = 0;
for (InboundPendingEntity item : mPendingList) {
if (item.isSelected()) {
selectedCount++;
}
}
viewBinding.tvPendingTotal.setText(
getString(R.string.product_inbound_total, selectedCount));
}
/**
* 删除顶部“删除”按钮对应的已勾选商品
*/
private void deleteSelected() {
List<InboundPendingEntity> selected = new ArrayList<>();
for (InboundPendingEntity item : mPendingList) {
if (item.isSelected()) {
selected.add(item);
}
}
if (selected.isEmpty()) {
ToastUtil.showShort(mContext, R.string.product_inbound_select_delete);
return;
}
showDeleteDialog(selected);
}
/**
* 删除确认弹窗
*/
private void showDeleteDialog(List<InboundPendingEntity> targets) {
if (targets == null || targets.isEmpty()) {
return;
}
if (mDeleteDialog != null && mDeleteDialog.isShowing()) {
return;
}
mDeleteTargets.clear();
mDeleteTargets.addAll(targets);
mDeleteBinding = DialogProductInboundDeleteLayoutBinding.inflate(getLayoutInflater());
mDeleteDialog = new Dialog(this, R.style.ProductManualCodeDialog);
mDeleteDialog.setContentView(mDeleteBinding.getRoot());
mDeleteDialog.setCanceledOnTouchOutside(true);
mDeleteBinding.dialogRoot.setOnClickListener(v -> dismissDeleteDialog());
mDeleteBinding.tvDeleteCancel.setOnClickListener(v -> dismissDeleteDialog());
mDeleteBinding.tvDeleteConfirm.setOnClickListener(v -> confirmDelete());
mDeleteDialog.show();
Window window = mDeleteDialog.getWindow();
if (window != null) {
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
window.setGravity(Gravity.CENTER);
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT);
}
}
private void confirmDelete() {
mPendingList.removeAll(mDeleteTargets);
refreshPendingList();
dismissDeleteDialog();
}
private void dismissDeleteDialog() {
if (mDeleteDialog != null && mDeleteDialog.isShowing()) {
mDeleteDialog.dismiss();
}
mDeleteDialog = null;
mDeleteBinding = null;
mDeleteTargets.clear();
}
/**
* 提交勾选的商品;5.4 整批入库接口待接入
*/
private void submitInbound() {
List<InboundPendingEntity> selected = new ArrayList<>();
for (InboundPendingEntity item : mPendingList) {
if (item.isSelected()) {
selected.add(item);
}
}
if (selected.isEmpty()) {
ToastUtil.showShort(mContext, R.string.product_inbound_select_submit);
return;
}
ToastUtil.showShort(mContext, R.string.product_inbound_submit_pending);
}
@Override
@@ -274,6 +465,7 @@ public class ProductInboundActivity extends BaseActivity<ProductInboundLayoutBin
@Override
protected void onDestroy() {
dismissManualCodeDialog();
dismissDeleteDialog();
super.onDestroy();
}
}

View File

@@ -2,26 +2,21 @@ package com.ckkj.griddlebiz.product.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ckkj.griddlebiz.R;
import com.ckkj.griddlebiz.databinding.ItemDeviceAllBinding;
import com.ckkj.griddlebiz.databinding.ItemDevicePendingBinding;
import com.ckkj.griddlebiz.main.entity.DeviceEntity;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
/**
* 设备列表适配器:全部设备与待激活设备共用,按模式选择 item 布局。
*/
public class DeviceListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public class DeviceListAdapter extends BaseQuickAdapter<DeviceEntity, BaseViewHolder> {
public interface OnDeviceClickListener {
void onDeviceClick(DeviceEntity device);
@@ -31,137 +26,80 @@ public class DeviceListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
/** true 待激活列表,false 全部设备列表 */
private final boolean mPendingMode;
private final OnDeviceClickListener mListener;
private final List<DeviceEntity> mData = new ArrayList<>();
public DeviceListAdapter(Context context, boolean pendingMode, OnDeviceClickListener listener) {
super(pendingMode ? R.layout.item_device_pending : R.layout.item_device_all,
new ArrayList<>());
this.mContext = context;
this.mPendingMode = pendingMode;
this.mListener = listener;
}
/**
* 整体替换列表数据
*/
public void setData(List<DeviceEntity> data) {
mData.clear();
if (data != null) {
mData.addAll(data);
}
notifyDataSetChanged();
}
@NonNull
@Override
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
LayoutInflater inflater = LayoutInflater.from(mContext);
protected void convert(BaseViewHolder holder, DeviceEntity item) {
if (mPendingMode) {
ItemDevicePendingBinding binding =
ItemDevicePendingBinding.inflate(inflater, parent, false);
return new PendingHolder(binding);
bindPending(holder, item);
} else {
bindAll(holder, item);
}
ItemDeviceAllBinding binding = ItemDeviceAllBinding.inflate(inflater, parent, false);
return new DeviceHolder(binding);
}
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
DeviceEntity device = mData.get(position);
if (holder instanceof DeviceHolder) {
((DeviceHolder) holder).bind(device);
} else if (holder instanceof PendingHolder) {
((PendingHolder) holder).bind(device);
}
}
@Override
public int getItemCount() {
return mData.size();
holder.itemView.setOnClickListener(v -> {
if (mListener != null && item.getDeviceId() != null) {
mListener.onDeviceClick(item);
}
});
}
/**
* 全部设备卡片
*/
private class DeviceHolder extends RecyclerView.ViewHolder {
private void bindAll(BaseViewHolder holder, DeviceEntity item) {
holder.setText(R.id.tv_device_code, safeText(item.getDeviceCode()));
holder.setText(R.id.tv_device_name, safeText(item.getDeviceName()));
holder.setText(R.id.tv_activation_date, formatDate(item.getActivationTime()));
holder.setText(R.id.tv_total_runtime, formatRuntime(item.getTotalRuntime()));
private final ItemDeviceAllBinding binding;
DeviceHolder(ItemDeviceAllBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
void bind(DeviceEntity device) {
binding.tvDeviceCode.setText(safeText(device.getDeviceCode()));
binding.tvDeviceName.setText(safeText(device.getDeviceName()));
binding.tvActivationDate.setText(formatDate(device.getActivationTime()));
binding.tvTotalRuntime.setText(formatRuntime(device.getTotalRuntime()));
boolean fault = "1".equals(device.getFaultStatus());
boolean online = "1".equals(device.getOnlineStatus());
int statusText;
int statusBg;
int statusColor;
if (fault) {
statusText = R.string.device_manage_status_fault;
statusBg = R.drawable.device_manage_status_fault_bg;
statusColor = R.color.device_manage_status_fault;
} else if (online) {
statusText = R.string.device_manage_status_online;
statusBg = R.drawable.device_manage_status_online_bg;
statusColor = R.color.device_manage_status_online;
} else {
statusText = R.string.device_manage_status_offline;
statusBg = R.drawable.device_manage_status_offline_bg;
statusColor = R.color.device_manage_text_secondary;
}
binding.tvDeviceStatus.setText(statusText);
binding.tvDeviceStatus.setBackgroundResource(statusBg);
binding.tvDeviceStatus.setTextColor(ContextCompat.getColor(mContext, statusColor));
binding.ivDeviceIcon.setImageResource(online || fault
? R.mipmap.icon_device_manage_box : R.mipmap.icon_device_manage_box_offline);
binding.tvFaultStatus.setText(fault
? R.string.device_manage_status_fault : R.string.device_manage_fault_normal);
binding.getRoot().setOnClickListener(v -> {
if (mListener != null && device.getDeviceId() != null) {
mListener.onDeviceClick(device);
}
});
boolean fault = "1".equals(item.getFaultStatus());
boolean online = "1".equals(item.getOnlineStatus());
int statusText;
int statusBg;
int statusColor;
if (fault) {
statusText = R.string.device_manage_status_fault;
statusBg = R.drawable.device_manage_status_fault_bg;
statusColor = R.color.device_manage_status_fault;
} else if (online) {
statusText = R.string.device_manage_status_online;
statusBg = R.drawable.device_manage_status_online_bg;
statusColor = R.color.device_manage_status_online;
} else {
statusText = R.string.device_manage_status_offline;
statusBg = R.drawable.device_manage_status_offline_bg;
statusColor = R.color.device_manage_text_secondary;
}
holder.setText(R.id.tv_device_status, mContext.getString(statusText));
holder.setBackgroundRes(R.id.tv_device_status, statusBg);
holder.setTextColor(R.id.tv_device_status, ContextCompat.getColor(mContext, statusColor));
holder.setImageResource(R.id.iv_device_icon, online || fault
? R.mipmap.icon_device_manage_box : R.mipmap.icon_device_manage_box_offline);
holder.setText(R.id.tv_fault_status, mContext.getString(fault
? R.string.device_manage_status_fault : R.string.device_manage_fault_normal));
}
/**
* 待激活设备卡片:区分未激活与已售未激活
*/
private class PendingHolder extends RecyclerView.ViewHolder {
private void bindPending(BaseViewHolder holder, DeviceEntity item) {
holder.setText(R.id.tv_pending_code, safeText(item.getDeviceCode()));
holder.setText(R.id.tv_pending_name, safeText(item.getDeviceName()));
holder.setText(R.id.tv_stock_in_date, formatDate(item.getStockInTime()));
holder.setText(R.id.tv_activation_time, formatDateTime(item.getActivationTime()));
private final ItemDevicePendingBinding binding;
PendingHolder(ItemDevicePendingBinding binding) {
super(binding.getRoot());
this.binding = binding;
}
void bind(DeviceEntity device) {
binding.tvPendingCode.setText(safeText(device.getDeviceCode()));
binding.tvPendingName.setText(safeText(device.getDeviceName()));
binding.tvStockInDate.setText(formatDate(device.getStockInTime()));
binding.tvActivationTime.setText(formatDateTime(device.getActivationTime()));
boolean sold = "1".equals(device.getSaleStatus());
binding.tvPendingStatus.setText(sold
? R.string.device_manage_sold_not_activated : R.string.device_manage_not_activated);
binding.tvPendingStatus.setTextColor(ContextCompat.getColor(mContext,
sold ? R.color.device_manage_orange : R.color.device_manage_text_secondary));
binding.ivPendingIcon.setImageResource(R.mipmap.icon_device_manage_box);
binding.getRoot().setOnClickListener(v -> {
if (mListener != null && device.getDeviceId() != null) {
mListener.onDeviceClick(device);
}
});
}
boolean sold = "1".equals(item.getSaleStatus());
holder.setText(R.id.tv_pending_status, mContext.getString(sold
? R.string.device_manage_sold_not_activated : R.string.device_manage_not_activated));
holder.setTextColor(R.id.tv_pending_status, ContextCompat.getColor(mContext,
sold ? R.color.device_manage_orange : R.color.device_manage_text_secondary));
holder.setImageResource(R.id.iv_pending_icon, R.mipmap.icon_device_manage_box);
}
/**

View File

@@ -0,0 +1,60 @@
package com.ckkj.griddlebiz.product.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ckkj.griddlebiz.R;
import com.ckkj.griddlebiz.product.entity.InboundPendingEntity;
import java.util.List;
/**
* 待入库商品列表适配器。
*/
public class PendingInboundAdapter extends BaseQuickAdapter<InboundPendingEntity, BaseViewHolder> {
public interface Listener {
// 勾选状态变化,用于刷新已选数量
void onSelectedChanged();
// 点击单条删除
void onDelete(InboundPendingEntity item);
}
private final Listener mListener;
public PendingInboundAdapter(List<InboundPendingEntity> data, Listener listener) {
super(R.layout.item_product_inbound_pending, data);
this.mListener = listener;
}
@Override
protected void convert(BaseViewHolder holder, InboundPendingEntity item) {
holder.setText(R.id.tv_device_sn, item.getDeviceCode());
holder.setVisible(R.id.tv_badge, item.isAlreadyInbound());
holder.setImageResource(R.id.cb_pending, item.isSelected()
? R.mipmap.icon_product_inbound_check_on
: R.mipmap.icon_product_inbound_check_off);
// 点击整行或勾选框都切换选中状态
holder.itemView.setOnClickListener(v -> toggle(holder, item));
holder.getView(R.id.cb_pending).setOnClickListener(v -> toggle(holder, item));
holder.getView(R.id.iv_delete).setOnClickListener(v -> {
if (mListener != null) {
mListener.onDelete(item);
}
});
}
/**
* 切换勾选状态并刷新当前行图标
*/
private void toggle(BaseViewHolder holder, InboundPendingEntity item) {
item.setSelected(!item.isSelected());
holder.setImageResource(R.id.cb_pending, item.isSelected()
? R.mipmap.icon_product_inbound_check_on
: R.mipmap.icon_product_inbound_check_off);
if (mListener != null) {
mListener.onSelectedChanged();
}
}
}

View File

@@ -0,0 +1,57 @@
package com.ckkj.griddlebiz.product.entity;
import java.io.Serializable;
/**
* 待入库列表项:扫码预览成功后加入页面列表,勾选后等待整批入库。
*/
public class InboundPendingEntity implements Serializable {
private Long deviceId;
private String deviceCode;
private String deviceName;
/** 是否勾选 */
private boolean selected;
/** 是否已在列表中(重复扫码时标记) */
private boolean alreadyInbound;
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public boolean isAlreadyInbound() {
return alreadyInbound;
}
public void setAlreadyInbound(boolean alreadyInbound) {
this.alreadyInbound = alreadyInbound;
}
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#FFF0E5" />
<corners android:radius="4dp" />
</shape>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#FF6900" />
<corners android:radius="28dp" />
</shape>

View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dialog_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="202dp"
android:layout_gravity="center_vertical"
android:layout_marginHorizontal="36dp"
android:translationY="-25dp"
android:background="@drawable/product_dialog_bg"
android:clickable="true">
<TextView
android:id="@+id/tv_delete_title"
style="@style/HomeText"
android:layout_width="match_parent"
android:layout_height="22dp"
android:layout_gravity="top"
android:layout_marginStart="20dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:text="@string/product_delete_title"
android:textColor="#222222"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_delete_message"
style="@style/HomeText"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_gravity="top"
android:layout_marginStart="20dp"
android:layout_marginTop="62dp"
android:layout_marginEnd="20dp"
android:gravity="center"
android:lineSpacingExtra="1dp"
android:text="@string/product_delete_message"
android:textColor="#666666"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_gravity="bottom"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_delete_cancel"
style="@style/HomeText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/product_dialog_reset_bg"
android:clickable="true"
android:focusable="true"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/product_delete_cancel"
android:textColor="#666666"
android:textSize="18sp" />
<Space
android:layout_width="11dp"
android:layout_height="1dp" />
<TextView
android:id="@+id/tv_delete_confirm"
style="@style/HomeText"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/product_dialog_ok_bg"
android:clickable="true"
android:focusable="true"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/product_delete_confirm"
android:textColor="@android:color/white"
android:textSize="18sp" />
</LinearLayout>
</FrameLayout>
</FrameLayout>

View File

@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_pending"
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_marginStart="24dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="24dp"
android:background="@drawable/product_card_bg"
android:clickable="true"
android:focusable="true">
<ImageView
android:id="@+id/cb_pending"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="start|center_vertical"
android:layout_marginStart="17dp"
android:contentDescription="@string/product_inbound_select"
android:src="@mipmap/icon_product_inbound_check_off" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|top"
android:layout_marginStart="48dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="44dp"
android:orientation="vertical">
<TextView
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="17dp"
android:text="@string/product_inbound_device_sn"
android:textColor="#666666"
android:textSize="14sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="21dp"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_device_sn"
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif-medium"
android:textColor="#222222"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_badge"
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="21dp"
android:layout_marginStart="6dp"
android:background="@drawable/product_inbound_badge_bg"
android:gravity="center"
android:paddingHorizontal="6dp"
android:text="@string/product_inbound_already_inbound"
android:textColor="#FF6900"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<ImageView
android:id="@+id/iv_delete"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
android:contentDescription="@string/product_inbound_delete"
android:src="@mipmap/icon_product_inbound_trash" />
</FrameLayout>

View File

@@ -36,58 +36,162 @@
android:textStyle="bold" />
</FrameLayout>
<!-- White header continues behind the status bar; content area stays grey. -->
<LinearLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#F5F5F5"
android:orientation="vertical">
android:background="#F5F5F5">
<LinearLayout
<ScrollView
android:id="@+id/scroll_content"
android:layout_width="match_parent"
android:layout_height="205dp"
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:background="@drawable/product_card_bg"
android:gravity="center_horizontal"
android:orientation="vertical">
android:layout_height="match_parent"
android:clipToPadding="false"
android:fillViewport="true"
android:overScrollMode="never"
android:paddingBottom="88dp"
android:scrollbars="none">
<ImageView
android:id="@+id/iv_scan"
android:layout_width="118dp"
android:layout_height="118dp"
android:layout_marginTop="20dp"
android:clickable="true"
android:contentDescription="@string/product_inbound_scan_tip"
android:focusable="true"
android:src="@mipmap/icon_product_inbound_scan" />
<TextView
style="@style/HomeText"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="17dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="@string/product_inbound_scan_tip"
android:textSize="14sp"
android:textStyle="bold" />
</LinearLayout>
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- 扫码卡片 -->
<FrameLayout
android:layout_width="match_parent"
android:layout_height="192dp"
android:layout_marginStart="24dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="24dp"
android:background="@drawable/product_card_bg">
<ImageView
android:id="@+id/iv_scan"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_gravity="top|center_horizontal"
android:layout_marginTop="4dp"
android:clickable="true"
android:contentDescription="@string/product_inbound_scan_tip"
android:focusable="true"
android:src="@mipmap/icon_product_inbound_scan_circle" />
<TextView
android:id="@+id/tv_scan_tip"
style="@style/HomeText"
android:layout_width="match_parent"
android:layout_height="17dp"
android:layout_gravity="top"
android:layout_marginStart="32dp"
android:layout_marginTop="128dp"
android:layout_marginEnd="32dp"
android:gravity="center"
android:text="@string/product_inbound_scan_tip"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_manual_entry"
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="17dp"
android:layout_gravity="top|center_horizontal"
android:layout_marginTop="155dp"
android:clickable="true"
android:focusable="true"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/product_inbound_manual_entry"
android:textColor="@color/color_zhu"
android:textSize="14sp" />
</FrameLayout>
<!-- 待入库商品 -->
<TextView
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="20dp"
android:text="@string/product_inbound_pending_title"
android:textColor="#222222"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_marginStart="24dp"
android:layout_marginTop="-7dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="-14dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_pending_total"
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:textColor="#666666"
android:textSize="14sp" />
<Space
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_delete_selected"
android:layout_width="16dp"
android:layout_height="16dp"
android:clickable="true"
android:contentDescription="@string/product_inbound_delete"
android:focusable="true"
android:src="@mipmap/icon_product_inbound_trash" />
<TextView
android:id="@+id/tv_delete_selected"
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="4dp"
android:gravity="center"
android:clickable="true"
android:focusable="true"
android:text="@string/product_inbound_delete"
android:textColor="#E5484D"
android:textSize="14sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_pending"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:nestedScrollingEnabled="false"
android:overScrollMode="never" />
</LinearLayout>
</ScrollView>
<!-- 提交入库 -->
<TextView
android:id="@+id/tv_manual_entry"
android:id="@+id/btn_submit"
style="@style/HomeText"
android:layout_width="wrap_content"
android:layout_height="17dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp"
android:background="@drawable/product_inbound_submit_bg"
android:clickable="true"
android:focusable="true"
android:fontFamily="sans-serif-medium"
android:gravity="center"
android:text="@string/product_inbound_manual_entry"
android:textColor="@color/color_zhu"
android:textSize="14sp" />
</LinearLayout>
android:text="@string/product_inbound_submit"
android:textColor="@android:color/white"
android:textSize="16sp"
android:fontFamily="sans-serif-medium" />
</FrameLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 705 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

View File

@@ -17,6 +17,22 @@
<string name="product_camera_unavailable">No camera is available on this device. Please enter the SN code manually.</string>
<string name="product_scan_empty">No barcode was detected. Please try again.</string>
<string name="product_preview_success">Device found: %1$s (%2$s)</string>
<string name="product_inbound_pending_title">Pending Inbound Products</string>
<string name="product_inbound_total">Total: %1$d</string>
<string name="product_inbound_delete">Delete</string>
<string name="product_inbound_select">Select</string>
<string name="product_inbound_device_sn">Device SN:</string>
<string name="product_inbound_already_inbound">Already Inbound</string>
<string name="product_inbound_submit">Submit Inbound</string>
<string name="product_inbound_added">Added: %1$s</string>
<string name="product_inbound_duplicate">This device is already in the pending list</string>
<string name="product_inbound_select_delete">Select products to delete first</string>
<string name="product_inbound_select_submit">Select products to inbound first</string>
<string name="product_inbound_submit_pending">Batch inbound is not connected yet</string>
<string name="product_delete_title">Delete Confirmation</string>
<string name="product_delete_message">Are you sure you want to delete the selected products</string>
<string name="product_delete_cancel">Cancel</string>
<string name="product_delete_confirm">Confirm</string>
<string name="product_scan_title">Scan to Inbound</string>
<string name="product_scan_gallery">Choose from Gallery</string>
<string name="product_scan_decoding">Decoding image…</string>

View File

@@ -17,6 +17,22 @@
<string name="product_camera_unavailable">当前设备没有可用相机,请手动输入 SN 码</string>
<string name="product_scan_empty">未识别到条码,请重试</string>
<string name="product_preview_success">识别成功:%1$s(%2$s)</string>
<string name="product_inbound_pending_title">待入库商品</string>
<string name="product_inbound_total">合计:%1$d</string>
<string name="product_inbound_delete">删除</string>
<string name="product_inbound_select">选择</string>
<string name="product_inbound_device_sn">设备 SN:</string>
<string name="product_inbound_already_inbound">已入库</string>
<string name="product_inbound_submit">提交入库</string>
<string name="product_inbound_added">已添加:%1$s</string>
<string name="product_inbound_duplicate">该设备已在待入库列表</string>
<string name="product_inbound_select_delete">请先选择要删除的设备</string>
<string name="product_inbound_select_submit">请先勾选要入库的设备</string>
<string name="product_inbound_submit_pending">整批入库接口待接入</string>
<string name="product_delete_title">删除确认</string>
<string name="product_delete_message">确定要删除选中的商品吗?</string>
<string name="product_delete_cancel">取消</string>
<string name="product_delete_confirm">确认</string>
<string name="product_scan_title">扫码入库</string>
<string name="product_scan_gallery">从相册选择</string>
<string name="product_scan_decoding">正在识别图片…</string>