use of com.xiecc.seeWeather.modules.main.domain.MultiUpdateEvent in project SeeWeather by xcc3641.
the class ChoiceCityActivity method initRecyclerView.
private void initRecyclerView() {
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
mRecyclerView.setHasFixedSize(true);
mAdapter = new CityAdapter(this, dataList);
mRecyclerView.setAdapter(mAdapter);
mAdapter.setOnItemClickListener((view, pos) -> {
if (currentLevel == LEVEL_PROVINCE) {
selectedProvince = provincesList.get(pos);
mRecyclerView.smoothScrollToPosition(0);
queryCities();
} else if (currentLevel == LEVEL_CITY) {
String city = Util.replaceCity(cityList.get(pos).mCityName);
if (isChecked) {
OrmLite.getInstance().save(new CityORM(city));
RxBus.getDefault().post(new MultiUpdateEvent());
} else {
SharedPreferenceUtil.getInstance().setCityName(city);
RxBus.getDefault().post(new ChangeCityEvent());
}
quit();
}
});
}
Aggregations