Exemplo n.º 1
0
        void FillDataModel()
        {
            AyarlarDataModel1 = new List <AyarlarDataModel> {
                new AyarlarDataModel()
                {
                    Titlee = "Temel Bilgi", Desc = ""
                },
                new AyarlarDataModel()
                {
                    Titlee = "Hesap", Desc = GetEmail()
                },
                new AyarlarDataModel()
                {
                    Titlee = "Bize Yazın", Desc = ""
                },
                new AyarlarDataModel()
                {
                    Titlee = "Hakkımızda", Desc = ""
                },
                new AyarlarDataModel()
                {
                    Titlee = "Engelli Kullanıcılar", Desc = ""
                },
            };

            Tablo.Source = new TableSource(AyarlarDataModel1, this);
            Tablo.ReloadData();
        }
Exemplo n.º 2
0
        private void AraTxt_EditingChanged(object sender, EventArgs e)
        {
            var LastText = AraTxt.Text;

            new System.Threading.Thread(new System.Threading.ThreadStart(delegate
            {
                List <MesajKisileri> searchedFriends = (from friend in mFriends
                                                        where friend.firstName.Contains(LastText, StringComparison.OrdinalIgnoreCase) ||
                                                        friend.lastChatText.Contains(LastText, StringComparison.OrdinalIgnoreCase)
                                                        select friend).ToList <MesajKisileri>();
                if (searchedFriends.Count > 0)
                {
                    InvokeOnMainThread(() =>
                    {
                        Tablo.Source = new MesajlarCustomTableCellSoruce(searchedFriends, this, FavorileriCagir());
                        Tablo.ReloadData();
                    });
                }
                else
                {
                    InvokeOnMainThread(() =>
                    {
                        Tablo.Source = null;
                        Tablo.ReloadData();
                    });
                }
            })).Start();
        }
Exemplo n.º 3
0
        void PopulerLokasyonlariGetir()
        {
            WebService webService = new WebService();
            var        Donus      = webService.OkuGetir("locations");

            if (Donus != null)
            {
                var aa = Donus.ToString();
                Mekanlar_Locations = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Mekanlar_Location> >(Donus.ToString());
                Mekanlar_Locations = Mekanlar_Locations.OrderBy(o => o.allUserCheckIn).ToList();//Checkin sayýsýna göre sýralýyor.
                Mekanlar_Locations.Reverse();
                if (Mekanlar_Locations.Count > 0)
                {
                    InvokeOnMainThread(delegate() {
                        Tablo.Source = new LokasyonlarCustomTableCellSoruce(Mekanlar_Locations, this);
                        Tablo.ReloadData();
                        Tablo.BackgroundColor = UIColor.Clear;
                        Tablo.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
                        CustomLoading.Hide();
                    });
                }
                else
                {
                    CustomAlert.GetCustomAlert(GelenBase1, "Çevrenizde hiç popüler lokasyon bulunamadı...");
                    InvokeOnMainThread(delegate() {
                        CustomLoading.Hide();
                    });
                }
            }
            else
            {
                CustomLoading.Hide();
            }
        }
Exemplo n.º 4
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());
                        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;

                InvokeOnMainThread(() =>
                {
                    Tablo.Source = new MesajlarCustomTableCellSoruce(mFriends, this, FavorileriCagir());
                    Tablo.ReloadData();
                    Tablo.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
                    Tablo.TableFooterView = new UIView();
                });
            })).Start();
        }
Exemplo n.º 5
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 <MesajKisileri> >(Donus.ToString());
                mFriends = mFriends.FindAll(item => item.request == true);
                if (mFriends.Count > 0)
                {
                    mFriends.Where(item => item.receiverId == MeID).ToList().ForEach(item2 => item2.unreadMessageCount = 0);
                    SaveKeys();
                    SonMesajKiminKontrolunuYap();
                    InvokeOnMainThread(() =>
                    {
                        //Geçmiş gelecekten daha büyüktür
                        mFriends.Sort((x, y) => DateTime.Compare(x.lastModifiedDate, y.lastModifiedDate));
                        mFriends.Reverse();
                        Tablo.Source = new MesajlarCustomTableCellSoruce(mFriends, this, FavorileriCagir());
                        Tablo.ReloadData();
                        Tablo.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
                        Tablo.TableFooterView = new UIView();
                        CustomLoading.Hide();
                        BoostUygula();
                    });
                }
                else
                {
                    CustomAlert.GetCustomAlert(GelenBase1, "Hiç Mesaj Bulunamadı...");
                    CustomLoading.Hide();
                }
            }
            else
            {
                CustomLoading.Hide();
            }
        }
Exemplo n.º 6
0
        void BanaYakinLokasyonlariGetir()
        {
            if (locationManager.Location != null)
            {
                WebService webService = new WebService();
                var        x          = locationManager.Location.Coordinate.Latitude.ToString().Replace(",", ".");
                var        y          = locationManager.Location.Coordinate.Longitude.ToString().Replace(",", ".");
                InvokeOnMainThread(delegate { LokasyonlarTableCell.UserLastloc = locationManager.Location; });

                var Donus = webService.OkuGetir("locations/near?x=" + x + "&y=" + y);
                if (Donus != null)
                {
                    var aa = Donus.ToString();
                    Mekanlar_Locations = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Mekanlar_Location> >(Donus.ToString());
                    if (Mekanlar_Locations.Count > 0)
                    {
                        InvokeOnMainThread(delegate() {
                            Tablo.Source = new LokasyonlarCustomTableCellSoruce(Mekanlar_Locations, this);
                            Tablo.ReloadData();
                            Tablo.BackgroundColor = UIColor.Clear;
                            Tablo.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
                            CustomLoading.Hide();
                        });
                    }
                    else
                    {
                        CustomAlert.GetCustomAlert(GelenBase1, "Çevrenizde hiç lokasyon bulunamadı...");
                        InvokeOnMainThread(delegate() {
                            Tablo.BackgroundColor = UIColor.Clear;
                            Tablo.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
                            Tablo.TableFooterView = new UIView();
                            CustomLoading.Hide();
                        });
                    }
                }
                else
                {
                    CustomLoading.Hide();
                }
            }
            else
            {
                CustomLoading.Hide();
                CustomAlert.GetCustomAlert(GelenBase1, "Çevrenizde hiç lokasyon bulunamadı...");
                return;

                var durum = CheckLocationPermission();
                if (!(bool)durum)
                {
                    InvokeOnMainThread(delegate()
                    {
                        var alert   = new UIAlertView();
                        alert.Title = "Buptis";
                        alert.AddButton("Evet");
                        alert.AddButton("Hayır");
                        alert.Message        = "Buptis konumunuzu kullanarak çevrenizde size yakın mekanları listelemektedir.\nKonum ayarlarını açmak istiyor musunuz?";
                        alert.AlertViewStyle = UIAlertViewStyle.Default;
                        alert.Clicked       += (object s, UIButtonEventArgs ev) =>
                        {
                            if (ev.ButtonIndex == 0)
                            {
                                alert.Dispose();
                                UIApplication.SharedApplication.OpenUrl(new NSUrl(UIApplication.OpenSettingsUrlString));
                            }
                            else
                            {
                                alert.Dispose();
                            }
                        };
                        alert.Show();
                    });
                }
            }
        }