diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/main/device/NavDeviceFragment.java b/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/main/device/NavDeviceFragment.java index 88c1994..7705df9 100644 --- a/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/main/device/NavDeviceFragment.java +++ b/app/src/main/java/cc/niushuai/project/devcontrol/ui/nav/main/device/NavDeviceFragment.java @@ -60,13 +60,16 @@ public class NavDeviceFragment extends Fragment { for (int i = 0; i < 3; i++) { HashMap m1 = new HashMap<>(); - m1.put("device_item_imageView", R.drawable.ic_mark_as_read); - m1.put("device_item_textView", "卧室灯" + i); + m1.put("device_item_cardView_image", R.drawable.ic_device_light_1); + m1.put("device_item_cardView_text", "卧室灯" + i); dataItem.add(m1); } +// SimpleAdapter gvAdapter = new SimpleAdapter(getContext(), dataItem, R.layout.device_item, +// new String[]{"device_item_cardView_text"}, new int[]{R.id.device_item_cardView_text}); + SimpleAdapter gvAdapter = new SimpleAdapter(getContext(), dataItem, R.layout.device_item, - new String[]{"device_item_imageView", "device_item_textView"}, new int[]{R.id.device_item_imageView, R.id.device_item_textView}); + new String[]{"device_item_cardView_image", "device_item_cardView_text"}, new int[]{R.id.device_item_cardView_image, R.id.device_item_cardView_text}); deviceGv.setAdapter(gvAdapter); } diff --git a/app/src/main/res/layout/device_item.xml b/app/src/main/res/layout/device_item.xml index 7761cc2..4a04519 100644 --- a/app/src/main/res/layout/device_item.xml +++ b/app/src/main/res/layout/device_item.xml @@ -1,25 +1,48 @@ + - + - - \ No newline at end of file + + + + + + + diff --git a/app/src/main/res/layout/main_nav_fragment_device.xml b/app/src/main/res/layout/main_nav_fragment_device.xml index 52f20f6..8eadd04 100644 --- a/app/src/main/res/layout/main_nav_fragment_device.xml +++ b/app/src/main/res/layout/main_nav_fragment_device.xml @@ -19,10 +19,14 @@ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index f8c6127..cd2f8ae 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,4 +7,6 @@ #FF018786 #FF000000 #FFFFFFFF + #FFAFAFAF + #F6F6F6 \ No newline at end of file diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml index 48a1b82..ec06172 100644 --- a/app/src/main/res/values/ids.xml +++ b/app/src/main/res/values/ids.xml @@ -6,4 +6,13 @@ + + + + + + + + + \ No newline at end of file