コード例 #1
0
        void FillDataModel()
        {
            this.RunOnUiThread(delegate()
            {
                mRecyclerView.HasFixedSize = true;
                mLayoutManager             = new LinearLayoutManager(this);
                mRecyclerView.SetLayoutManager(mLayoutManager);
                mViewAdapter = new DersProgramiRecyclerViewAdapter(DersProgramiDTO1, this);
                mRecyclerView.SetAdapter(mViewAdapter);
                mViewAdapter.ItemClick += MViewAdapter_ItemClick;
                mLayoutManager          = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false);
                mRecyclerView.SetLayoutManager(mLayoutManager);
                try
                {
                    SnapHelper snapHelper = new LinearSnapHelper();
                    snapHelper.AttachToRecyclerView(mRecyclerView);
                }
                catch
                {
                }

                var scrollpos = EnyYakinTarihGetir();
                if (scrollpos != -1)
                {
                    mLayoutManager.ScrollToPosition(scrollpos);
                }
            });
        }
コード例 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View RootView = inflater.Inflate(Resource.Layout.HaritaListeBaseFragment, container, false);

            mRecyclerView = RootView.FindViewById <RecyclerView>(Resource.Id.recyclerView1);
            var a = MapDataModel1;

            mRecyclerView.HasFixedSize = true;
            mLayoutManager             = new LinearLayoutManager(this.Activity);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            boldd        = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliBold.ttf");
            normall      = Typeface.CreateFromAsset(this.Activity.Assets, "Fonts/muliRegular.ttf");
            mViewAdapter = new AnaMainRecyclerViewAdapter(this, (Android.Support.V7.App.AppCompatActivity) this.Activity, this.normall, this.boldd);
            mRecyclerView.SetAdapter(mViewAdapter);
            mViewAdapter.ItemClick += MViewAdapter_ItemClick;
            mLayoutManager          = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.AddOnScrollListener(new HaritaListeRecyclerViewOnScrollListener(mLayoutManager, this));
            try
            {
                SnapHelper snapHelper = new LinearSnapHelper();
                snapHelper.AttachToRecyclerView(mRecyclerView);
            }
            catch
            {
            }
            return(RootView);
        }
コード例 #3
0
        private async Task SetupViews()
        {
            progress = new ProgressDialogHelper(this);
            this.textViewNoConversations   = FindViewById <TextView>(Resource.Id.textViewNoConversations);
            this.conversationsRecyclerView = FindViewById <RecyclerView>(Resource.Id.conversationsRecyclerView);
            var mLayoutManager = new Android.Support.V7.Widget.LinearLayoutManager(this);

            this.conversationsRecyclerView.SetLayoutManager(mLayoutManager);
            await DownloadAndShowConversations(true);
        }
コード例 #4
0
        void KategoriyeGoreHediyeleriGetir()
        {
            var        MeID       = DataBase.MEMBER_DATA_GETIR()[0].id;
            WebService webService = new WebService();
            var        Donus      = webService.OkuGetir("locations/user/" + MeID);

            if (Donus != null)
            {
                var LokasyonCatids = Newtonsoft.Json.JsonConvert.DeserializeObject <EnSonLokasyonCategoriler>(Donus.ToString());
                if (LokasyonCatids.catIds.Count > 0)
                {
                    for (int i = 0; i < LokasyonCatids.catIds.Count; i++)
                    {
                        ResimleriGetir(LokasyonCatids.catIds[i].ToString());
                    }
                    if (GaleriDataModel1.Count > 0)
                    {
                        this.Activity.RunOnUiThread(() => {
                            mRecyclerView.HasFixedSize = true;
                            mLayoutManager             = new LinearLayoutManager(this.Activity);
                            mRecyclerView.SetLayoutManager(mLayoutManager);
                            mViewAdapter = new HediyelerListAdapter(this, (Android.Support.V7.App.AppCompatActivity) this.Activity, GaleriDataModel1);
                            mRecyclerView.SetAdapter(mViewAdapter);
                            mViewAdapter.ItemClick += MViewAdapter_ItemClick;
                            mLayoutManager          = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
                            mRecyclerView.SetLayoutManager(mLayoutManager);
                            ShowLoading.Hide();
                        });
                    }
                    else
                    {
                        this.Dismiss();
                        AlertHelper.AlertGoster("Hediye bulunamadı...", this.Activity);
                    }
                }
                else
                {
                    this.Dismiss();
                    AlertHelper.AlertGoster("Hediye bulunamadı...", this.Activity);
                }
            }
            else
            {
                this.Dismiss();
                AlertHelper.AlertGoster("Hediye bulunamadı...", this.Activity);
            }
        }
コード例 #5
0
        void ResimleriGetir()
        {
            WebService webService = new WebService();
            var        MeID       = DataBase.MEMBER_DATA_GETIR()[0].id;
            var        Donus      = webService.OkuGetir("images/user/" + MeID.ToString());

            if (Donus != null)
            {
                var aa = Donus.ToString();
                GaleriDataModel1 = Newtonsoft.Json.JsonConvert.DeserializeObject <List <PrivateProfileGaleriVeResim> >(Donus.ToString());
                if (GaleriDataModel1.Count > 0)
                {
                    GaleriDataModel1.Reverse();
                    this.Activity.RunOnUiThread(() => {
                        if (GaleriDataModel1.Count >= 10)
                        {
                            List <PrivateProfileGaleriVeResim> GaleriDataModel1_COPY = new List <PrivateProfileGaleriVeResim>();
                            for (int i = 0; i < 10; i++)
                            {
                                GaleriDataModel1_COPY.Add(GaleriDataModel1[i]);
                            }
                            GaleriDataModel1 = GaleriDataModel1_COPY;
                            GaleriDataModel1.Insert(0, new PrivateProfileGaleriVeResim()
                            {
                                isAddedCell = true
                            });
                        }
                        else
                        {
                            List <PrivateProfileGaleriVeResim> GaleriDataModel1_COPY = new List <PrivateProfileGaleriVeResim>();
                            for (int i = 0; i < GaleriDataModel1.Count; i++)
                            {
                                GaleriDataModel1_COPY.Add(GaleriDataModel1[i]);
                            }
                            GaleriDataModel1 = GaleriDataModel1_COPY;
                            GaleriDataModel1.Insert(0, new PrivateProfileGaleriVeResim()
                            {
                                isAddedCell = true
                            });
                        }

                        mRecyclerView.HasFixedSize = true;
                        mLayoutManager             = new LinearLayoutManager(this.Activity);
                        mRecyclerView.SetLayoutManager(mLayoutManager);
                        mViewAdapter = new PrivateProfileGaleriVeResimRecyclerViewAdapter(this, (Android.Support.V7.App.AppCompatActivity) this.Activity, GaleriDataModel1);
                        mRecyclerView.SetAdapter(mViewAdapter);
                        mViewAdapter.ItemClick += MViewAdapter_ItemClick;
                        mLayoutManager          = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
                        mRecyclerView.SetLayoutManager(mLayoutManager);
                        ShowLoading.Hide();
                    });
                }
                else
                {
                    GaleriDataModel1.Add(new PrivateProfileGaleriVeResim()
                    {
                        isAddedCell = true
                    });
Atla:
                    try
                    {
                        mRecyclerView.HasFixedSize = true;
                        mLayoutManager             = new LinearLayoutManager(this.Activity);
                        mRecyclerView.SetLayoutManager(mLayoutManager);
                        mViewAdapter = new PrivateProfileGaleriVeResimRecyclerViewAdapter(this, (Android.Support.V7.App.AppCompatActivity) this.Activity, GaleriDataModel1);
                        mRecyclerView.SetAdapter(mViewAdapter);
                        mViewAdapter.ItemClick += MViewAdapter_ItemClick;
                        mLayoutManager          = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
                        mRecyclerView.SetLayoutManager(mLayoutManager);
                    }
                    catch
                    {
                        goto Atla;
                    }

                    ShowLoading.Hide();
                }
            }
            else
            {
                GaleriDataModel1.Add(new PrivateProfileGaleriVeResim()
                {
                    isAddedCell = true
                });
Atla:
                try
                {
                    mRecyclerView.HasFixedSize = true;
                    mLayoutManager             = new LinearLayoutManager(this.Activity);
                    mRecyclerView.SetLayoutManager(mLayoutManager);
                    mViewAdapter = new PrivateProfileGaleriVeResimRecyclerViewAdapter(this, (Android.Support.V7.App.AppCompatActivity) this.Activity, GaleriDataModel1);
                    mRecyclerView.SetAdapter(mViewAdapter);
                    mViewAdapter.ItemClick += MViewAdapter_ItemClick;
                    mLayoutManager          = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false);
                    mRecyclerView.SetLayoutManager(mLayoutManager);
                }
                catch
                {
                    goto Atla;
                }

                ShowLoading.Hide();
            }
        }