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 @@
-
-
-
-
-
-
-