Commit 3edc6cd6ba4a844b32769e070162923e7e770664

Authored by YangShuai
1 parent 57631099

1 修改配网逻辑

config.gradle
@@ -21,7 +21,7 @@ ext { @@ -21,7 +21,7 @@ ext {
21 //编译方式 21 //编译方式
22 debug : false, 22 debug : false,
23 //版本号 23 //版本号
24 - version: "0.1.29", 24 + version: "0.1.30",
25 //Lib库前缀 25 //Lib库前缀
26 packeg : "com.cnlive.module", 26 packeg : "com.cnlive.module",
27 //Lib库名称 27 //Lib库名称
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/SelectWifiFragmentView.java
@@ -285,11 +285,15 @@ public class SelectWifiFragmentView implements MvpView { @@ -285,11 +285,15 @@ public class SelectWifiFragmentView implements MvpView {
285 fragment.getPresenter().queryConfigDeviceNetResult(getContext(), familyId, new SelectWifiFragmentPresenter.OnResponseListener() { 285 fragment.getPresenter().queryConfigDeviceNetResult(getContext(), familyId, new SelectWifiFragmentPresenter.OnResponseListener() {
286 @Override 286 @Override
287 public void onSuccess(NetworkResultBean networkResultBean) { 287 public void onSuccess(NetworkResultBean networkResultBean) {
  288 + if (null==getContext()){
  289 + return;
  290 + }
  291 + QMUITipDialogUtil.dismessDialog();
288 //判断是否绑定 292 //判断是否绑定
289 if (networkResultBean.isIsBinded()&&"success".equals(networkResultBean.getResult().trim())) { 293 if (networkResultBean.isIsBinded()&&"success".equals(networkResultBean.getResult().trim())) {
290 ConnBluetoothSuccessActivity.startActivity(getContext(), networkResultBean); 294 ConnBluetoothSuccessActivity.startActivity(getContext(), networkResultBean);
291 } else { 295 } else {
292 - AlertUtil.showDeftToast(getContext(), "配网失败,"); 296 + AlertUtil.showDeftToast(getContext(), "配网失败");
293 } 297 }
294 } 298 }
295 }); 299 });
@@ -299,6 +303,9 @@ public class SelectWifiFragmentView implements MvpView { @@ -299,6 +303,9 @@ public class SelectWifiFragmentView implements MvpView {
299 if (null != failHandler && null != failRunnable) { 303 if (null != failHandler && null != failRunnable) {
300 failHandler.removeCallbacks(failRunnable); 304 failHandler.removeCallbacks(failRunnable);
301 } 305 }
  306 + QMUITipDialogUtil.dismessDialog();
  307 + BleManager.getInstance().stopNotify(bleDevice, BlufiConstants.UUID_WIFI_SERVICE.toString(), BlufiConstants.UUID_NOTIFY_CHARACTERISTIC.toString());
  308 + BleManager.getInstance().disconnect(bleDevice);
302 if (null != errorDialog) { 309 if (null != errorDialog) {
303 if (!TextUtils.isEmpty(SSID)) { 310 if (!TextUtils.isEmpty(SSID)) {
304 errorDialog.setTipMsg(SSID + "\n密码错误"); 311 errorDialog.setTipMsg(SSID + "\n密码错误");
@@ -307,9 +314,7 @@ public class SelectWifiFragmentView implements MvpView { @@ -307,9 +314,7 @@ public class SelectWifiFragmentView implements MvpView {
307 } 314 }
308 } 315 }
309 } 316 }
310 - QMUITipDialogUtil.dismessDialog();  
311 - BleManager.getInstance().stopNotify(bleDevice, BlufiConstants.UUID_WIFI_SERVICE.toString(), BlufiConstants.UUID_NOTIFY_CHARACTERISTIC.toString());  
312 - BleManager.getInstance().disconnect(bleDevice); 317 +
313 } 318 }
314 } catch (UnsupportedEncodingException e) { 319 } catch (UnsupportedEncodingException e) {
315 e.printStackTrace(); 320 e.printStackTrace();