Просмотр исходного кода

1.新增双柜展示选择柜层页面
2.实现双柜选择页面业务逻辑

JaycePC месяцев назад: 8
Родитель
Сommit
5e8f4e7ce8

Разница между файлами не показана из-за своего большого размера
+ 112 - 114
app/src/main/java/com/example/chemical/ui/plan/PlanAddActivity.java


Разница между файлами не показана из-за своего большого размера
+ 67 - 53
app/src/main/java/com/example/chemical/ui/plan/add/AddActivity.java


Разница между файлами не показана из-за своего большого размера
+ 69 - 115
app/src/main/java/com/example/chemical/ui/plan/add/AddActivityHelp.java


+ 49 - 0
app/src/main/java/com/example/chemical/ui/plan/change/ChangeCabinetActivity.java

@@ -1,15 +1,29 @@
 package com.example.chemical.ui.plan.change;
 
+import android.content.Intent;
 import android.os.Bundle;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.viewpager2.widget.ViewPager2;
 
 import com.example.chemical.databinding.ActivityChangeCabinetBinding;
 import com.example.chemical.ui.common.BaseCountDownActivity;
+import com.example.chemical.ui.plan.FragmentCallBack;
+import com.example.chemical.ui.plan.room.RoomTool;
+import com.example.chemical.ui.plan.room.bean.locker.CabinetLayerSelect;
+import com.example.chemical.ui.plan.room.bean.locker.HxpCabinetDoorVo;
+import com.example.chemical.ui.plan.room.bean.locker.HxpCabinetVo;
 
+import java.util.List;
+
+/**
+ * 更换位置
+ */
 public class ChangeCabinetActivity extends BaseCountDownActivity<ActivityChangeCabinetBinding> {
     private ActivityChangeCabinetBinding binding;
+    private ChangeCabinetAdapter changeCabinetAdapter;
+    private CabinetLayerSelect cabinetLayerSelect;
 
     @NonNull
     @Override
@@ -20,10 +34,45 @@ public class ChangeCabinetActivity extends BaseCountDownActivity<ActivityChangeC
     @Override
     protected void initViews(@Nullable Bundle savedInstanceState) {
         super.initViews(savedInstanceState);
+        List<HxpCabinetVo> hxpCabinetVoList = RoomTool.getInstance().hxpCabinetDAO().getAll();
+        for (int i = 0; i < hxpCabinetVoList.size(); i++) {
+            HxpCabinetVo s = hxpCabinetVoList.get(i);
+        }
+        List<HxpCabinetDoorVo> hxpCabinetDoorVoList = RoomTool.getInstance().hxpDoorDAO().getAll();
+        changeCabinetAdapter = new ChangeCabinetAdapter(this, hxpCabinetVoList, fragmentCallBack);
+        binding.cabinetVP.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
+            @Override
+            public void onPageSelected(int position) {
+                super.onPageSelected(position);
+                binding.countTV.setText((position + 1) + "/" + changeCabinetAdapter.getItemCount());
+            }
+        });
+        binding.nextBT.setOnClickListener(view -> binding.cabinetVP.setCurrentItem(binding.cabinetVP.getCurrentItem() + 1, true));
+        binding.lastBT.setOnClickListener(view -> binding.cabinetVP.setCurrentItem(binding.cabinetVP.getCurrentItem() - 1, true));
+        binding.cabinetVP.setAdapter(changeCabinetAdapter);
+
+        binding.cancelBT.setOnClickListener(v -> finish());
+
+        binding.confirmBT.setOnClickListener(v -> {
+            Intent intent = new Intent();
+            Bundle bundle = new Bundle();
+            bundle.putSerializable("Change", cabinetLayerSelect);
+            intent.putExtra("data", bundle);
+            setResult(RESULT_OK, intent);
+            finish();
+        });
     }
 
     @Override
     protected void initData() {
         super.initData();
     }
+
+    FragmentCallBack fragmentCallBack = new FragmentCallBack() {
+        @Override
+        public void onSelected(CabinetLayerSelect lastSelectInfo) {
+            cabinetLayerSelect = lastSelectInfo;
+        }
+    };
+
 }

+ 8 - 5
app/src/main/java/com/example/chemical/ui/plan/change/ChangeCabinetAdapter.java

@@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment;
 import androidx.fragment.app.FragmentActivity;
 import androidx.viewpager2.adapter.FragmentStateAdapter;
 
+import com.blankj.utilcode.util.LogUtils;
 import com.example.chemical.ui.plan.FragmentCallBack;
 import com.example.chemical.ui.plan.room.bean.locker.HxpCabinetVo;
 
@@ -24,17 +25,19 @@ public class ChangeCabinetAdapter extends FragmentStateAdapter {
         super(fragmentActivity);
         int size = (int) Math.ceil(hxpCabinetVoList.size() / 2.0);
         Map<Integer, List<HxpCabinetVo>> doubleCabinetMap = new TreeMap<>();
+        int index = 0;
         for (int i = 0; i < size; i++) {
             List<HxpCabinetVo> hxpCabinetVoArrayList = new ArrayList<>();
-            hxpCabinetVoArrayList.add(hxpCabinetVoList.get(i));
-            if (i + 1 < hxpCabinetVoList.size()) {
-                hxpCabinetVoArrayList.add(hxpCabinetVoList.get(i + 1));
+            hxpCabinetVoArrayList.add(hxpCabinetVoList.get(index));
+            index++;
+            if (index < hxpCabinetVoList.size()) {
+                hxpCabinetVoArrayList.add(hxpCabinetVoList.get(index));
+                index++;
             }
             doubleCabinetMap.put(i, hxpCabinetVoArrayList);
         }
-
         for (int i = 0; i < size; i++) {
-            fragments.add(new ChangeCabinetFragment(doubleCabinetMap, fragmentCallBack));
+            fragments.add(new ChangeCabinetFragment(doubleCabinetMap.get(i), fragmentCallBack));
         }
     }
 

+ 18 - 5
app/src/main/java/com/example/chemical/ui/plan/change/ChangeCabinetFragment.java

@@ -10,19 +10,21 @@ import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 
 import com.example.chemical.databinding.FragmentChangeCabinetBinding;
+import com.example.chemical.databinding.IncludeCabinetBinding;
 import com.example.chemical.ui.plan.FragmentCallBack;
 import com.example.chemical.ui.plan.room.bean.locker.HxpCabinetVo;
 
+import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 
 public class ChangeCabinetFragment extends Fragment {
-    private Map<Integer, List<HxpCabinetVo>> doubleCabinetMap;
+    private List<HxpCabinetVo> hxpCabinetVoList;
     private FragmentCallBack fragmentCallBack;
     private FragmentChangeCabinetBinding binding;
+    private List<ChangeCabinetHelp> changeCabinetHelpList = new ArrayList<>();
 
-    public ChangeCabinetFragment(Map<Integer, List<HxpCabinetVo>> doubleCabinetMap, FragmentCallBack fragmentCallBack) {
-        this.doubleCabinetMap = doubleCabinetMap;
+    public ChangeCabinetFragment(List<HxpCabinetVo> hxpCabinetVos, FragmentCallBack fragmentCallBack) {
+        this.hxpCabinetVoList = hxpCabinetVos;
         this.fragmentCallBack = fragmentCallBack;
     }
 
@@ -36,6 +38,17 @@ public class ChangeCabinetFragment extends Fragment {
     @Override
     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
         super.onViewCreated(view, savedInstanceState);
-
+//        if (null != savedInstanceState) {
+//            for (int i = 0; i < changeCabinetHelpList.size(); i++) {
+//                changeCabinetHelpList.get(i).recycle();
+//            }
+//            binding.main.removeAllViewsInLayout();
+//        }
+        for (int i = 0; i < hxpCabinetVoList.size(); i++) {
+            HxpCabinetVo hxpCabinetVo = hxpCabinetVoList.get(i);
+            IncludeCabinetBinding includeCabinetBinding = IncludeCabinetBinding.inflate(getLayoutInflater());
+            changeCabinetHelpList.add(new ChangeCabinetHelp(includeCabinetBinding, hxpCabinetVo, fragmentCallBack));
+            binding.main.addView(includeCabinetBinding.getRoot());
+        }
     }
 }

+ 190 - 0
app/src/main/java/com/example/chemical/ui/plan/change/ChangeCabinetHelp.java

@@ -0,0 +1,190 @@
+package com.example.chemical.ui.plan.change;
+
+import android.text.TextUtils;
+import android.view.View;
+
+import com.blankj.utilcode.util.LogUtils;
+import com.example.chemical.R;
+import com.example.chemical.databinding.IncludeCabinetBinding;
+import com.example.chemical.ui.plan.FragmentCallBack;
+import com.example.chemical.ui.plan.locker.DrawerUiBean;
+import com.example.chemical.ui.plan.room.bean.locker.CabinetLayerSelect;
+import com.example.chemical.ui.plan.room.bean.locker.HxpCabinetDoorVo;
+import com.example.chemical.ui.plan.room.bean.locker.HxpCabinetVo;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class ChangeCabinetHelp {
+
+    private Map<Long, List<DrawerUiBean>> drawerUiMap = new TreeMap<>();
+    private IncludeCabinetBinding binding;
+    private FragmentCallBack fragmentCallBack;
+
+    public ChangeCabinetHelp(IncludeCabinetBinding binding, HxpCabinetVo hxpCabinetVo, FragmentCallBack fragmentCallBack) {
+        this.binding = binding;
+        this.fragmentCallBack = fragmentCallBack;
+        List<DrawerUiBean> drawerUiUpList = new LinkedList<>();
+        List<DrawerUiBean> drawerUiDownList = new LinkedList<>();
+        // 上柜view控制
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer1RB, binding.lockerUpDrawer1TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer2RB, binding.lockerUpDrawer2TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer3RB, binding.lockerUpDrawer3TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer4RB, binding.lockerUpDrawer4TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer5RB, binding.lockerUpDrawer5TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer6RB, binding.lockerUpDrawer6TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer7RB, binding.lockerUpDrawer7TV, false));
+        drawerUiUpList.add(new DrawerUiBean(binding.lockerUpDrawer8RB, binding.lockerUpDrawer8TV, false));
+
+        // 下柜view控制
+        drawerUiDownList.add(new DrawerUiBean(binding.lockerDownDrawer1RB, binding.lockerDownDrawer1TV, false));
+        drawerUiDownList.add(new DrawerUiBean(binding.lockerDownDrawer2RB, binding.lockerDownDrawer2TV, false));
+        drawerUiDownList.add(new DrawerUiBean(binding.lockerDownDrawer3RB, binding.lockerDownDrawer3TV, false));
+        drawerUiDownList.add(new DrawerUiBean(binding.lockerDownDrawer4RB, binding.lockerDownDrawer4TV, false));
+
+        // 绘制柜层
+        draw(hxpCabinetVo, drawerUiUpList, drawerUiDownList);
+
+        drawerUiMap.put(hxpCabinetVo.getCabinetId(), drawerUiUpList);
+        drawerUiMap.put(hxpCabinetVo.getCabinetId(), drawerUiDownList);
+    }
+
+    private void draw(HxpCabinetVo hxpCabinetVo, List<DrawerUiBean> drawerUiUpList, List<DrawerUiBean> drawerUiDownList) {
+        LogUtils.json(hxpCabinetVo);
+        for (int i = 0; i < drawerUiUpList.size(); i++) {
+            drawerUiUpList.get(i).getRadioButton().setOnClickListener(createClickDoorUpListener(hxpCabinetVo));
+        }
+        for (int i = 0; i < drawerUiDownList.size(); i++) {
+            drawerUiDownList.get(i).getRadioButton().setOnClickListener(createClickDoorDownListener(hxpCabinetVo));
+        }
+        // 所有柜门
+        List<HxpCabinetDoorVo> doorVoList = hxpCabinetVo.getCabinetDoorVoList();
+
+        // 柜子名称
+        String cabinetName = hxpCabinetVo.getCabinetName();
+        binding.lockerNameTV.setText(TextUtils.isEmpty(cabinetName) ? "" : cabinetName);
+
+        // 一个柜门
+        if (doorVoList.size() == 1) {
+            binding.cabinetRL.setBackgroundResource(R.mipmap.locker_one);
+            HxpCabinetDoorVo hxpCabinetDoorVo = doorVoList.get(0);
+            // 柜门名称
+            String doorName = hxpCabinetDoorVo.getDoorName();
+            binding.upDoorNameTV.setText(TextUtils.isEmpty(doorName) ? "" : doorName);
+            // 层数
+            int doorLayers = hxpCabinetDoorVo.getDoorLayers();
+            for (int i = 0; i < 8; i++) {
+                DrawerUiBean drawerUiBean = drawerUiUpList.get(i);
+                drawerUiBean.setVisible(i < doorLayers);
+            }
+
+            for (int i = 0; i < drawerUiUpList.size(); i++) {
+                DrawerUiBean drawerUiBean = drawerUiUpList.get(i);
+                if (drawerUiBean.isVisible()) {
+                    drawerUiBean.getRadioButton().setVisibility(View.VISIBLE);
+                    drawerUiBean.getTextView().setVisibility(View.VISIBLE);
+                }
+            }
+        }
+        // 两个柜门
+        else if (doorVoList.size() > 1) {
+            binding.cabinetRL.setBackgroundResource(R.mipmap.locker);
+            // 上柜门
+            HxpCabinetDoorVo hxpCabinetDoorUpVo = doorVoList.get(0);
+            String doorName = hxpCabinetDoorUpVo.getDoorName();
+            binding.upDoorNameTV.setText(TextUtils.isEmpty(doorName) ? "" : doorName);
+            // 层数
+            int doorUpLayers = hxpCabinetDoorUpVo.getDoorLayers();
+            for (int i = 0; i < 4; i++) {
+                DrawerUiBean drawerUiBean = drawerUiUpList.get(i);
+                drawerUiBean.setVisible(i < doorUpLayers);
+            }
+
+            for (int i = 0; i < drawerUiUpList.size(); i++) {
+                DrawerUiBean drawerUiBean = drawerUiUpList.get(i);
+                if (drawerUiBean.isVisible()) {
+                    drawerUiBean.getRadioButton().setVisibility(View.VISIBLE);
+                    drawerUiBean.getTextView().setVisibility(View.VISIBLE);
+                }
+            }
+
+            binding.lockerDownDrawerLL.setVisibility(View.VISIBLE);
+            binding.lockerDownDrawerRG.setVisibility(View.VISIBLE);
+
+            // 下柜门
+            HxpCabinetDoorVo hxpCabinetDoorDownVo = doorVoList.get(1);
+            String doorDownName = hxpCabinetDoorDownVo.getDoorName();
+            binding.downDoorNameTV.setText(TextUtils.isEmpty(doorDownName) ? "" : doorDownName);
+            // 层数
+            int doorDownLayers = hxpCabinetDoorDownVo.getDoorLayers();
+            for (int i = 0; i < 4; i++) {
+                DrawerUiBean drawerUiBean = drawerUiDownList.get(i);
+                drawerUiBean.setVisible(i < doorDownLayers);
+            }
+
+            for (int i = 0; i < drawerUiDownList.size(); i++) {
+                DrawerUiBean drawerUiBean = drawerUiDownList.get(i);
+                if (drawerUiBean.isVisible()) {
+                    drawerUiBean.getRadioButton().setVisibility(View.VISIBLE);
+                    drawerUiBean.getTextView().setVisibility(View.VISIBLE);
+                }
+            }
+        }
+    }
+
+    private View.OnClickListener createClickDoorUpListener(HxpCabinetVo hxpCabinetVo) {
+        return v -> {
+            if (-1 != binding.lockerDownDrawerRG.getCheckedRadioButtonId()) {
+                binding.lockerDownDrawerRG.clearCheck();
+            }
+            int layer = 0;
+            if (binding.lockerUpDrawer1RB.getId() == v.getId()) {
+                layer = 1;
+            } else if (binding.lockerUpDrawer2RB.getId() == v.getId()) {
+                layer = 2;
+            } else if (binding.lockerUpDrawer3RB.getId() == v.getId()) {
+                layer = 3;
+            } else if (binding.lockerUpDrawer4RB.getId() == v.getId()) {
+                layer = 4;
+            } else if (binding.lockerUpDrawer5RB.getId() == v.getId()) {
+                layer = 5;
+            } else if (binding.lockerUpDrawer6RB.getId() == v.getId()) {
+                layer = 6;
+            } else if (binding.lockerUpDrawer7RB.getId() == v.getId()) {
+                layer = 7;
+            } else if (binding.lockerUpDrawer8RB.getId() == v.getId()) {
+                layer = 8;
+            }
+            LogUtils.d("上柜", layer + "层");
+            fragmentCallBack.onSelected(new CabinetLayerSelect(hxpCabinetVo.getCabinetId(), hxpCabinetVo.getCabinetDoorVoList().get(0).getDoorId(), layer));
+        };
+    }
+
+    private View.OnClickListener createClickDoorDownListener(HxpCabinetVo hxpCabinetVo) {
+        return v -> {
+            if (-1 != binding.lockerUpDrawerRG.getCheckedRadioButtonId()) {
+                binding.lockerUpDrawerRG.clearCheck();
+            }
+            int layer = 0;
+            if (binding.lockerDownDrawer1RB.getId() == v.getId()) {
+                layer = 1;
+            } else if (binding.lockerDownDrawer2RB.getId() == v.getId()) {
+                layer = 2;
+            } else if (binding.lockerDownDrawer3RB.getId() == v.getId()) {
+                layer = 3;
+            } else if (binding.lockerDownDrawer4RB.getId() == v.getId()) {
+                layer = 4;
+            }
+            LogUtils.d("下柜", layer + "层");
+            fragmentCallBack.onSelected(new CabinetLayerSelect(hxpCabinetVo.getCabinetId(), hxpCabinetVo.getCabinetDoorVoList().get(1).getDoorId(), layer));
+        };
+    }
+
+    public void recycle() {
+        drawerUiMap.clear();
+        binding = null;
+    }
+
+}

+ 0 - 1
app/src/main/java/com/example/chemical/ui/plan/room/bean/locker/HxpCabinetDoorVo.java

@@ -45,7 +45,6 @@ public class HxpCabinetDoorVo {
     // ("机柜锁列表")
     private List<HxpCabinetLockVo> cabinetLockVoList = new ArrayList<>();
     // 柜层信息列表
-    @Ignore
     private List<CabinetLayerSelect> cabinetLayerSelectList = new ArrayList<>();
 
 

+ 0 - 1
app/src/main/java/com/example/chemical/ui/plan/room/bean/locker/HxpCabinetVo.java

@@ -65,7 +65,6 @@ public class HxpCabinetVo {
     // ("修改时间")
     private String updateTime;
     // ("柜门列表")
-    @Ignore
     private List<HxpCabinetDoorVo> cabinetDoorVoList = new ArrayList<>();
 
     // 选择信息

+ 42 - 32
app/src/main/java/com/example/chemical/weidith/prin_label_dialog/PrintLabelDialog.java

@@ -140,38 +140,48 @@ public class PrintLabelDialog extends AppCompatDialog {
         // 确定
         binding.determine.setOnClickListener(v -> {
             printState(true);
-            for (int i = 0; i < labelList.size(); i++) {
-                StockDetailsModel stockDetailsModel = labelList.get(i);
-                PrintBean printBean = new PrintBean();
-                // 化学品编码
-                String tagCode = stockDetailsModel.getTagCode();
-                printBean.setTag(TextUtils.isEmpty(tagCode) ? "" : tagCode);
-                // 二维码
-                String wxCode = stockDetailsModel.getWxCode();
-                printBean.setWxCode(TextUtils.isEmpty(wxCode) ? "" : wxCode);
-                // 化学品名
-                printBean.setName(TextUtils.isEmpty(chemicalName) ? "" : chemicalName);
-                // CAS
-                String casNum = hxpChemicalVo.getCasNum();
-                printBean.setCasNo(TextUtils.isEmpty(casNum) ? "" : casNum);
-                // 归属人
-                BelongingPersonBean belongingPersonBean = inventoryItemBean.getBelongingPersonBean();
-                String belongingPersonUserName = belongingPersonBean.getUserName();
-                printBean.setPerson(TextUtils.isEmpty(belongingPersonUserName) ? "" : belongingPersonUserName);
-                // 管控非管控
-                int chemicalLevel = hxpChemicalVo.getChemicalLevel();
-                printBean.setLevel(1 == chemicalLevel ? "管控" : "非管控");
-                // 化学品类型
-                CharSequence chemicalCategory = hxpChemicalVo.getChemicalCategoryName();
-                printBean.setTypes(TextUtils.isEmpty(chemicalCategory) ? "" : chemicalCategory.toString());
-                // 打印
-                if (isPrint) {
-                    printLabel(printBean);
-                } else {
-                    printLabelCallBack.confirm(labelList);
+            ThreadUtils.executeByCached(new ThreadUtils.SimpleTask<Object>() {
+                @Override
+                public Object doInBackground() throws Throwable {
+                    for (int i = 0; i < labelList.size(); i++) {
+                        StockDetailsModel stockDetailsModel = labelList.get(i);
+                        PrintBean printBean = new PrintBean();
+                        // 化学品编码
+                        String tagCode = stockDetailsModel.getTagCode();
+                        printBean.setTag(TextUtils.isEmpty(tagCode) ? "" : tagCode);
+                        // 二维码
+                        String wxCode = stockDetailsModel.getWxCode();
+                        printBean.setWxCode(TextUtils.isEmpty(wxCode) ? "" : wxCode);
+                        // 化学品名
+                        printBean.setName(TextUtils.isEmpty(chemicalName) ? "" : chemicalName);
+                        // CAS
+                        String casNum = hxpChemicalVo.getCasNum();
+                        printBean.setCasNo(TextUtils.isEmpty(casNum) ? "" : casNum);
+                        // 归属人
+                        BelongingPersonBean belongingPersonBean = inventoryItemBean.getBelongingPersonBean();
+                        String belongingPersonUserName = belongingPersonBean.getUserName();
+                        printBean.setPerson(TextUtils.isEmpty(belongingPersonUserName) ? "" : belongingPersonUserName);
+                        // 管控非管控
+                        int chemicalLevel = hxpChemicalVo.getChemicalLevel();
+                        printBean.setLevel(1 == chemicalLevel ? "管控" : "非管控");
+                        // 化学品类型
+                        CharSequence chemicalCategory = hxpChemicalVo.getChemicalCategoryName();
+                        printBean.setTypes(TextUtils.isEmpty(chemicalCategory) ? "" : chemicalCategory.toString());
+                        // 打印
+                        if (isPrint) {
+                            printLabel(printBean);
+                        }
+                    }
+                    return null;
                 }
-            }
-            printState(false);
+
+                @Override
+                public void onSuccess(Object result) {
+                    printState(false);
+                    printLabelCallBack.confirm();
+                    dismiss();
+                }
+            });
         });
         // 请扫描标签音频播放
         AudioPlayer.getInstance().play(R.raw.saomiaobiaoqian);
@@ -220,7 +230,7 @@ public class PrintLabelDialog extends AppCompatDialog {
     }
 
     public interface PrintLabelCallBack {
-        void confirm(List<StockDetailsModel> labelList);
+        void confirm();
 
         void close();
     }

+ 6 - 0
app/src/main/res/layout/activity_add.xml

@@ -151,6 +151,7 @@
                 android:text="重置" />
 
             <Button
+                android:id="@+id/weigh_save_BT"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="称重存储" />
@@ -200,6 +201,7 @@
                         android:imeOptions="actionSearch"
                         android:maxLines="1"
                         android:paddingHorizontal="10px"
+                        android:text="乙酸"
                         android:textAppearance="@style/input_hint_text_size" />
 
                     <Button
@@ -282,6 +284,7 @@
                             android:imeOptions="actionDone"
                             android:inputType="numberDecimal"
                             android:paddingHorizontal="10px"
+                            android:text="30"
                             android:textAppearance="@style/input_hint_text_size" />
                     </RelativeLayout>
                 </LinearLayout>
@@ -310,6 +313,7 @@
                         android:hint="输入姓名或工号搜索"
                         android:imeOptions="actionSearch"
                         android:paddingHorizontal="10px"
+                        android:text="刘一航"
                         android:textAppearance="@style/input_hint_text_size" />
 
                     <Button
@@ -350,6 +354,7 @@
                         android:text="请选择化学品柜层" />
 
                     <Button
+                        android:id="@+id/change_cabinet_BT"
                         android:layout_width="80px"
                         android:layout_height="50px"
                         android:layout_marginStart="10px"
@@ -490,6 +495,7 @@
                         android:imeOptions="actionDone"
                         android:inputType="number"
                         android:paddingHorizontal="10px"
+                        android:text="2"
                         android:textAppearance="@style/input_hint_text_size" />
 
                 </LinearLayout>

+ 15 - 4
app/src/main/res/layout/activity_change_cabinet.xml

@@ -123,24 +123,32 @@
         android:layout_marginBottom="69dp"
         android:background="@drawable/bg_add_chemicals_one">
 
+        <TextView
+            android:id="@+id/count_TV"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerHorizontal="true"
+            android:text="1/3" />
+
         <LinearLayout
             android:id="@+id/control_LL"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
             android:layout_centerHorizontal="true"
-            android:layout_marginTop="10px"
             android:layout_marginBottom="10px"
             android:orientation="horizontal">
 
             <Button
+                android:id="@+id/cancel_BT"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_height="70px"
                 android:text="取消" />
 
             <Button
+                android:id="@+id/confirm_BT"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_height="70px"
                 android:text="确定" />
         </LinearLayout>
 
@@ -148,11 +156,12 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:layout_above="@id/control_LL"
+            android:layout_below="@id/count_TV"
             android:layout_margin="10px">
 
             <androidx.viewpager2.widget.ViewPager2
                 android:id="@+id/cabinet_VP"
-                android:layout_width="1260px"
+                android:layout_width="1360px"
                 android:layout_height="match_parent"
                 android:layout_centerInParent="true"
                 android:layout_weight="1" />
@@ -165,6 +174,7 @@
                 android:layout_toStartOf="@id/cabinet_VP">
 
                 <Button
+                    android:id="@+id/last_BT"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_centerInParent="true"
@@ -178,6 +188,7 @@
                 android:layout_toEndOf="@id/cabinet_VP">
 
                 <Button
+                    android:id="@+id/next_BT"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_centerInParent="true"

+ 2 - 1
app/src/main/res/layout/fragment_change_cabinet.xml

@@ -5,7 +5,8 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:animateLayoutChanges="true"
+    android:background="#50000000"
+    android:gravity="center"
     android:orientation="horizontal"
     tools:ignore="PxUsage">
-
 </LinearLayout>

+ 7 - 4
app/src/main/res/layout/include_cabinet.xml

@@ -1,15 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout 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"
     android:layout_weight="1"
     android:gravity="center"
+    android:paddingHorizontal="20px"
     tools:ignore="PxUsage">
 
     <RelativeLayout
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+        android:id="@+id/cabinet_RL"
+        android:layout_width="610px"
+        android:layout_height="650px"
+        android:layout_centerInParent="true"
         android:background="@mipmap/locker">
 
         <RelativeLayout
@@ -350,4 +353,4 @@
             android:textSize="16sp" />
 
     </RelativeLayout>
-</LinearLayout>
+</RelativeLayout>

BIN
app/src/main/res/mipmap-xhdpi/locker_one.png