mirror of
https://github.com/niushuai233/DevControl.git
synced 2024-10-27 22:43:20 +08:00
feat: 跳转到对应的设备添加页面
This commit is contained in:
parent
7e5035fb6b
commit
ba82a08a6e
@ -3,15 +3,22 @@ package cc.niushuai.project.devcontrol.ui.deviceadd;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import cc.niushuai.project.devcontrol.R;
|
||||
import cc.niushuai.project.devcontrol.base.ui.BaseActivity;
|
||||
import cc.niushuai.project.devcontrol.databinding.ActivityDeviceAddPowerSwitchBinding;
|
||||
|
||||
public class DeviceAddPowerSwitchActivity extends BaseActivity {
|
||||
|
||||
private ActivityDeviceAddPowerSwitchBinding binding;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_device_add_power_switch);
|
||||
|
||||
binding = ActivityDeviceAddPowerSwitchBinding.inflate(getLayoutInflater());
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
this.init();
|
||||
this.addListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cc.niushuai.project.devcontrol.ui.nav.device;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
@ -12,15 +11,9 @@ import android.widget.AdapterView;
|
||||
import android.widget.GridView;
|
||||
import android.widget.SimpleAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -92,9 +85,13 @@ public class DeviceAddDialogFragment extends DialogFragment {
|
||||
* @date: 2022/10/20 16:59
|
||||
*/
|
||||
private void deviceTypeListItemClickListener(AdapterView<?> parent, View view, int position, long id) {
|
||||
TextView keyView = view.findViewById(R.id.device_type_list_key);
|
||||
|
||||
// 跳转到相应的activity
|
||||
TextView keyView = view.findViewById(R.id.device_type_list_key);
|
||||
ActivityUtil.startActivity(getActivity(), DeviceTypeEnum.matchByValue(keyView.getText().toString()).getDeviceAddActivity());
|
||||
|
||||
// 关闭弹出框
|
||||
this.dismiss();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,4 +117,10 @@ public class DeviceAddDialogFragment extends DialogFragment {
|
||||
|
||||
return gvData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
|
@ -95,5 +95,9 @@ public class PowerSwitchActivity extends BaseActivity {
|
||||
((AppCompatImageView) findViewById(R.id.power_switch_activity_content_icon)).setImageResource(iconImageId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
|
@ -59,4 +59,10 @@ public class PowerSwitchSetActivity extends BaseActivity {
|
||||
private void outsideLogViewClickListener(View view) {
|
||||
Toast.makeText(this, "日志暂未实现哦", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
binding = null;
|
||||
}
|
||||
}
|
@ -49,4 +49,10 @@ public class PowerSwitchSetParamActivity extends BaseActivity {
|
||||
|
||||
Toast.makeText(this, "已保存", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
binding = null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user