private void InitView() { cidView = FindViewById<TextView>(Resource.Id.cityid); cityNameView = FindViewById<EditText>(Resource.Id.city); stateView = FindViewById<TextView>(Resource.Id.state); ListView hotCityList = FindViewById<ListView>(Resource.Id.hotcitylist); IList<string> hotCities = new List<string>(); //获取热闹城市列表 IList<MKOLSearchRecord> records1 = mOffline.HotCityList; if (records1 != null) { foreach (MKOLSearchRecord r in records1) { hotCities.Add(r.CityName + "(" + r.CityID + ")" + " --" + this.FormatDataSize(r.Size)); } } IListAdapter hAdapter = (IListAdapter)new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, hotCities); hotCityList.Adapter = hAdapter; ListView allCityList = FindViewById<ListView>(Resource.Id.allcitylist); //获取所有支持离线地图的城市 IList<string> allCities = new List<string>(); IList<MKOLSearchRecord> records2 = mOffline.OfflineCityList; if (records1 != null) { foreach (MKOLSearchRecord r in records2) { allCities.Add(r.CityName + "(" + r.CityID + ")" + " --" + this.FormatDataSize(r.Size)); } } IListAdapter aAdapter = (IListAdapter)new ArrayAdapter<string>(this, Android.Resource.Layout.SimpleListItem1, allCities); allCityList.Adapter = aAdapter; LinearLayout cl = FindViewById<LinearLayout>(Resource.Id.citylist_layout); LinearLayout lm = FindViewById<LinearLayout>(Resource.Id.localmap_layout); lm.Visibility = ViewStates.Gone; cl.Visibility = ViewStates.Visible; //获取已下过的离线地图信息 localMapList = mOffline.AllUpdateInfo; if (localMapList == null) { localMapList = new List<MKOLUpdateElement>(); } ListView localMapListView = FindViewById<ListView>(Resource.Id.localmaplist); lAdapter = new LocalMapAdapter(this); localMapListView.Adapter = lAdapter; }
public IOnClickDisplayListenerImpl(LocalMapAdapter localMapAdapter, MKOLUpdateElement e) { this.localMapAdapter = localMapAdapter; this.e = e; }