version:1.0.0
update:增加混淆,优化其他包名 bugfixes:
This commit is contained in:
@@ -58,7 +58,7 @@ public class EmergencyActivity extends BaseMvvmActivity<EmergencyViewModel, Acti
|
||||
|
||||
//发送紧急广播
|
||||
Intent bootIntent = new Intent(BootReceiver.SOS);
|
||||
bootIntent.setComponent(new ComponentName("com.uiuios.sn", "com.uiuios.sn.receiver.BootReceiver"));
|
||||
bootIntent.setComponent(new ComponentName("com.xxpatx.sn", "com.xxpatx.sn.receiver.BootReceiver"));
|
||||
sendBroadcast(bootIntent);
|
||||
AmapManager.getInstance().startLocation();
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, PhoneActivityM
|
||||
|
||||
@Override
|
||||
public void onRemoteConnected() {
|
||||
Log.e(TAG, "onRemoteConnected: ");
|
||||
setDefaultDesktop();
|
||||
}
|
||||
|
||||
|
||||
@@ -175,18 +175,17 @@ public class WeatherActivity extends BaseMvvmActivity<WeatherViewModel, Activity
|
||||
if (weatherNowBean != null) {
|
||||
if (Code.OK == weatherNowBean.getCode()) {
|
||||
WeatherNowBean.NowBaseBean now = weatherNowBean.getNow();
|
||||
Log.d("getWeatherNow: ", "onSuccess: now " + new Gson().toJson(now));
|
||||
Log.d("getWeatherNowData: ", "onSuccess: now " + new Gson().toJson(now));
|
||||
mViewDataBinding.setNowBaseBean(now);
|
||||
Toaster.show("刷新成功");
|
||||
} else {
|
||||
//在此查看返回数据失败的原因
|
||||
Code code = weatherNowBean.getCode();
|
||||
Log.d("getWeatherNow: ", "failed code: " + code);
|
||||
Log.d("getWeatherNowData: ", "failed code: " + code);
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "getWeatherNow: weatherNowBean is null");
|
||||
Log.e(TAG, "getWeatherNowData: weatherNowBean is null");
|
||||
Toaster.show("获取天气失败");
|
||||
mViewModel.getWeatherCache();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -207,6 +206,7 @@ public class WeatherActivity extends BaseMvvmActivity<WeatherViewModel, Activity
|
||||
}
|
||||
|
||||
private void getWeather() {
|
||||
// mViewModel.getWeatherCache();
|
||||
String district = mMMKV.decodeString(CommonConfig.MANUALLY_SELECT_LOCATION_DISTRICT, CommonConfig.DEFAULT_LOCATION_DISTRICT);
|
||||
String tude = mMMKV.decodeString(CommonConfig.MANUALLY_SELECT_LOCATION_TUDE, CommonConfig.DEFAULT_LOCATION_TUDE);
|
||||
if (TextUtils.isEmpty(tude)) {
|
||||
|
||||
@@ -7,6 +7,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.hjq.toast.Toaster;
|
||||
import com.jeremyliao.liveeventbus.LiveEventBus;
|
||||
import com.qweather.sdk.bean.base.Lang;
|
||||
import com.qweather.sdk.bean.base.Unit;
|
||||
import com.qweather.sdk.bean.weather.WeatherDailyBean;
|
||||
@@ -207,6 +208,10 @@ public class WeatherViewModel extends BaseViewModel<ActivityWeatherBinding, Acti
|
||||
String jsonString = new Gson().toJson(weatherBean);
|
||||
mMMKV.encode(CommonConfig.WEATHER_NOW_KEY, jsonString);
|
||||
mWeatherNowData.setValue(weatherBean);
|
||||
WeatherNowBean.NowBaseBean now = weatherBean.getNow();
|
||||
LiveEventBus
|
||||
.get("some_key1")
|
||||
.post(now);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -221,16 +226,20 @@ public class WeatherViewModel extends BaseViewModel<ActivityWeatherBinding, Acti
|
||||
QWeather.getWeather7D(getCtx(), locationTude, new QWeather.OnResultWeatherDailyListener() {
|
||||
@Override
|
||||
public void onError(Throwable throwable) {
|
||||
Log.e("getWeather", "onError: " + throwable.getMessage());
|
||||
Log.e("getWeather7D", "onError: " + throwable.getMessage());
|
||||
// mWeatherDailyData.setValue(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(WeatherDailyBean weatherDailyBean) {
|
||||
String jsonString = new Gson().toJson(weatherDailyBean);
|
||||
Log.d("getWeather", "onSuccess: " + jsonString);
|
||||
Log.d("getWeather7D", "onSuccess: " + jsonString);
|
||||
mMMKV.encode(CommonConfig.WEATHER_DAILY_KEY, jsonString);
|
||||
mWeatherDailyData.setValue(weatherDailyBean);
|
||||
WeatherDailyBean.DailyBean dailyBean = weatherDailyBean.getDaily().get(0);
|
||||
LiveEventBus
|
||||
.get("some_key3")
|
||||
.post(dailyBean);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user