|
@@ -28,6 +28,7 @@ import com.google.gson.Gson;
|
|
|
import com.lib.MsgContent;
|
|
import com.lib.MsgContent;
|
|
|
import com.lzy.okgo.OkGo;
|
|
import com.lzy.okgo.OkGo;
|
|
|
import com.lzy.okgo.cache.CacheMode;
|
|
import com.lzy.okgo.cache.CacheMode;
|
|
|
|
|
+import com.lzy.okgo.callback.AbsCallback;
|
|
|
import com.lzy.okgo.callback.StringCallback;
|
|
import com.lzy.okgo.callback.StringCallback;
|
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
|
@@ -44,9 +45,11 @@ import com.silence.commonframe.activity.DevicedetailActivity;
|
|
|
import com.silence.commonframe.adapter.DeviceTypeTitleAdapter;
|
|
import com.silence.commonframe.adapter.DeviceTypeTitleAdapter;
|
|
|
import com.silence.commonframe.adapter.MyAdapterSlide;
|
|
import com.silence.commonframe.adapter.MyAdapterSlide;
|
|
|
import com.silence.commonframe.adapter.RecViewAdapter;
|
|
import com.silence.commonframe.adapter.RecViewAdapter;
|
|
|
|
|
+import com.silence.commonframe.bean.AirGuardBean;
|
|
|
import com.silence.commonframe.bean.DeviceTypeTitleBean;
|
|
import com.silence.commonframe.bean.DeviceTypeTitleBean;
|
|
|
import com.silence.commonframe.bean.IsDeviceChange;
|
|
import com.silence.commonframe.bean.IsDeviceChange;
|
|
|
import com.silence.commonframe.bean.TestBean;
|
|
import com.silence.commonframe.bean.TestBean;
|
|
|
|
|
+import com.silence.commonframe.common.constant.UrlConstants;
|
|
|
import com.silence.commonframe.example.ActivityGuideDeviceCamera;
|
|
import com.silence.commonframe.example.ActivityGuideDeviceCamera;
|
|
|
import com.silence.commonframe.lib.funsdk.support.FunSupport;
|
|
import com.silence.commonframe.lib.funsdk.support.FunSupport;
|
|
|
import com.silence.commonframe.lib.funsdk.support.OnAddSubDeviceResultListener;
|
|
import com.silence.commonframe.lib.funsdk.support.OnAddSubDeviceResultListener;
|
|
@@ -527,9 +530,7 @@ public class DeviceFragment extends Fragment implements OnFunRegisterListener, O
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}else {
|
|
}else {
|
|
|
LoginIn.tokenOut(code,message,getContext());
|
|
LoginIn.tokenOut(code,message,getContext());
|
|
|
Toast.makeText(getContext(),""+message,Toast.LENGTH_SHORT).show();
|
|
Toast.makeText(getContext(),""+message,Toast.LENGTH_SHORT).show();
|
|
@@ -890,7 +891,27 @@ public class DeviceFragment extends Fragment implements OnFunRegisterListener, O
|
|
|
* 获取空气卫士列表
|
|
* 获取空气卫士列表
|
|
|
*/
|
|
*/
|
|
|
private void getAirGuide(){
|
|
private void getAirGuide(){
|
|
|
|
|
+ OkGo.get(UrlConstants.AIR_GUARD_LIST)
|
|
|
|
|
+ .tag(this) // 请求的 tag, 主要用于取消对应的请求
|
|
|
|
|
+ .cacheKey("cacheGetKey") // 设置当前请求的缓存key,建议每个不同功能的请求设置一个
|
|
|
|
|
+ .cacheMode(CacheMode.DEFAULT) // 缓存模式,详细请看缓存介绍
|
|
|
|
|
+ .headers("token", Data.getToken())
|
|
|
|
|
+ .execute(new AbsCallback<AirGuardBean>() {
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public AirGuardBean convertSuccess(Response response) throws Exception {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onSuccess(AirGuardBean airGuardBean, Call call, Response response) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ /** 请求失败,响应错误,数据解析错误等,都会回调该方法, UI线程 */
|
|
|
|
|
+ public void onError(Call call, Response response, Exception e) {
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
@Override
|
|
@Override
|
|
|
public void onAttach(Context context) {
|
|
public void onAttach(Context context) {
|