From 8f885a045ec3a9d47301530ef4690cacc70036a6 Mon Sep 17 00:00:00 2001 From: niushuai233 Date: Tue, 25 Oct 2022 16:05:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=9A=90=E8=97=8F=E6=9B=B4=E6=8D=A2?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devcontrol/base/enums/IconEnum.java | 40 ++++++++++++------- .../res/layout/activity_power_switch_set.xml | 3 +- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/base/enums/IconEnum.java b/app/src/main/java/cc/niushuai/project/devcontrol/base/enums/IconEnum.java index 558881d..96eba69 100644 --- a/app/src/main/java/cc/niushuai/project/devcontrol/base/enums/IconEnum.java +++ b/app/src/main/java/cc/niushuai/project/devcontrol/base/enums/IconEnum.java @@ -9,32 +9,44 @@ import cc.niushuai.project.devcontrol.R; * @date 2022/10/25 14:57 */ public enum IconEnum { - POWER_SWITCH(R.drawable.ic_device_type_switch, "开关"), - LIGHT(R.drawable.ic_device_type_light, "灯具"), - CAMERA(R.drawable.ic_device_type_camera, "摄像机"), - AIR_CONDITIONER(R.drawable.ic_device_type_air_conditioner, "空调"), - REFRIGERATOR(R.drawable.ic_device_type_refrigerator, "冰箱"), - SOCKET(R.drawable.ic_device_type_socket, "插座"), - WASHER(R.drawable.ic_device_type_washer, "洗衣机"), - DEVICE(R.drawable.ic_device_type_custom, "设备"), + + POWER_SWITCH(R.drawable.ic_device_type_switch, R.drawable.ic_device_type_switch, "开关"), + LIGHT(R.drawable.ic_device_type_light, R.drawable.ic_device_type_light, "灯具"), + CAMERA(R.drawable.ic_device_type_camera, R.drawable.ic_device_type_camera, "摄像机"), + AIR_CONDITIONER(R.drawable.ic_device_type_air_conditioner, R.drawable.ic_device_type_air_conditioner, "空调"), + REFRIGERATOR(R.drawable.ic_device_type_refrigerator, R.drawable.ic_device_type_refrigerator, "冰箱"), + SOCKET(R.drawable.ic_device_type_socket, R.drawable.ic_device_type_socket, "插座"), + WASHER(R.drawable.ic_device_type_washer, R.drawable.ic_device_type_washer, "洗衣机"), + DEVICE(R.drawable.ic_device_type_custom, R.drawable.ic_device_type_custom, "设备"), ; /** - * 资源id + * 暗色资源id */ - private Integer iconId; + private Integer iconIdDark; + + /** + * 亮色资源id + */ + private Integer iconIdLight; + /** * 描述 */ private String desc; - IconEnum(Integer iconId, String desc) { - this.iconId = iconId; + IconEnum(Integer iconIdDark, Integer iconIdLight, String desc) { + this.iconIdDark = iconIdDark; + this.iconIdLight = iconIdLight; this.desc = desc; } - public Integer getIconId() { - return iconId; + public Integer getIconIdDark() { + return iconIdDark; + } + + public Integer getIconIdLight() { + return iconIdLight; } public String getDesc() { diff --git a/app/src/main/res/layout/activity_power_switch_set.xml b/app/src/main/res/layout/activity_power_switch_set.xml index dd0c4ce..6fc01f6 100644 --- a/app/src/main/res/layout/activity_power_switch_set.xml +++ b/app/src/main/res/layout/activity_power_switch_set.xml @@ -20,7 +20,8 @@ android:layout_height="50dp" android:layout_below="@id/activity_layout_title" android:layout_gravity="center_horizontal" - android:orientation="horizontal"> + android:orientation="horizontal" + android:visibility="gone">