diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 3921051..7c42d08 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -9,6 +9,8 @@
android:roundIcon="@mipmap/app_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.DevControl">
+
+
@@ -19,12 +21,21 @@
+
+ android:exported="false">
+
+
+
-
+
+
+
+
diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/base/util/ActivityUtil.java b/app/src/main/java/cc/niushuai/project/devcontrol/base/util/ActivityUtil.java
new file mode 100644
index 0000000..ff3ee7d
--- /dev/null
+++ b/app/src/main/java/cc/niushuai/project/devcontrol/base/util/ActivityUtil.java
@@ -0,0 +1,29 @@
+package cc.niushuai.project.devcontrol.base.util;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.niushuai.project.devcontrol.base.ui.BaseActivity;
+
+public class ActivityUtil {
+
+ public static void startActivity(Activity sourceActivity, Class extends BaseActivity> targetActivity) {
+
+ startActivity(sourceActivity, targetActivity, null);
+ }
+
+ public static void startActivity(Activity sourceActivity, Class extends BaseActivity> targetActivity,
+ Map withData) {
+ Intent intent = new Intent(sourceActivity, targetActivity);
+ if (null != withData) {
+ for (String key : withData.keySet()) {
+ intent.putExtra(key, withData.get(key));
+ }
+ }
+ sourceActivity.startActivity(intent);
+ }
+}
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 fda78ee..fea4f21 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
@@ -11,13 +11,14 @@ import cc.niushuai.project.devcontrol.R;
import cc.niushuai.project.devcontrol.base.entity.device.DeviceInfo;
import cc.niushuai.project.devcontrol.base.enums.OnOffEnum;
import cc.niushuai.project.devcontrol.base.ui.BaseActivity;
+import cc.niushuai.project.devcontrol.base.util.ActivityUtil;
import cc.niushuai.project.devcontrol.base.util.GlobalVariables;
import cc.niushuai.project.devcontrol.base.util.Keys;
-import cc.niushuai.project.devcontrol.databinding.DevicePowerSwitchActivityBinding;
+import cc.niushuai.project.devcontrol.databinding.ActivityPowerSwitchBinding;
public class PowerSwitchActivity extends BaseActivity {
- private DevicePowerSwitchActivityBinding binding;
+ private ActivityPowerSwitchBinding binding;
private DeviceInfo device;
@Override
@@ -26,7 +27,7 @@ public class PowerSwitchActivity extends BaseActivity {
// 隐藏自带的标题栏
getSupportActionBar().hide();
- binding = DevicePowerSwitchActivityBinding.inflate(getLayoutInflater());
+ binding = ActivityPowerSwitchBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
// 初始化页面数据
@@ -85,11 +86,8 @@ public class PowerSwitchActivity extends BaseActivity {
* @author niushuai
* @date: 2022/10/19 14:47
*/
-
private void buttonMoreSetClickListener(View view) {
-
-
-
+ ActivityUtil.startActivity(this, PowerSwitchSetActivity.class);
}
/**
diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchSetActivity.java b/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchSetActivity.java
new file mode 100644
index 0000000..40f7ba2
--- /dev/null
+++ b/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchSetActivity.java
@@ -0,0 +1,17 @@
+package cc.niushuai.project.devcontrol.ui.powerswitch;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+
+import cc.niushuai.project.devcontrol.R;
+import cc.niushuai.project.devcontrol.base.ui.BaseActivity;
+
+public class PowerSwitchSetActivity extends BaseActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_power_switch_set);
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchViewModel.java b/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchViewModel.java
deleted file mode 100644
index 7818c7e..0000000
--- a/app/src/main/java/cc/niushuai/project/devcontrol/ui/powerswitch/PowerSwitchViewModel.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package cc.niushuai.project.devcontrol.ui.powerswitch;
-
-import androidx.lifecycle.MutableLiveData;
-import androidx.lifecycle.ViewModel;
-
-import cc.niushuai.project.devcontrol.base.entity.device.DeviceInfo;
-
-public class PowerSwitchViewModel extends ViewModel {
-
- private MutableLiveData deviceInfo;
-
- public PowerSwitchViewModel() {
- }
-
- public MutableLiveData getDeviceInfo() {
- return deviceInfo;
- }
-
- public void setDeviceInfo(MutableLiveData deviceInfo) {
- this.deviceInfo = deviceInfo;
- }
-}
diff --git a/app/src/main/res/layout/device_power_switch_activity.xml b/app/src/main/res/layout/activity_power_switch.xml
similarity index 100%
rename from app/src/main/res/layout/device_power_switch_activity.xml
rename to app/src/main/res/layout/activity_power_switch.xml
diff --git a/app/src/main/res/layout/activity_power_switch_set.xml b/app/src/main/res/layout/activity_power_switch_set.xml
new file mode 100644
index 0000000..a70323d
--- /dev/null
+++ b/app/src/main/res/layout/activity_power_switch_set.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
\ No newline at end of file