コード例 #1
0
 private void GenericAraEditText_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
 {
     new System.Threading.Thread(new System.Threading.ThreadStart(delegate
     {
         List <SonFavorilerListViewDataModel> searchedFriends = (from friend in mFriends
                                                                 where friend.firstName.Contains(GenericAraEditText.Text, StringComparison.OrdinalIgnoreCase) ||
                                                                 friend.lastChatText.Contains(GenericAraEditText.Text, StringComparison.OrdinalIgnoreCase)
                                                                 select friend).ToList <SonFavorilerListViewDataModel>();
         if (searchedFriends.Count > 0)
         {
             mAdapter           = new FavorilerListViewAdapter(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();
 }
コード例 #2
0
        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());
                        if (Icerikk.boost != null)
                        {
                            if (Convert.ToInt32(Icerikk.boost) > 0)
                            {
                                mFriends[i].BoostOrSuperBoost = true;
                            }
                        }
                        if (Icerikk.superBoost != null)
                        {
                            if (Convert.ToInt32(Icerikk.superBoost) > 0)
                            {
                                mFriends[i].BoostOrSuperBoost = true;
                            }
                        }
                    }
                }

                var PaketeGoreSirala = (from item in mFriends
                                        orderby item.BoostOrSuperBoost descending
                                        select item).ToList();
                mFriends = PaketeGoreSirala;

                this.Activity.RunOnUiThread(() =>
                {
                    mAdapter      = new FavorilerListViewAdapter(this.Activity, Resource.Layout.MesajlarCustomContent, mFriends, FavorileriCagir());
                    Liste.Adapter = mAdapter;
                });
            })).Start();
        }
コード例 #3
0
        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 <SonFavorilerListViewDataModel> >(Donus.ToString());
                //mFriends = mFriends.FindAll(item => item.request == false);
                FavorileriAyir();
                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();
                        var boldd     = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliBold.ttf");
                        var normall   = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliRegular.ttf");
                        mAdapter      = new FavorilerListViewAdapter(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();
            }
        }