private void GenericAraEditText_TextChanged(object sender, Android.Text.TextChangedEventArgs e) { new System.Threading.Thread(new System.Threading.ThreadStart(delegate { List <IsteklerListViewDataModel> searchedFriends = (from friend in mFriends where friend.firstName.Contains(GenericAraEditText.Text, StringComparison.OrdinalIgnoreCase) || friend.lastChatText.Contains(GenericAraEditText.Text, StringComparison.OrdinalIgnoreCase) select friend).ToList <IsteklerListViewDataModel>(); if (searchedFriends.Count > 0) { mAdapter = new IsteklerListViewAdapter(this.Activity, Resource.Layout.MesajlarCustomContent, searchedFriends, FavorileriCagir()); var ListeAdaptoru2 = mAdapter; this.Activity.RunOnUiThread(() => { Liste.Adapter = ListeAdaptoru2; }); } else { this.Activity.RunOnUiThread(() => { Liste.Adapter = null; AlertHelper.AlertGoster("Kimse bulunamadı", this.Activity); }); } })).Start(); }
void BoostUygula() { new System.Threading.Thread(new System.Threading.ThreadStart(delegate { for (int i = 0; i < mFriends.Count; i++) { WebService webService = new WebService(); var Donus = webService.OkuGetir("users/" + mFriends[i].receiverId.ToString()); if (Donus != null) { var aa = Donus.ToString(); var Icerikk = Newtonsoft.Json.JsonConvert.DeserializeObject <MEMBER_DATA>(Donus.ToString()); try { if (Icerikk.boostTime >= DateTime.Now.AddMinutes(-30) && Icerikk.boostTime <= DateTime.Now) { mFriends[i].BoostOrSuperBoost = true; } else if (Icerikk.superBoostTime >= DateTime.Now.AddMinutes(-30) && Icerikk.superBoostTime <= DateTime.Now) { mFriends[i].BoostOrSuperBoost = true; } else { mFriends[i].BoostOrSuperBoost = false; } } catch { } } } var PaketeGoreSirala = (from item in mFriends orderby item.BoostOrSuperBoost descending select item).ToList(); mFriends = PaketeGoreSirala; this.Activity.RunOnUiThread(() => { mAdapter = new IsteklerListViewAdapter(this.Activity, Resource.Layout.MesajlarCustomContent, mFriends, FavorileriCagir()); Liste.Adapter = mAdapter; }); })).Start(); }
void SonMesajlariGetir() { WebService webService = new WebService(); var Donus = webService.OkuGetir("chats/user"); if (Donus != null) { var MeID = DataBase.MEMBER_DATA_GETIR()[0].id; var aa = Donus.ToString(); mFriends = Newtonsoft.Json.JsonConvert.DeserializeObject <List <IsteklerListViewDataModel> >(Donus.ToString()); mFriends = mFriends.FindAll(item => item.request == true); //Bana Gelen İstekler; if (mFriends.Count > 0) { mFriends.Where(item => item.receiverId == MeID).ToList().ForEach(item2 => item2.unreadMessageCount = 0); SonMesajKiminKontrolunuYap(); SaveKeys(); this.Activity.RunOnUiThread(() => { mFriends.Sort((x, y) => DateTime.Compare(x.lastModifiedDate, y.lastModifiedDate)); mFriends.Reverse(); mAdapter = new IsteklerListViewAdapter(this.Activity, Resource.Layout.MesajlarCustomContent, mFriends, FavorileriCagir()); Liste.Adapter = mAdapter; ShowLoading.Hide(); BoostUygula(); }); } else { AlertHelper.AlertGoster("Hiç Mesaj Bulunamadı...", this.Activity); ShowLoading.Hide(); } } else { ShowLoading.Hide(); } }