Beispiel #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            for (int a = 0; a < 15; a++)
            {
                Generuj_Event_class();
            }
            mRecyclerView = inflater.Inflate(Resource.Layout.Friends, container, false) as RecyclerView;
            var mLayoutManager = new LinearLayoutManager(mRecyclerView.Context);

            mAdapter = new RecyclerAdapter(lista_wydarzen);

            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            mRecyclerView.AddOnScrollListener(onScrollListener);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);

            mRecyclerView.SetItemClickListener((rv, position, view) =>
            {
                Dialog("Powiadomienia", "Zaakceptowaæ?");
            });

            // £adowanie nastêpnych wydarzeñ po dojechaniu na sam dó³
            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
                for (int a = 0; a < 5; a++)
                {
                    Generuj_Event_class();
                }
                //mAdapter.NotifyDataSetChanged();
                mAdapter = new RecyclerAdapter(lista_wydarzen);
                mRecyclerView.SetAdapter(mAdapter);
            };

            return(mRecyclerView);
        }
Beispiel #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view2 = inflater.Inflate(Resource.Layout.Findplayers, container, false);

            SupportToolbar toolBar = view2.FindViewById <SupportToolbar>(Resource.Id.toolbar);

            ((AppCompatActivity)this.Activity).SetSupportActionBar(toolBar);
            ((AppCompatActivity)this.Activity).SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            ((AppCompatActivity)this.Activity).SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            ((AppCompatActivity)this.Activity).SupportActionBar.Title = GetString(Resource.String.Findplayers_Title);


            mRecyclerView = view2.FindViewById <RecyclerView>(Resource.Id.recyclerview);

            int uri2 = Resource.Drawable.Icon2;

            GetRandomSubList(Lists.Friends.NickStrings, 2);  // dodanie 30 obiektów do listy

            var mLayoutManager   = new LinearLayoutManager(mRecyclerView.Context);
            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            mRecyclerView.AddOnScrollListener(onScrollListener);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mAdapter = new SimpleStringRecyclerViewAdapter(mRecyclerView.Context, list, uri2, view2, 1);

            mRecyclerView.SetAdapter(mAdapter);


            mRecyclerView.SetItemClickListener((rv, position, view) =>
            {
                TextView mTxtView = view.FindViewById <TextView>(Resource.Id.text1);
                Context context   = view2.Context;
                Intent intent     = new Intent(context, typeof(Profile));
                intent.PutExtra("Name", mTxtView.Text);
                context.StartActivity(intent);
            });


            // Dodanie nowych obiektów do listy po dojechaniu na dó³
            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
                //GetRandomSubList(Lists.Friends.NickStrings, 5); // generowanie i dodanie noeych obiektów

                //mAdapter.NotifyDataSetChanged();
            };

            return(view2);
        }
Beispiel #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            Tournament aaa = new Tournament("Turniej Gfinity 2016 PRO League", "Virtus.pro", "Fnatic", "28.05 20:15", "Counter-Strike: Global Offensive");

            view = inflater.Inflate(Resource.Layout.Tournament, container, false);
            for (int a = 0; a < 15; a++)
            {
                Generuj_Event_class();
            }
            mRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerview);
            //mRecyclerView = inflater.Inflate(Resource.Layout.Friends, container, false) as RecyclerView;
            var mLayoutManager = new LinearLayoutManager(((AppCompatActivity)this.Activity));

            mAdapter = new RecyclerAdapter(lista_wydarzen);

            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            mRecyclerView.AddOnScrollListener(onScrollListener);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);

            // £adowanie nastêpnych wydarzeñ po dojechaniu na sam dó³
            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) =>
            {
                for (int a = 0; a < 5; a++)
                {
                    Generuj_Event_class();
                }
                //mAdapter.NotifyDataSetChanged();
                mAdapter = new RecyclerAdapter(lista_wydarzen);
                mRecyclerView.SetAdapter(mAdapter);
            };

            SupportToolbar toolBar = view.FindViewById <SupportToolbar>(Resource.Id.toolbar);

            ((AppCompatActivity)this.Activity).SetSupportActionBar(toolBar);
            ((AppCompatActivity)this.Activity).SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            ((AppCompatActivity)this.Activity).SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            ((AppCompatActivity)this.Activity).SupportActionBar.Title = GetString(Resource.String.Tournament_Title);
            return(view);
        }
Beispiel #4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            view          = inflater.Inflate(Resource.Layout.Quickgame, container, false);
            mRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerview);
            //mRecyclerView = inflater.Inflate(Resource.Layout.Friends, container, false) as RecyclerView;
            var mLayoutManager = new LinearLayoutManager(((AppCompatActivity)this.Activity));

            mAdapter = new RecyclerAdapter(list);

            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            mRecyclerView.AddOnScrollListener(onScrollListener);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);

            SupportToolbar toolBar = view.FindViewById <SupportToolbar>(Resource.Id.toolbar);

            ((AppCompatActivity)this.Activity).SetSupportActionBar(toolBar);
            ((AppCompatActivity)this.Activity).SupportActionBar.SetHomeAsUpIndicator(Resource.Drawable.ic_menu);
            ((AppCompatActivity)this.Activity).SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            ((AppCompatActivity)this.Activity).SupportActionBar.Title = GetString(Resource.String.Quickgame_Title);


            FloatingActionButton myFab = (FloatingActionButton)view.FindViewById(Resource.Id.fab);

            myFab.Click += delegate
            {
                Context context = view.Context;
                Intent  intent  = new Intent(context, typeof(AddQuickgame));
                context.StartActivity(intent);
            };

            mRecyclerView.SetItemClickListener((rv, position, view) =>
            {
                Intent intent = new Intent(((AppCompatActivity)this.Activity), typeof(QuickgameDetail));
                ((AppCompatActivity)this.Activity).StartActivity(intent);
            });


            return(view);
        }
Beispiel #5
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            RecyclerView recyclerView = inflater.Inflate(Resource.Layout.Friends, container, false) as RecyclerView;

            GetRandomSubList(Lists.Friends.NickStrings, 30);  // dodanie 30 obiektów do listy
            view = inflater.Inflate(Resource.Layout.Friends, container, false);
            var mLayoutManager   = new LinearLayoutManager(recyclerView.Context);
            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            recyclerView.AddOnScrollListener(onScrollListener);
            recyclerView.SetLayoutManager(mLayoutManager);
            mAdapter = new SimpleStringRecyclerViewAdapter(recyclerView.Context, list, Activity.Resources);
            recyclerView.SetAdapter(mAdapter);


            recyclerView.SetItemClickListener((rv, position, view) =>
            {
                //var newFragment = new Chat();
                //var ft = FragmentManager.BeginTransaction();
                //ft.Replace(Resource.Id.flContent, newFragment);
                //ft.AddToBackStack(null);
                //ft.Commit();
            });

            // Dodanie nowych obiektów do listy po dojechaniu na dó³
            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
                GetRandomSubList(Lists.Friends.NickStrings, 5); // generowanie i dodanie noeych obiektów

                mAdapter.NotifyDataSetChanged();
            };


            //NIE DZIA£A
            //var view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.Hub, container, false);

            //AppBarLayout appBarLayout = view.FindViewById<AppBarLayout>(Resource.Id.appbar);
            //appBarLayout.SetExpanded(true, true);

            return(recyclerView);
        }
Beispiel #6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            int iloscnewsow = 12; //Startowa iloœæ newsóe

            mRecyclerView = inflater.Inflate(Resource.Layout.Friends, container, false) as RecyclerView;
            var mLayoutManager = new LinearLayoutManager(mRecyclerView.Context);

            mAdapter = new RecyclerAdapter(iloscnewsow);

            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            mRecyclerView.AddOnScrollListener(onScrollListener);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);


            mRecyclerView.SetItemClickListener((rv, position, view) =>
            {
                string Link     = "http://www.gry-online.pl/";
                Context context = view.Context;
                Intent intent   = new Intent(context, typeof(Browser));
                intent.PutExtra("BrowserLink", Link);

                context.StartActivity(intent);
            });

            // £adowanie nastêpnych newsów po dojechaniu na sam dó³ listy newsów
            onScrollListener.LoadMoreEvent += (object sender, EventArgs e) => {
                iloscnewsow += 5;  // zwiêksz iloœc newsów o 5 w póŸniejszym czasie ³adowanie do listy nowych obiektów

                //mAdapter.NotifyDataSetChanged();
                mAdapter = new RecyclerAdapter(iloscnewsow);
                mRecyclerView.SetAdapter(mAdapter);
            };

            ((AppCompatActivity)this.Activity).SupportActionBar.Title = "Wiadomoœci";

            return(mRecyclerView);
        }
Beispiel #7
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            mRecyclerView = inflater.Inflate(Resource.Layout.Friends, container, false) as RecyclerView;
            var mLayoutManager = new LinearLayoutManager(mRecyclerView.Context);

            mAdapter = new RecyclerAdapter(list);

            var onScrollListener = new RecyclerViewOnScrollListener(mLayoutManager);

            mRecyclerView.AddOnScrollListener(onScrollListener);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mRecyclerView.SetAdapter(mAdapter);
            LoadEvents();

/*       onScrollListener.LoadMoreEvent += (object sender, EventArgs e) =>
 *      {
 *          mAdapter = new RecyclerAdapter(list);
 *          mRecyclerView.SetAdapter(mAdapter);
 *      };
 */
            ((AppCompatActivity)this.Activity).SupportActionBar.Title = "Wydarzenia";

            return(mRecyclerView);
        }