| | |
| | | import androidx.recyclerview.widget.LinearLayoutManager; |
| | | import androidx.recyclerview.widget.RecyclerView; |
| | | |
| | | import com.example.agvcontroller.socket.SocketManager; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | private RecyclerView recyclerView; |
| | | private List<Item> items; |
| | | private ItemAdapter adapter; |
| | | SocketManager socketManager; |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | setContentView(R.layout.activity_start); |
| | | |
| | | socketManager = new SocketManager(); |
| | | socketManager.startServer(8080); |
| | | |
| | | recyclerView = findViewById(R.id.recyclerView); |
| | | recyclerView.setLayoutManager(new LinearLayoutManager(this)); |
| | | |
| | | items = new ArrayList<>(); |
| | | items.add(new Item("192.168.4.188", "Item 1", "Description of Item 1")); |
| | | items.add(new Item("192.168.4.61", "Item 2", "Description of Item 2")); |
| | | items.add(new Item("192.168.4.233", "Item 3", "Description of Item 3")); |
| | | //items.add(new Item("192.168.4.188", "Item 1", "Description of Item 1")); |
| | | //items.add(new Item("192.168.4.61", "Item 2", "Description of Item 2")); |
| | | //items.add(new Item("192.168.4.233", "Item 3", "Description of Item 3")); |
| | | |
| | | adapter = new ItemAdapter(items); |
| | | recyclerView.setAdapter(adapter); |
| | | adapter.addItem(new Item("AGV-3948", "192.168.4.188:56487", "Description of Item 1")); |
| | | } |
| | | } |