#
whycq
2025-02-06 318bd727e2fe02e4f541dfe943f77606af41d509
app/src/main/java/com/example/agvcontroller/ItemAdapter.java
@@ -1,8 +1,5 @@
package com.example.agvcontroller;
import static androidx.core.content.ContextCompat.startActivity;
import android.content.Intent;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
@@ -17,9 +14,9 @@
public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ViewHolder> {
    private List<Item> itemList;
    private List<AGVCar> itemList;
    public ItemAdapter(List<Item> itemList) {
    public ItemAdapter(List<AGVCar> itemList) {
        this.itemList = itemList;
    }
@@ -86,7 +83,7 @@
            // 默认显示页面
            //return 1;
        } else {
            Item item = itemList.get(position);
            AGVCar item = itemList.get(position);
            int status = item.getStatus();
            switch (status) {
                case 0:
@@ -114,7 +111,7 @@
        }
    }
    public void addItem (Item item) {
    public void addItem (AGVCar item) {
        itemList.add(item);
        notifyItemInserted(itemList.size() - 1);
    }