void FavoriIslemleri() { var IsFollow = FollowListID.FindAll(item => item == MesajlarIcinSecilenKullanici.Kullanici.id.ToString()); if (IsFollow.Count > 0)//Takip Ettiklerim Arasaında { AlertDialog.Builder cevap = new AlertDialog.Builder(this); cevap.SetIcon(Resource.Mipmap.ic_launcher_round); cevap.SetTitle(Spannla(Color.Black, "Buptis")); cevap.SetMessage(Spannla(Color.DarkGray, MesajlarIcinSecilenKullanici.Kullanici.firstName + " adlı kullanıcıyı favorilerilerinden çıkartmak istediğini emin misiniz?")); cevap.SetPositiveButton("Evet", delegate { cevap.Dispose(); FavoriIslemleri(MesajlarIcinSecilenKullanici.Kullanici.firstName + " favorilerinde çıkarıldı."); Favori.SetBackgroundResource(Resource.Drawable.favori_pasif); }); cevap.SetNegativeButton("Hayır", delegate { cevap.Dispose(); }); cevap.Show(); } else { FavoriIslemleri(MesajlarIcinSecilenKullanici.Kullanici.firstName + " favorilerine eklendi."); Favori.SetBackgroundResource(Resource.Drawable.favori_aktif); } }
void FavorileriCagir() { new System.Threading.Thread(new System.Threading.ThreadStart(delegate { WebService webService = new WebService(); var Donus4 = webService.OkuGetir("users/favList/" + MeDTO.id.ToString()); if (Donus4 != null) { var JSONStringg = Donus4.ToString().Replace("[", "").Replace("]", ""); if (!string.IsNullOrEmpty(JSONStringg)) { FollowListID = JSONStringg.Split(',').ToList(); } var IsFollow = FollowListID.FindAll(item => item == MesajlarIcinSecilenKullanici.Kullanici.id.ToString()); if (IsFollow.Count > 0) { RunOnUiThread(delegate() { Favori.SetBackgroundResource(Resource.Drawable.favori_aktif); }); } else { RunOnUiThread(delegate() { Favori.SetBackgroundResource(Resource.Drawable.favori_pasif); }); } } else { RunOnUiThread(delegate() { Favori.Visibility = ViewStates.Invisible; }); } })).Start(); }