扫描二维码,连接配网1
This commit is contained in:
@@ -100,6 +100,10 @@ public abstract class BaseFragment<T extends ViewBinding,P extends IPresenter> e
|
|||||||
return EasyPermissions.hasPermissions(mContext, permission);
|
return EasyPermissions.hasPermissions(mContext, permission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasRecordPermission(String[] permission) {
|
||||||
|
return EasyPermissions.hasPermissions(mContext, permission);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取权限
|
* 获取权限
|
||||||
*
|
*
|
||||||
@@ -145,6 +149,50 @@ public abstract class BaseFragment<T extends ViewBinding,P extends IPresenter> e
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一次获取多个权限
|
||||||
|
*
|
||||||
|
* @param permis
|
||||||
|
* @param title
|
||||||
|
* @param content
|
||||||
|
* @param requestCode String... permis
|
||||||
|
*/
|
||||||
|
public void getMorePermissionRequst(String[] permis, String title, String content, int requestCode) {
|
||||||
|
if (EasyPermissions.hasPermissions(mContext, permis)) {
|
||||||
|
// 已有权限,不需要处理
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 还没权限,弹自定义确认弹窗
|
||||||
|
showDialogtextInterBackKey(
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
title,
|
||||||
|
content,
|
||||||
|
getString(R.string.button_deny),
|
||||||
|
getString(R.string.button_allow),
|
||||||
|
new BaseFragment.OnDialogClick() {
|
||||||
|
@Override
|
||||||
|
public void onCancelClick() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfirmClick() {
|
||||||
|
showPermissionDialog(mContext.getResources().getDrawable(R.mipmap.img_permission_file),
|
||||||
|
true, title, content);
|
||||||
|
boolean shouldShowRationale = false;
|
||||||
|
for (String p : permis) {
|
||||||
|
if (ActivityCompat.shouldShowRequestPermissionRationale(mContext, p)) {
|
||||||
|
shouldShowRationale = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 使用 EasyPermissions 请求权限(系统决定是否弹系统框)
|
||||||
|
EasyPermissions.requestPermissions(mContext, content, requestCode, permis);
|
||||||
|
}
|
||||||
|
},false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断Fragment是否真正对用户可见
|
* 判断Fragment是否真正对用户可见
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package com.ckkj.water.device;
|
package com.ckkj.water.device;
|
||||||
|
|
||||||
import static android.view.View.GONE;
|
import static android.view.View.GONE;
|
||||||
import static android.view.View.VISIBLE;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.AnimationDrawable;
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -35,7 +33,6 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import no.nordicsemi.android.ble.BleManager;
|
|
||||||
import pub.devrel.easypermissions.EasyPermissions;
|
import pub.devrel.easypermissions.EasyPermissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -190,7 +187,7 @@ public class AddDeviceActivity extends BaseActivity<AddDeviceLayoutBinding, Devi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,28 +7,24 @@ import android.Manifest;
|
|||||||
import android.bluetooth.BluetoothAdapter;
|
import android.bluetooth.BluetoothAdapter;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.bluetooth.BluetoothManager;
|
import android.bluetooth.BluetoothManager;
|
||||||
import android.bluetooth.le.BluetoothLeScanner;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.drawable.AnimationDrawable;
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.ParcelUuid;
|
import android.os.ParcelUuid;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.ckkj.water.BuildConfig;
|
|
||||||
import com.ckkj.water.ConstantUtil;
|
import com.ckkj.water.ConstantUtil;
|
||||||
import com.ckkj.water.R;
|
import com.ckkj.water.R;
|
||||||
import com.ckkj.water.base.BaseActivity;
|
import com.ckkj.water.base.BaseActivity;
|
||||||
@@ -50,14 +46,12 @@ import com.maning.mlkitscanner.scan.callback.act.MNScanCallback;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import no.nordicsemi.android.ble.observer.ConnectionObserver;
|
|
||||||
import no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerCompat;
|
import no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerCompat;
|
||||||
import no.nordicsemi.android.support.v18.scanner.ScanCallback;
|
import no.nordicsemi.android.support.v18.scanner.ScanCallback;
|
||||||
import no.nordicsemi.android.support.v18.scanner.ScanFilter;
|
import no.nordicsemi.android.support.v18.scanner.ScanFilter;
|
||||||
@@ -430,7 +424,7 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.ckkj.water.device;
|
package com.ckkj.water.device;
|
||||||
|
|
||||||
import static android.view.View.GONE;
|
import static android.view.View.GONE;
|
||||||
import static android.view.View.INVISIBLE;
|
|
||||||
import static android.view.View.VISIBLE;
|
import static android.view.View.VISIBLE;
|
||||||
|
|
||||||
import android.graphics.drawable.AnimationDrawable;
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
@@ -134,8 +133,8 @@ public class DeviceConnectActivity extends BaseActivity<DeviceConnectLayoutBindi
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putString("wifi_name", mWifiName);
|
mBleDeviceEntity.setWifiName(mWifiName);
|
||||||
bundle.putString("wifi_password", mWifiPassword);
|
mBleDeviceEntity.setWifiPassword(mWifiPassword);
|
||||||
bundle.putSerializable("ble_device_entity", mBleDeviceEntity);
|
bundle.putSerializable("ble_device_entity", mBleDeviceEntity);
|
||||||
goTo(mContext, DeviceReNameActivity.class, bundle);
|
goTo(mContext, DeviceReNameActivity.class, bundle);
|
||||||
finish();
|
finish();
|
||||||
@@ -254,7 +253,7 @@ public class DeviceConnectActivity extends BaseActivity<DeviceConnectLayoutBindi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
|||||||
import com.ckkj.water.EventMessage;
|
import com.ckkj.water.EventMessage;
|
||||||
import com.ckkj.water.R;
|
import com.ckkj.water.R;
|
||||||
import com.ckkj.water.base.BaseActivity;
|
import com.ckkj.water.base.BaseActivity;
|
||||||
import com.ckkj.water.base.BaseFragment;
|
|
||||||
import com.ckkj.water.custom.GridSpacingItemDecoration;
|
import com.ckkj.water.custom.GridSpacingItemDecoration;
|
||||||
import com.ckkj.water.custom.view.CustomBubbleAttachPopup;
|
import com.ckkj.water.custom.view.CustomBubbleAttachPopup;
|
||||||
import com.ckkj.water.databinding.DeviceControlLayoutBinding;
|
import com.ckkj.water.databinding.DeviceControlLayoutBinding;
|
||||||
@@ -21,7 +20,6 @@ import com.ckkj.water.device.mvp.DeviceImpl;
|
|||||||
import com.ckkj.water.device.mvp.DevicePresenter;
|
import com.ckkj.water.device.mvp.DevicePresenter;
|
||||||
import com.ckkj.water.index.entity.WaterDeviceEntity;
|
import com.ckkj.water.index.entity.WaterDeviceEntity;
|
||||||
import com.ckkj.water.network.BaseBean;
|
import com.ckkj.water.network.BaseBean;
|
||||||
import com.ckkj.water.plan.entity.WaterPlanWeekEntity;
|
|
||||||
import com.ckkj.water.utils.manager.PowerIconManage;
|
import com.ckkj.water.utils.manager.PowerIconManage;
|
||||||
import com.ckkj.water.utils.manager.ThemeManager;
|
import com.ckkj.water.utils.manager.ThemeManager;
|
||||||
import com.ckkj.water.utils.show.ToastUtil;
|
import com.ckkj.water.utils.show.ToastUtil;
|
||||||
@@ -61,15 +59,27 @@ public class DeviceControlActivity extends BaseActivity<DeviceControlLayoutBindi
|
|||||||
showLoadingDialog();
|
showLoadingDialog();
|
||||||
mPresenter.getDeviceDetailInfo(mDeviceEntity.getDeviceNo());
|
mPresenter.getDeviceDetailInfo(mDeviceEntity.getDeviceNo());
|
||||||
viewBinding.includedTitle.tvTitle.setText(mDeviceEntity.getDeviceName());
|
viewBinding.includedTitle.tvTitle.setText(mDeviceEntity.getDeviceName());
|
||||||
if(mDeviceEntity.getWorkStatus().equals("1")){
|
if(mDeviceEntity.getStatus().equals("1") || mDeviceEntity.getStatus().equals("2")){
|
||||||
viewBinding.tvDeviceStatus.setText(getString(R.string.device_status_working));
|
if(mDeviceEntity.getWorkStatus().equals("1")){
|
||||||
viewBinding.tvDeviceStatus.setTextColor(mContext.getResources().getColor(R.color.color_zhu));
|
viewBinding.tvDeviceStatus.setText(getString(R.string.device_status_working));
|
||||||
viewBinding.tvConfirm.setText(getString(R.string.device_control_stop));
|
viewBinding.tvDeviceStatus.setTextColor(mContext.getResources().getColor(R.color.color_zhu));
|
||||||
|
viewBinding.tvConfirm.setText(getString(R.string.device_control_stop));
|
||||||
|
}else{
|
||||||
|
viewBinding.tvDeviceStatus.setText(getString(R.string.device_status_not_working));
|
||||||
|
viewBinding.tvDeviceStatus.setTextColor(mContext.getResources().getColor(R.color.color_999999));
|
||||||
|
viewBinding.tvConfirm.setText(getString(R.string.device_control_start));
|
||||||
|
}
|
||||||
|
viewBinding.linearWifi.setBackground(mContext.getResources().getDrawable(R.drawable.shape_device_ctrl_green_cor12));
|
||||||
|
viewBinding.imgWifiLogo.setImageResource(R.mipmap.icon_ctrl_wifi_white);
|
||||||
}else{
|
}else{
|
||||||
viewBinding.tvDeviceStatus.setText(getString(R.string.device_status_not_working));
|
viewBinding.tvDeviceStatus.setText(getString(R.string.device_status_offline));
|
||||||
viewBinding.tvDeviceStatus.setTextColor(mContext.getResources().getColor(R.color.color_999999));
|
viewBinding.tvDeviceStatus.setTextColor(mContext.getResources().getColor(R.color.color_999999));
|
||||||
viewBinding.tvConfirm.setText(getString(R.string.device_control_start));
|
viewBinding.tvConfirm.setEnabled(false);
|
||||||
|
viewBinding.tvConfirm.setBackgroundColor(mContext.getResources().getColor(R.color.color_999999));
|
||||||
|
viewBinding.linearWifi.setBackground(mContext.getResources().getDrawable(R.drawable.shape_device_ctrl_white_cor12));
|
||||||
|
viewBinding.imgWifiLogo.setImageResource(R.mipmap.icon_ctrl_wifi_green);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mTimeList.add("1min");
|
mTimeList.add("1min");
|
||||||
@@ -307,7 +317,7 @@ public class DeviceControlActivity extends BaseActivity<DeviceControlLayoutBindi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ import com.gyf.immersionbar.ImmersionBar;
|
|||||||
*/
|
*/
|
||||||
public class DeviceInfoActivity extends BaseActivity<DeviceInfoLayoutBinding, DevicePresenter>
|
public class DeviceInfoActivity extends BaseActivity<DeviceInfoLayoutBinding, DevicePresenter>
|
||||||
implements DeviceContract.DeviceView {
|
implements DeviceContract.DeviceView {
|
||||||
|
|
||||||
|
private WaterDeviceEntity mDeviceEntity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DevicePresenter createPresenter() {
|
public DevicePresenter createPresenter() {
|
||||||
return new DevicePresenter(new DeviceImpl());
|
return new DevicePresenter(new DeviceImpl());
|
||||||
@@ -27,7 +30,14 @@ public class DeviceInfoActivity extends BaseActivity<DeviceInfoLayoutBinding, De
|
|||||||
@Override
|
@Override
|
||||||
public void initData(Bundle savedInstanceState) {
|
public void initData(Bundle savedInstanceState) {
|
||||||
super.initData(savedInstanceState);
|
super.initData(savedInstanceState);
|
||||||
|
Bundle bundle = getIntent().getExtras();
|
||||||
|
if(bundle != null){
|
||||||
|
mDeviceEntity = (WaterDeviceEntity) bundle.getSerializable("device_entity");
|
||||||
|
viewBinding.tvDevCode.setText(mDeviceEntity.getDeviceNo());
|
||||||
|
viewBinding.tvDevMod.setText(mDeviceEntity.getDeviceEm());
|
||||||
|
viewBinding.tvDeviceSerial.setText(mDeviceEntity.getDeviceSn());
|
||||||
|
viewBinding.tvDevVersion.setText(mDeviceEntity.getFwVer());
|
||||||
|
}
|
||||||
ImmersionBar.with(this)
|
ImmersionBar.with(this)
|
||||||
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext)) // 白色状态栏图标
|
.statusBarDarkFont(ThemeManager.isAppThemeLight(mContext)) // 白色状态栏图标
|
||||||
.navigationBarColor(R.color.mainBackgroundColor)
|
.navigationBarColor(R.color.mainBackgroundColor)
|
||||||
@@ -69,7 +79,7 @@ public class DeviceInfoActivity extends BaseActivity<DeviceInfoLayoutBinding, De
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,11 @@ public class DeviceReNameActivity extends BaseActivity<SetDeviceNameLayoutBindin
|
|||||||
super.initData(savedInstanceState);
|
super.initData(savedInstanceState);
|
||||||
Bundle bundle = getIntent().getExtras();
|
Bundle bundle = getIntent().getExtras();
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
mWifiName = bundle.getString("wifi_name", "");
|
|
||||||
mWifiPassword = bundle.getString("wifi_password", "");
|
|
||||||
mBleDeviceEntity = (WaterDeviceEntity) bundle.getSerializable("ble_device_entity");
|
mBleDeviceEntity = (WaterDeviceEntity) bundle.getSerializable("ble_device_entity");
|
||||||
|
if(mBleDeviceEntity != null){
|
||||||
|
mWifiName = mBleDeviceEntity.getWifiName();
|
||||||
|
mWifiPassword = mBleDeviceEntity.getWifiPassword();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImmersionBar.with(this)
|
ImmersionBar.with(this)
|
||||||
@@ -86,7 +88,7 @@ public class DeviceReNameActivity extends BaseActivity<SetDeviceNameLayoutBindin
|
|||||||
* @param bean
|
* @param bean
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
hideDialogLoading();
|
hideDialogLoading();
|
||||||
ToastUtil.showShort(mContext,"设备保存成功");
|
ToastUtil.showShort(mContext,"设备保存成功");
|
||||||
ActivityManager.removeActivityByTag(ConstantUtil.ADD_DEVICE_FLAG);
|
ActivityManager.removeActivityByTag(ConstantUtil.ADD_DEVICE_FLAG);
|
||||||
@@ -94,7 +96,7 @@ public class DeviceReNameActivity extends BaseActivity<SetDeviceNameLayoutBindin
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putSerializable("device_info",mBleDeviceEntity);
|
bundle.putSerializable("device_info",bean);
|
||||||
goTo(mContext,DeviceControlActivity.class,bundle);
|
goTo(mContext,DeviceControlActivity.class,bundle);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,9 @@ public class DeviceSettingsActivity extends BaseActivity<DeviceSettingsLayoutBin
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.rl_dev_info:
|
case R.id.rl_dev_info:
|
||||||
goTo(mContext, DeviceInfoActivity.class,null);
|
Bundle bundleDev = new Bundle();
|
||||||
|
bundleDev.putSerializable("device_entity",mDeviceEntity);
|
||||||
|
goTo(mContext, DeviceInfoActivity.class,bundleDev);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.rl_dev_wifi_manager:
|
case R.id.rl_dev_wifi_manager:
|
||||||
@@ -205,7 +207,7 @@ public class DeviceSettingsActivity extends BaseActivity<DeviceSettingsLayoutBin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ public class SelectWifiActivity extends BaseActivity<DeviceResetWifiBinding, Dev
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ public class SelectWifiActivity_copy extends BaseActivity<DeviceResetWifiBinding
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addDeviceSuccess(BaseBean bean) {
|
public void addDeviceSuccess(WaterDeviceEntity bean) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class DeviceContract {
|
|||||||
|
|
||||||
public interface DeviceView extends IView {
|
public interface DeviceView extends IView {
|
||||||
//添加设备成功g
|
//添加设备成功g
|
||||||
void addDeviceSuccess(BaseBean bean);
|
void addDeviceSuccess(WaterDeviceEntity bean);
|
||||||
void getDeviceDetailInfo(WaterDeviceEntity bean);
|
void getDeviceDetailInfo(WaterDeviceEntity bean);
|
||||||
void editDeviceInfoSuccess(BaseBean bean);
|
void editDeviceInfoSuccess(BaseBean bean);
|
||||||
void deleteDeviceSuccess(BaseBean bean);
|
void deleteDeviceSuccess(BaseBean bean);
|
||||||
|
|||||||
@@ -59,15 +59,15 @@ public class DeviceImpl implements DeviceContract.DataModel{
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.unsubscribeOn(Schedulers.io())
|
.unsubscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new Observer<BaseBean>() {
|
.subscribe(new Observer<BaseBean<WaterDeviceEntity>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSubscribe(@NonNull Disposable d) {
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onNext(@NonNull BaseBean bean) {
|
public void onNext(@NonNull BaseBean<WaterDeviceEntity> bean) {
|
||||||
if (bean.getCode() == 200) {
|
if (bean.getCode() == 200) {
|
||||||
callBack.success(bean,0);
|
callBack.success(bean.getData(),0);
|
||||||
} else {
|
} else {
|
||||||
callBack.fail(bean.getMessage());
|
callBack.fail(bean.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ public class DevicePresenter extends BasePresenter<DeviceContract.DeviceView> {
|
|||||||
// json.put("deviceEm","213123123123");
|
// json.put("deviceEm","213123123123");
|
||||||
// json.put("deviceSn","sdfsd32423gdfgdf3");
|
// json.put("deviceSn","sdfsd32423gdfgdf3");
|
||||||
// json.put("fwVer","fwVer-56565644");
|
// json.put("fwVer","fwVer-56565644");
|
||||||
impl.addDevice(json, new IndexContract.CallBack<BaseBean>() {
|
impl.addDevice(json, new IndexContract.CallBack<WaterDeviceEntity>() {
|
||||||
@Override
|
@Override
|
||||||
public void success(BaseBean bean,int total) {
|
public void success(WaterDeviceEntity bean,int total) {
|
||||||
if(DevicePresenter.this.getView() != null){
|
if(DevicePresenter.this.getView() != null){
|
||||||
DevicePresenter.this.getView().addDeviceSuccess(bean);
|
DevicePresenter.this.getView().addDeviceSuccess(bean);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.ckkj.water.index;
|
package com.ckkj.water.index;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.bluetooth.BluetoothAdapter;
|
||||||
|
import android.bluetooth.BluetoothManager;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -9,15 +14,19 @@ import android.view.View;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
import com.ckkj.water.AppConfig;
|
import com.ckkj.water.AppConfig;
|
||||||
import com.ckkj.water.R;
|
import com.ckkj.water.R;
|
||||||
import com.ckkj.water.base.BaseFragment;
|
import com.ckkj.water.base.BaseFragment;
|
||||||
import com.ckkj.water.custom.view.CustomRefreshHeader;
|
import com.ckkj.water.custom.view.CustomRefreshHeader;
|
||||||
import com.ckkj.water.databinding.IndexFragmentLayoutBinding;
|
import com.ckkj.water.databinding.IndexFragmentLayoutBinding;
|
||||||
|
import com.ckkj.water.ConstantUtil;
|
||||||
import com.ckkj.water.device.AddDeviceActivity;
|
import com.ckkj.water.device.AddDeviceActivity;
|
||||||
import com.ckkj.water.device.AddDeviceActivity_copy;
|
import com.ckkj.water.device.AddDeviceActivity_copy;
|
||||||
import com.ckkj.water.device.DeviceControlActivity;
|
import com.ckkj.water.device.DeviceControlActivity;
|
||||||
|
import com.ckkj.water.device.DeviceReNameActivity;
|
||||||
|
import com.ckkj.water.device.SelectWifiActivity;
|
||||||
import com.ckkj.water.history.entity.WateringRecord;
|
import com.ckkj.water.history.entity.WateringRecord;
|
||||||
import com.ckkj.water.index.adapter.DeviceAdapter;
|
import com.ckkj.water.index.adapter.DeviceAdapter;
|
||||||
import com.ckkj.water.index.entity.WaterDeviceEntity;
|
import com.ckkj.water.index.entity.WaterDeviceEntity;
|
||||||
@@ -49,6 +58,15 @@ public class IndexFragment extends BaseFragment<IndexFragmentLayoutBinding, Inde
|
|||||||
private List<WaterDeviceEntity> devList = new ArrayList<>();
|
private List<WaterDeviceEntity> devList = new ArrayList<>();
|
||||||
private int mCurrentPage = 1;
|
private int mCurrentPage = 1;
|
||||||
|
|
||||||
|
// 扫码待配网设备
|
||||||
|
private WaterDeviceEntity pendingDeviceEntity = null;
|
||||||
|
|
||||||
|
// 蓝牙相关
|
||||||
|
private static final int REQUEST_EVENT_CODE_BLUETOOTH_PERMISSION = 10002;
|
||||||
|
private static final int REQUEST_ENABLE_BT = 10003;
|
||||||
|
private BluetoothAdapter bluetoothAdapter;
|
||||||
|
private boolean bluetoothReady = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initArgs(Bundle bundle) {
|
protected void initArgs(Bundle bundle) {
|
||||||
}
|
}
|
||||||
@@ -242,14 +260,119 @@ public class IndexFragment extends BaseFragment<IndexFragmentLayoutBinding, Inde
|
|||||||
@Override
|
@Override
|
||||||
public void queryDeviceBindStatusSuccess(WaterDeviceEntity entity) {
|
public void queryDeviceBindStatusSuccess(WaterDeviceEntity entity) {
|
||||||
switch (entity.getBindDeviceStatus()){
|
switch (entity.getBindDeviceStatus()){
|
||||||
case 302:
|
|
||||||
//Todo 即这是一台没有在mqtt中注册的设备,App 需要通过蓝牙连接,并实现配网
|
|
||||||
//Todo entity 中有Mac地址,和设备名称,根据代码中现有的扫描、连接、配网代码,实现功能
|
|
||||||
|
|
||||||
|
case 200:
|
||||||
|
//该设备目前已经绑定了当前用户,直接跳转到设备控制页面
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable("device_info",entity.getBindDevice());
|
||||||
|
goTo(mContext, DeviceControlActivity.class,bundle);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 302:
|
||||||
|
// 这是一台没有在mqtt中注册的设备,需要通过蓝牙连接配网,(可理解为新设备,走蓝牙,配网)
|
||||||
|
// 先检查蓝牙权限和开启状态
|
||||||
|
pendingDeviceEntity = entity;
|
||||||
|
checkBluetoothAndProceed();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 304:
|
||||||
|
//该设备目前在线,已经在mqtt注册,但是没有绑定用户,需要跳转到绑定页面
|
||||||
|
Bundle bundleNoBind = new Bundle();
|
||||||
|
bundleNoBind.putSerializable("ble_device_entity", entity.getBindDevice());
|
||||||
|
goTo(mContext, DeviceReNameActivity.class, bundleNoBind);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查蓝牙权限和开启状态,然后跳转配网
|
||||||
|
*/
|
||||||
|
private void checkBluetoothAndProceed() {
|
||||||
|
// 1. 检查蓝牙权限
|
||||||
|
if (!checkBluetoothPermissions()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 检查蓝牙是否开启
|
||||||
|
if (!initBluetooth()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3. 权限和状态都正常,跳转配网页面
|
||||||
|
goToDeviceProvisioning();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查蓝牙权限
|
||||||
|
*/
|
||||||
|
private boolean checkBluetoothPermissions() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
|
String[] permissions = {
|
||||||
|
Manifest.permission.BLUETOOTH_SCAN,
|
||||||
|
Manifest.permission.BLUETOOTH_CONNECT,
|
||||||
|
Manifest.permission.ACCESS_FINE_LOCATION
|
||||||
|
};
|
||||||
|
if (!hasRecordPermission(permissions)) {
|
||||||
|
getMorePermissionRequst(permissions,
|
||||||
|
"蓝牙权限申请",
|
||||||
|
"智能浇水需要您的授权,获取蓝牙权限添加设备",
|
||||||
|
REQUEST_EVENT_CODE_BLUETOOTH_PERMISSION);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Android 12 以下需要位置权限
|
||||||
|
if (ContextCompat.checkSelfPermission(mContext, Manifest.permission.ACCESS_FINE_LOCATION)
|
||||||
|
!= PackageManager.PERMISSION_GRANTED) {
|
||||||
|
requestPermissions(new String[]{
|
||||||
|
Manifest.permission.ACCESS_FINE_LOCATION
|
||||||
|
}, REQUEST_EVENT_CODE_BLUETOOTH_PERMISSION);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化蓝牙适配器并检查蓝牙是否开启
|
||||||
|
* @return true 表示蓝牙已开启,false 表示未开启或不支持
|
||||||
|
*/
|
||||||
|
private boolean initBluetooth() {
|
||||||
|
BluetoothManager bluetoothManager = (BluetoothManager) mContext.getSystemService(Context.BLUETOOTH_SERVICE);
|
||||||
|
if (bluetoothManager != null) {
|
||||||
|
bluetoothAdapter = bluetoothManager.getAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bluetoothAdapter == null) {
|
||||||
|
ToastUtil.showShort(mContext, "设备不支持蓝牙");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bluetoothAdapter.isEnabled()) {
|
||||||
|
// 蓝牙未开启,请求开启
|
||||||
|
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||||
|
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bluetoothReady = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转设备配网页面
|
||||||
|
*/
|
||||||
|
private void goToDeviceProvisioning() {
|
||||||
|
if (pendingDeviceEntity == null) {
|
||||||
|
ToastUtil.showShort(mContext, "设备信息异常");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putInt(ConstantUtil.ACTIVITY_NAVIGATE_FLAG, 100); // 100 = 来自扫码添加
|
||||||
|
bundle.putSerializable("ble_device_entity", pendingDeviceEntity);
|
||||||
|
goTo(mContext, SelectWifiActivity.class, bundle);
|
||||||
|
pendingDeviceEntity = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroyView() {
|
public void onDestroyView() {
|
||||||
@@ -270,13 +393,69 @@ public class IndexFragment extends BaseFragment<IndexFragmentLayoutBinding, Inde
|
|||||||
public void logOut(BaseBean bean) {
|
public void logOut(BaseBean bean) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPermissionsGranted(int requestCode, @NonNull List<String> perms) {
|
||||||
|
hidePermissionDialog();
|
||||||
|
if (requestCode == REQUEST_EVENT_CODE_10001) {
|
||||||
|
scanQrcode();
|
||||||
|
} else if (requestCode == REQUEST_EVENT_CODE_BLUETOOTH_PERMISSION) {
|
||||||
|
// 蓝牙权限获取成功,检查蓝牙状态
|
||||||
|
if (initBluetooth()) {
|
||||||
|
goToDeviceProvisioning();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPermissionsDenied(int requestCode, @NonNull List<String> perms) {
|
||||||
|
hidePermissionDialog();
|
||||||
|
if (requestCode == REQUEST_EVENT_CODE_BLUETOOTH_PERMISSION) {
|
||||||
|
ToastUtil.showShort(mContext, "需要蓝牙权限才能添加设备");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
|
||||||
hidePermissionDialog();
|
hidePermissionDialog();
|
||||||
|
|
||||||
if (requestCode == REQUEST_EVENT_CODE_10001) {
|
if (requestCode == REQUEST_EVENT_CODE_10001) {
|
||||||
|
// 相机权限回调
|
||||||
scanQrcode();
|
scanQrcode();
|
||||||
|
} else if (requestCode == REQUEST_EVENT_CODE_BLUETOOTH_PERMISSION) {
|
||||||
|
// 蓝牙权限回调
|
||||||
|
boolean allGranted = true;
|
||||||
|
for (int result : grantResults) {
|
||||||
|
if (result != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
allGranted = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (allGranted) {
|
||||||
|
// 权限获取成功,检查蓝牙状态
|
||||||
|
if (initBluetooth()) {
|
||||||
|
goToDeviceProvisioning();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtil.showShort(mContext, "需要蓝牙权限才能添加设备");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (requestCode == REQUEST_ENABLE_BT) {
|
||||||
|
if (resultCode == -1) { // RESULT_OK
|
||||||
|
ToastUtil.showShort(mContext, "蓝牙已开启");
|
||||||
|
bluetoothReady = true;
|
||||||
|
if (pendingDeviceEntity != null) {
|
||||||
|
goToDeviceProvisioning();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtil.showShort(mContext, "请开启蓝牙以添加设备");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,15 +29,26 @@ public class DeviceAdapter extends BaseQuickAdapter<WaterDeviceEntity, BaseViewH
|
|||||||
View viewStatus = holder.getView(R.id.view_status_dot);
|
View viewStatus = holder.getView(R.id.view_status_dot);
|
||||||
holder.setText(R.id.tv_device_name,item.getDeviceName());
|
holder.setText(R.id.tv_device_name,item.getDeviceName());
|
||||||
holder.setText(R.id.tv_device_serial,item.getDeviceSn());
|
holder.setText(R.id.tv_device_serial,item.getDeviceSn());
|
||||||
holder.setText(R.id.tv_device_status,item.getWorkStatus().equals("0") ?
|
switch (item.getWorkStatus()){
|
||||||
mContext.getString(R.string.device_status_not_working) :
|
case "0"://待机
|
||||||
mContext.getString(R.string.device_status_working));
|
holder.setText(R.id.tv_device_status,mContext.getString(R.string.device_status_not_working));
|
||||||
holder.setTextColor(R.id.tv_device_status,item.getWorkStatus().equals("0") ?
|
holder.setTextColor(R.id.tv_device_status,mContext.getResources().getColor(R.color.color_999999));
|
||||||
mContext.getResources().getColor(R.color.color_999999) :
|
viewStatus.setBackground(mContext.getResources().getDrawable(R.drawable.shape_status_dot_999999));
|
||||||
mContext.getResources().getColor(R.color.color_24B326));
|
break;
|
||||||
viewStatus.setBackground(item.getWorkStatus().equals("0") ?
|
|
||||||
mContext.getResources().getDrawable(R.drawable.shape_status_dot_999999)
|
case "1"://工作中
|
||||||
: mContext.getResources().getDrawable(R.drawable.shape_status_dot_green));
|
holder.setText(R.id.tv_device_status,mContext.getString(R.string.device_status_working));
|
||||||
|
holder.setTextColor(R.id.tv_device_status,mContext.getResources().getColor(R.color.color_24B326));
|
||||||
|
viewStatus.setBackground(mContext.getResources().getDrawable(R.drawable.shape_status_dot_green));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// if(item.getStatus().equals("1") || item.getStatus().equals("2")){
|
||||||
|
// }else{
|
||||||
|
// holder.setText(R.id.tv_device_status,mContext.getString(R.string.device_status_offline));
|
||||||
|
// holder.setTextColor(R.id.tv_device_status,mContext.getResources().getColor(R.color.color_999999));
|
||||||
|
// viewStatus.setBackground(mContext.getResources().getDrawable(R.drawable.shape_status_dot_999999));
|
||||||
|
// }
|
||||||
|
|
||||||
holder.setText(R.id.tv_battery_level,item.getPowerLevel());
|
holder.setText(R.id.tv_battery_level,item.getPowerLevel());
|
||||||
imgPower.setImageResource(PowerIconManage.getInstance().getPowerIcon(Integer.parseInt(item.getPowerLevel())));
|
imgPower.setImageResource(PowerIconManage.getInstance().getPowerIcon(Integer.parseInt(item.getPowerLevel())));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ public class WaterDeviceEntity implements Serializable {
|
|||||||
private List<DeviceListBean> deviceList;
|
private List<DeviceListBean> deviceList;
|
||||||
private int bindDeviceStatus;
|
private int bindDeviceStatus;
|
||||||
private String bindDeviceStatusName;
|
private String bindDeviceStatusName;
|
||||||
|
private WaterDeviceEntity bindDevice;
|
||||||
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
public static class DeviceListBean implements Serializable{
|
public static class DeviceListBean implements Serializable{
|
||||||
private String id;
|
private String id;
|
||||||
private String deviceNo;
|
private String deviceNo;
|
||||||
@@ -67,5 +68,14 @@ public class WaterDeviceEntity implements Serializable {
|
|||||||
private String fwVer;
|
private String fwVer;
|
||||||
private String macAddress;
|
private String macAddress;
|
||||||
private Object expirationTime;
|
private Object expirationTime;
|
||||||
|
private int createDept;
|
||||||
|
private int createBy;
|
||||||
|
private String createTime;
|
||||||
|
private int updateBy;
|
||||||
|
private String updateTime;
|
||||||
|
private Object bindTokenHash;
|
||||||
|
private Object deviceImgX;
|
||||||
|
private String powerLevelUpdatatimeX;
|
||||||
|
private Object expirationTimeX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ public class IndexPresenter extends BasePresenter<IndexContract.IndexView>{
|
|||||||
mImpl.queryDeviceBindStatus(json, new IndexContract.CallBack<WaterDeviceEntity>() {
|
mImpl.queryDeviceBindStatus(json, new IndexContract.CallBack<WaterDeviceEntity>() {
|
||||||
@Override
|
@Override
|
||||||
public void success(WaterDeviceEntity bean, int total) {
|
public void success(WaterDeviceEntity bean, int total) {
|
||||||
entity.setBindDeviceStatus(bean.getBindDeviceStatus());
|
bean.setMacAddress(entity.getMacAddress());
|
||||||
entity.setBindDeviceStatusName(bean.getBindDeviceStatusName());
|
bean.setDeviceName(entity.getDeviceName());
|
||||||
if(IndexPresenter.this.getView() != null){
|
if(IndexPresenter.this.getView() != null){
|
||||||
IndexPresenter.this.getView().queryDeviceBindStatusSuccess(entity);
|
IndexPresenter.this.getView().queryDeviceBindStatusSuccess(bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public interface Request {
|
|||||||
|
|
||||||
//添加设备
|
//添加设备
|
||||||
@POST("app/v1/addDevice")
|
@POST("app/v1/addDevice")
|
||||||
Observable<BaseBean> addDevice(@HeaderMap Map<String, String> headMap, @Body RequestBody requestBody);
|
Observable<BaseBean<WaterDeviceEntity>> addDevice(@HeaderMap Map<String, String> headMap, @Body RequestBody requestBody);
|
||||||
//获取设备详细信息
|
//获取设备详细信息
|
||||||
@GET("app/v1/device/{deviceNo}")
|
@GET("app/v1/device/{deviceNo}")
|
||||||
Observable<BaseBean<WaterDeviceEntity>> getDeviceDetailInfo(@HeaderMap Map<String, String> headMap, @Path("deviceNo") String id);
|
Observable<BaseBean<WaterDeviceEntity>> getDeviceDetailInfo(@HeaderMap Map<String, String> headMap, @Path("deviceNo") String id);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:background="@drawable/shape_device_ctrl_green_cor12">
|
android:background="@drawable/shape_device_ctrl_green_cor12">
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/img_wifi_logo"
|
||||||
android:layout_width="@dimen/dp_24"
|
android:layout_width="@dimen/dp_24"
|
||||||
android:layout_height="@dimen/dp_24"
|
android:layout_height="@dimen/dp_24"
|
||||||
android:src="@mipmap/icon_ctrl_wifi_white"/>
|
android:src="@mipmap/icon_ctrl_wifi_white"/>
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
android:textColor="@color/textPrimaryColor"
|
android:textColor="@color/textPrimaryColor"
|
||||||
android:text="@string/device_info_code"/>
|
android:text="@string/device_info_code"/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_dev_code"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
@@ -47,6 +48,7 @@
|
|||||||
android:textColor="@color/textPrimaryColor"
|
android:textColor="@color/textPrimaryColor"
|
||||||
android:text="@string/device_info_type"/>
|
android:text="@string/device_info_type"/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_dev_mod"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
@@ -69,6 +71,7 @@
|
|||||||
android:textColor="@color/textPrimaryColor"
|
android:textColor="@color/textPrimaryColor"
|
||||||
android:text="@string/device_info_serial_number"/>
|
android:text="@string/device_info_serial_number"/>
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tv_device_serial"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
@@ -91,7 +94,7 @@
|
|||||||
android:textColor="@color/textPrimaryColor"
|
android:textColor="@color/textPrimaryColor"
|
||||||
android:text="@string/device_info_firmware_version"/>
|
android:text="@string/device_info_firmware_version"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_device_name"
|
android:id="@+id/tv_dev_version"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
|||||||
@@ -100,6 +100,8 @@
|
|||||||
<string name="device_status_not_working">Idle</string>
|
<string name="device_status_not_working">Idle</string>
|
||||||
<string name="select_watering_duration">Select watering duration</string>
|
<string name="select_watering_duration">Select watering duration</string>
|
||||||
<string name="start_watering">Start Watering</string>
|
<string name="start_watering">Start Watering</string>
|
||||||
|
<string name="device_status_offline">Off line</string>
|
||||||
|
|
||||||
|
|
||||||
<!-- Schedule -->
|
<!-- Schedule -->
|
||||||
<string name="input_plan_name">Enter schedule name</string>
|
<string name="input_plan_name">Enter schedule name</string>
|
||||||
|
|||||||
@@ -89,6 +89,7 @@
|
|||||||
<string name="device_info_firmware_version">固件版本</string>
|
<string name="device_info_firmware_version">固件版本</string>
|
||||||
<string name="device_status_working">工作中</string>
|
<string name="device_status_working">工作中</string>
|
||||||
<string name="device_status_not_working">待机中</string>
|
<string name="device_status_not_working">待机中</string>
|
||||||
|
<string name="device_status_offline">离线</string>
|
||||||
<string name="select_watering_duration">请选择浇水时长</string>
|
<string name="select_watering_duration">请选择浇水时长</string>
|
||||||
<string name="start_watering">开始浇水</string>
|
<string name="start_watering">开始浇水</string>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user