version:2.1

fix:修复地图失败,修复获取天气失败
update:
This commit is contained in:
2022-06-15 16:51:00 +08:00
parent f954fc036d
commit b6e1b51545
7 changed files with 22 additions and 29 deletions

View File

@@ -6,7 +6,6 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ResolveInfo;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
@@ -33,7 +32,6 @@ import com.amap.api.location.AMapLocationListener;
import com.blankj.utilcode.util.NetworkUtils;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.king.view.circleprogressview.CircleProgressView;
import com.qweather.sdk.bean.base.Code;
import com.qweather.sdk.bean.base.Lang;
import com.qweather.sdk.bean.base.Unit;
@@ -43,14 +41,13 @@ import com.qweather.sdk.view.QWeather;
import com.tencent.mmkv.MMKV;
import com.uiui.aios.BuildConfig;
import com.uiui.aios.R;
import com.uiui.aios.activity.APPListActivity;
import com.uiui.aios.activity.EmergencyActivity;
import com.uiui.aios.activity.weather.WeatherActivity;
import com.uiui.aios.adapter.NotificationAdapter;
import com.uiui.aios.adapter.SOSNnmberAdapter;
import com.uiui.aios.bean.AlarmClockData;
import com.uiui.aios.bean.AlarmItem;
import com.uiui.aios.utils.AmapManager;
import com.uiui.aios.manager.AmapManager;
import com.uiui.aios.utils.ApkUtils;
import com.uiui.aios.utils.AppUtil;
import com.uiui.aios.utils.SchemeUtils;
@@ -81,7 +78,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
ConstraintLayout cl_soso;
@BindView(R.id.cl_weather)
ConstraintLayout cl_weather;
// @BindView(R.id.cl_battery)
// @BindView(R.id.cl_battery)
// ConstraintLayout cl_battery;
// @BindView(R.id.tv_add)
// TextView tv_add;
@@ -93,7 +90,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
ImageView iv_pic;
@BindView(R.id.tv_temp)
TextView tv_temp;
// @BindView(R.id.cpv)
// @BindView(R.id.cpv)
// CircleProgressView cpv;
// @BindView(R.id.iv_charging)
// ImageView iv_charging;
@@ -447,6 +444,7 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
private void getweather(double longitude, double latitude) {
String location = longitude + "," + latitude;
Log.e(TAG, "getweather: " + location);
/**
* 实况天气数据
* @param location 所查询的地区可通过该地区名称、ID、IP和经纬度进行查询经纬度格式经度,纬度
@@ -455,7 +453,6 @@ public class CustomFragment extends Fragment implements NetworkUtils.OnNetworkSt
* @param unit (选填)单位选择公制m或英制i默认为公制单位
* @param listener 网络访问结果回调
*/
QWeather.getWeatherNow(getActivity(), location, Lang.ZH_HANS, Unit.METRIC, new QWeather.OnResultWeatherNowListener() {
@Override
public void onError(Throwable e) {