Commit da6e98754c862c0cae3b8360eb36eadb6cc3dfa4
1 parent
b397edac
1 修复配网成功后,点击完成按钮,所有设备列表未刷新的情况
Showing
4 changed files
with
9 additions
and
1 deletions
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/presenter/SelectWifiFragmentPresenter.java
| @@ -53,6 +53,8 @@ public class SelectWifiFragmentPresenter extends MvpBasePresenter<SelectWifiFrag | @@ -53,6 +53,8 @@ public class SelectWifiFragmentPresenter extends MvpBasePresenter<SelectWifiFrag | ||
| 53 | if (null!=onResponseListener){ | 53 | if (null!=onResponseListener){ |
| 54 | onResponseListener.onSuccess(baseInfo.getData()); | 54 | onResponseListener.onSuccess(baseInfo.getData()); |
| 55 | } | 55 | } |
| 56 | + EventBus.getDefault().post(new EventMsg(EventMsg.CONFIG_NET_SUCCESS,null)); | ||
| 57 | + | ||
| 56 | } | 58 | } |
| 57 | }) | 59 | }) |
| 58 | .setFailureCallback(new FailureCallback() { | 60 | .setFailureCallback(new FailureCallback() { |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/frame/view/AllDeviceFragmentView.java
| @@ -86,6 +86,7 @@ public class AllDeviceFragmentView implements MvpView { | @@ -86,6 +86,7 @@ public class AllDeviceFragmentView implements MvpView { | ||
| 86 | if (null == allDeviceInfoList || allDeviceInfoList.size() == 0) { | 86 | if (null == allDeviceInfoList || allDeviceInfoList.size() == 0) { |
| 87 | XiaoJIaCommInfo.setUserIsBind(getContext(), false); | 87 | XiaoJIaCommInfo.setUserIsBind(getContext(), false); |
| 88 | initTopBarBtn(false); | 88 | initTopBarBtn(false); |
| 89 | + | ||
| 89 | } else { | 90 | } else { |
| 90 | XiaoJIaCommInfo.setUserIsBind(getContext(), true); | 91 | XiaoJIaCommInfo.setUserIsBind(getContext(), true); |
| 91 | initTopBarBtn(true); | 92 | initTopBarBtn(true); |
| @@ -214,6 +215,8 @@ public class AllDeviceFragmentView implements MvpView { | @@ -214,6 +215,8 @@ public class AllDeviceFragmentView implements MvpView { | ||
| 214 | if (isShowRemote) { | 215 | if (isShowRemote) { |
| 215 | //控制 | 216 | //控制 |
| 216 | remoteButton.setVisibility(View.VISIBLE); | 217 | remoteButton.setVisibility(View.VISIBLE); |
| 218 | + }else { | ||
| 219 | + remoteButton.setVisibility(View.GONE); | ||
| 217 | } | 220 | } |
| 218 | } | 221 | } |
| 219 | } | 222 | } |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/model/message/EventMsg.java
| @@ -9,6 +9,7 @@ public class EventMsg { | @@ -9,6 +9,7 @@ public class EventMsg { | ||
| 9 | public static final int HAS_FRIEND_JOIN_FRIMALY = 5;//有好友加入家庭 | 9 | public static final int HAS_FRIEND_JOIN_FRIMALY = 5;//有好友加入家庭 |
| 10 | public static final int HAS_FRIEND_REMOVE_FRIMALY = 6;//有好友移除家庭 | 10 | public static final int HAS_FRIEND_REMOVE_FRIMALY = 6;//有好友移除家庭 |
| 11 | public static final int HAS_ROLE_USED = 7;//已经有角色被占用了 | 11 | public static final int HAS_ROLE_USED = 7;//已经有角色被占用了 |
| 12 | + public static final int CONFIG_NET_SUCCESS = 8;//配网成功 | ||
| 12 | 13 | ||
| 13 | private int eventType; | 14 | private int eventType; |
| 14 | private Object data; | 15 | private Object data; |
module_xiaojiaSoundBox/src/main/java/com/cnlive/strike/xiaojiaspeaker/ui/fragment/AllDeviceFragment.java
| @@ -70,7 +70,9 @@ public class AllDeviceFragment extends MvpBindingFragment<AllDeviceFragmentView, | @@ -70,7 +70,9 @@ public class AllDeviceFragment extends MvpBindingFragment<AllDeviceFragmentView, | ||
| 70 | } | 70 | } |
| 71 | } else if (EventMsg.DELETE_DEVICE_NAME_SUCCESS == msg.getEventType()) { | 71 | } else if (EventMsg.DELETE_DEVICE_NAME_SUCCESS == msg.getEventType()) { |
| 72 | getPresenter().getFamilyList(getActivity(), XiaoJIaCommInfo.getUserId(getActivity()), XiaoJIaCommInfo.getUserPhone(getActivity())); | 72 | getPresenter().getFamilyList(getActivity(), XiaoJIaCommInfo.getUserId(getActivity()), XiaoJIaCommInfo.getUserPhone(getActivity())); |
| 73 | - }else if (EventMsg.GO_TO_CHINA_LISTEN_PAGE== msg.getEventType()){ | 73 | + } else if (EventMsg.CONFIG_NET_SUCCESS == msg.getEventType()) { |
| 74 | + getPresenter().getFamilyList(getActivity(), XiaoJIaCommInfo.getUserId(getActivity()), XiaoJIaCommInfo.getUserPhone(getActivity())); | ||
| 75 | + } else if (EventMsg.GO_TO_CHINA_LISTEN_PAGE == msg.getEventType()) { | ||
| 74 | getActivity().finish(); | 76 | getActivity().finish(); |
| 75 | } | 77 | } |
| 76 | } | 78 | } |