From 044da69a5068fca023d1355a9e16a7cadbfaebb1 Mon Sep 17 00:00:00 2001 From: niushuai233 Date: Wed, 19 Oct 2022 17:16:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8A=BD=E5=8F=96=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/powerswitch/PowerSwitchActivity.java | 10 ++-- .../main/res/layout/activity_common_title.xml | 55 +++++++++++++++++ .../main/res/layout/activity_power_switch.xml | 59 +------------------ app/src/main/res/values/ids.xml | 16 ++--- 4 files changed, 73 insertions(+), 67 deletions(-) create mode 100644 app/src/main/res/layout/activity_common_title.xml diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchActivity.java b/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchActivity.java index a01a4ec..24c1e41 100644 --- a/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchActivity.java +++ b/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchActivity.java @@ -49,11 +49,11 @@ public class PowerSwitchActivity extends BaseActivity { if (null != data) { this.device = data; // 标题名称 - TextView titleTextView = findViewById(R.id.power_switch_activity_title_name); + TextView titleTextView = findViewById(R.id.activity_title_name); titleTextView.setText(device.getName()); // 副标题名称 - TextView descTextView = findViewById(R.id.power_switch_activity_title_description); + TextView descTextView = findViewById(R.id.activity_title_description); descTextView.setText(device.getDescription()); // 开关底部的名称 @@ -73,10 +73,12 @@ public class PowerSwitchActivity extends BaseActivity { binding.powerSwitchActivityContentSwitch.setOnClickListener(this::imageSwitchClickListener); // 标题栏 返回 - binding.powerSwitchActivityTitleBack.setOnClickListener(this::buttonBackClickListener); + findViewById(R.id.activity_title_back).setOnClickListener(this::buttonBackClickListener); +// binding.powerSwitchActivityTitleBack.setOnClickListener(this::buttonBackClickListener); // 标题栏 更多设置 - binding.powerSwitchActivityTitleMoreSet.setOnClickListener(this::buttonMoreSetClickListener); + findViewById(R.id.activity_title_more_set).setOnClickListener(this::buttonMoreSetClickListener); +// binding.powerSwitchActivityTitleMoreSet.setOnClickListener(this::buttonMoreSetClickListener); } /** diff --git a/app/src/main/res/layout/activity_common_title.xml b/app/src/main/res/layout/activity_common_title.xml new file mode 100644 index 0000000..8bd6218 --- /dev/null +++ b/app/src/main/res/layout/activity_common_title.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_power_switch.xml b/app/src/main/res/layout/activity_power_switch.xml index 1da95bb..2c78dc7 100644 --- a/app/src/main/res/layout/activity_power_switch.xml +++ b/app/src/main/res/layout/activity_power_switch.xml @@ -12,67 +12,14 @@ android:layout_height="match_parent" android:background="@color/main_bg_color"> - - - - - - - - - - - - - - - - - + - + android:layout_below="@id/activity_layout_title" + android:background="@color/main_bg_color"> + + + + + + + + + @@ -18,15 +27,8 @@ - - - - - - -