public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_layouts, container, false);
            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            Button btnLinear = (Button)rootView.FindViewById(Resource.Id.btnLinear);
            btnLinear.Click += (object sender, EventArgs e) => {
                listView.SetLayoutManager(new LinearLayoutManager(this.Activity));
            };

            Button btnStaggered = (Button)rootView.FindViewById(Resource.Id.btnStaggered);
            btnStaggered.Click += (object sender, EventArgs e) => {
                StaggeredGridLayoutManager slm = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
                listView.SetLayoutManager(slm);
            };

            Button btnGrid = (Button)rootView.FindViewById(Resource.Id.btnGrid);
            btnGrid.Click += (object sender, EventArgs e) => {
                GridLayoutManager glm = new GridLayoutManager(this.Activity, 3, GridLayoutManager.Vertical, false);
                listView.SetLayoutManager(glm);
            };

            ArrayList source = new ArrayList();
            for (int i = 0; i < 50; i++) {
                source.Add(this.getRandomText());
            }
            this.listView.SetAdapter(new LayoutsListViewAdapter(source));
            return rootView;
        }
예제 #2
0
        public async void LoadMapLayout()
        {
            await System.Threading.Tasks.Task.Run(() =>
            {
                this.RunOnUiThread(() =>
                {
                    if (CheckConnection.IsInternet())
                    {
                        GetPlaceInfo(Name, LatLon.Split(",")[0], LatLon.Split(",")[1]);
                        foodiPlaces = GetPlaces();

                        placeAdapter = new FoodiPlaceAdapter(foodiPlaces, this);
                        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false);
                        radLvFoodiPlaces.SetLayoutManager(linearLayoutManager);
                        radLvFoodiPlaces.SetAdapter(placeAdapter);

                        FoodiPlacesClickListenner foodiPlacesClickListenner = new FoodiPlacesClickListenner(this, placeAdapter);
                        radLvFoodiPlaces.AddItemClickListener(foodiPlacesClickListenner);
                        mapFragment = (MapFragment)FragmentManager.FindFragmentById(Resource.Id.map);
                        mapFragment.GetMapAsync(this);

                        DisplayCustomRatingBar(ratingBar);
                    }
                    else
                    {
                        Toast.MakeText(this, "No Internet Connected!", ToastLength.Long).Show();
                    }
                });
            });
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView =  inflater.Inflate(Resource.Layout.fragment_list_view_wrap, container, false);

            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            wrapLayoutManager = new WrapLayoutManager(Activity);
            this.listView.SetLayoutManager(wrapLayoutManager);

            MyWrapLayoutAdapter myWrapAdapter = new MyWrapLayoutAdapter(GetData());
            this.listView.SetAdapter(myWrapAdapter);

            Button orientationBtn = (Button)rootView.FindViewById (Resource.Id.orientationBtn);
            orientationBtn.Click += (object sender, EventArgs e) => {
                if(wrapLayoutManager.CanScrollHorizontally()) {
                    wrapLayoutManager = new WrapLayoutManager(Activity, OrientationHelper.Vertical);
                } else {
                    wrapLayoutManager = new WrapLayoutManager(Activity, OrientationHelper.Horizontal);
                }
                listView.SetLayoutManager(wrapLayoutManager);
            };

            Button lineSpacingBtn = (Button)rootView.FindViewById (Resource.Id.lineSpacingBtn);
            lineSpacingBtn.Click += (object sender, EventArgs e) => {
                if(wrapLayoutManager.LineSpacing == 0) {
                    wrapLayoutManager.LineSpacing = 20;
                } else {
                    wrapLayoutManager.LineSpacing = 0;
                }
            };

            Button minItemSpacingBtn = (Button)rootView.FindViewById (Resource.Id.minItemSpacingBtn);
            minItemSpacingBtn.Click += (object sender, EventArgs e) => {
                if(wrapLayoutManager.MinimumItemSpacing == 0) {
                    wrapLayoutManager.MinimumItemSpacing = 20;
                } else {
                    wrapLayoutManager.MinimumItemSpacing = 0;
                }
            };

            Button gravityBtn = (Button)rootView.FindViewById (Resource.Id.gravityBtn);
            gravityBtn.Click += (object sender, EventArgs e) => {
                gravityCounter++;
                if(gravityCounter > 6) {
                    gravityCounter = 1;
                }
                switch (gravityCounter) {
                case 1: wrapLayoutManager.Gravity = (int)(GravityFlags.End | GravityFlags.Bottom); break;
                case 2: wrapLayoutManager.Gravity = (int)(GravityFlags.End | GravityFlags.Top); break;
                case 3: wrapLayoutManager.Gravity = (int)(GravityFlags.Start | GravityFlags.Bottom); break;
                case 4: wrapLayoutManager.Gravity = (int)(GravityFlags.Start | GravityFlags.Top); break;
                case 5: wrapLayoutManager.Gravity = (int)(GravityFlags.CenterHorizontal | GravityFlags.CenterVertical); break;
                case 6: wrapLayoutManager.Gravity = (int)(GravityFlags.FillHorizontal | GravityFlags.FillVertical); break;
                }
            };

            return rootView;
        }
예제 #4
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_layouts, container, false);

            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();

            Button btnLinear = (Button)rootView.FindViewById(Resource.Id.btnLinear);

            btnLinear.Click += (object sender, EventArgs e) => {
                listView.SetLayoutManager(new LinearLayoutManager(this.Activity));
            };

            Button btnStaggered = (Button)rootView.FindViewById(Resource.Id.btnStaggered);

            btnStaggered.Click += (object sender, EventArgs e) => {
                StaggeredGridLayoutManager slm = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.Vertical);
                listView.SetLayoutManager(slm);
            };

            Button btnGrid = (Button)rootView.FindViewById(Resource.Id.btnGrid);

            btnGrid.Click += (object sender, EventArgs e) => {
                GridLayoutManager glm = new GridLayoutManager(this.Activity, 3, GridLayoutManager.Vertical, false);
                listView.SetLayoutManager(glm);
            };

            Button btnDeck = (Button)rootView.FindViewById(Resource.Id.btnDeck);

            btnDeck.Click += (object sender, EventArgs e) => {
                DeckOfCardsLayoutManager dclm = new DeckOfCardsLayoutManager(this.Activity);
                listView.SetLayoutManager(dclm);
            };


            ArrayList source = new ArrayList();

            for (int i = 0; i < 50; i++)
            {
                source.Add(this.getRandomText());
            }
            this.listView.SetAdapter(new LayoutsListViewAdapter(source));
            return(rootView);
        }
예제 #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            InitViews();


            fabMain.Click += (o, e) =>
            {
                if (!isfabOpen)
                {
                    ShowFabMenu();
                }
                else
                {
                    CloseFabMenu();
                }
            };
            fabAccount2.Click += (o, e) =>
            {
                CloseFabMenu();
                GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 2, LinearLayoutManager.Vertical, false);
                radListView.SetLayoutManager(gridLayoutManager);
                //return true;
            };
            fabAccount1.Click += (o, e) =>
            {
                CloseFabMenu();
                //Toast.MakeText(this, "Account1!", ToastLength.Short).Show();
                LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
                radListView.SetLayoutManager(linearLayoutManager);
                //return true;
            };
            bgFabMenu.Click += (o, e) =>
            {
            };
        }
예제 #6
0
        void InitViews()
        {
            toolbar       = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.TbMain);
            radListView   = FindViewById <RadListView>(Resource.Id.radListView);
            fabMain       = FindViewById <FloatingActionButton>(Resource.Id.fab_main);
            fabAccount1   = FindViewById <FloatingActionButton>(Resource.Id.fab_account1);
            fabAccount2   = FindViewById <FloatingActionButton>(Resource.Id.fab_account2);
            bgFabMenu     = FindViewById <View>(Resource.Id.bg_fab_menu);
            lnProgressBar = FindViewById <LinearLayout>(Resource.Id.lnProgressBar);
            districts     = new List <DistrictItem>();
            dsList        = new List <District>();
            db.CreateTable <DistrictItem>();
            if (CheckConnection.IsInternet())
            {
                GetData();
            }
            else
            {
                dsList          = getDistricts();
                districtAdapter = new ExCityAdapter(dsList, this);
                radListView.SetAdapter(districtAdapter);
            }

            dsList          = getDistricts();
            districtAdapter = new ExCityAdapter(dsList, this);
            radListView.SetAdapter(districtAdapter);
            DistrictClickListener districtClickListener = new DistrictClickListener(this, districtAdapter);

            radListView.AddItemClickListener(districtClickListener);
            LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);

            radListView.SetLayoutManager(linearLayoutManager);

            SetSupportActionBar(toolbar);
            SupportActionBar.Title = "Foodi";
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView =  inflater.Inflate(Resource.Layout.fragment_list_view_slide, container, false);
            listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            CountryAdapter adapter = new CountryAdapter(GetData());
            listView.SetAdapter(adapter);

            slideLayoutManager = new SlideLayoutManager(Activity);
            listView.SetLayoutManager(slideLayoutManager);

            Button orientationBtn = (Button)rootView.FindViewById (Resource.Id.orientationBtn);
            orientationBtn.Click += (object sender, EventArgs e) => {
                if(orientation == OrientationHelper.Vertical) {
                    orientation = OrientationHelper.Horizontal;
                } else {
                    orientation = OrientationHelper.Vertical;
                }
                slideLayoutManager = new SlideLayoutManager(Activity, orientation);
                listView.SetLayoutManager(slideLayoutManager);
            };

            Button transitionBtn = (Button)rootView.FindViewById(Resource.Id.transitionBtn);
            transitionBtn.Click += (object sender, EventArgs e) => {
                if(slideLayoutManager.TransitionMode == SlideLayoutManager.Transition.SlideAway) {
                    slideLayoutManager.TransitionMode = SlideLayoutManager.Transition.SlideOver;
                } else {
                    slideLayoutManager.TransitionMode = SlideLayoutManager.Transition.SlideAway;
                }
            };

            ToggleButton spacingBtn = (ToggleButton)rootView.FindViewById(Resource.Id.spacingBtn);
            spacingBtn.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                if(e.IsChecked) {
                    slideLayoutManager.ItemSpacing = 50;
                } else {
                    slideLayoutManager.ItemSpacing = 0;
                }
            };

            ToggleButton showPreviousButton = (ToggleButton)rootView.FindViewById(Resource.Id.showPrevBtn);
            showPreviousButton.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                if(e.IsChecked) {
                    slideLayoutManager.PreviousItemPreview = 100;
                } else {
                    slideLayoutManager.PreviousItemPreview = 0;
                }
            };

            ToggleButton showNextButton = (ToggleButton)rootView.FindViewById(Resource.Id.showNextBtn);
            showNextButton.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                if(e.IsChecked) {
                    slideLayoutManager.NextItemPreview = 100;
                } else {
                    slideLayoutManager.NextItemPreview = 0;
                }
            };

            Button previousBtn = (Button)rootView.FindViewById(Resource.Id.previousBtn);
            previousBtn.Click += (object sender, EventArgs e) => {
                slideLayoutManager.ScrollToPrevious();
            };

            Button nextBtn = (Button)rootView.FindViewById(Resource.Id.nextBtn);
            nextBtn.Click += (object sender, EventArgs e) => {
                slideLayoutManager.ScrollToNext();
            };

            return rootView;
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_deck, container, false);

            listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            CountryAdapter adapter = new CountryAdapter(getData());
            listView.SetAdapter(adapter);

            deckOfCardsLayoutManager = new DeckOfCardsLayoutManager(Activity);
            listView.SetLayoutManager(deckOfCardsLayoutManager);

            Button orientationBtn = (Button)rootView.FindViewById (Resource.Id.orientationBtn);
            orientationBtn.Click += (object sender, EventArgs e) => {
                if(orientation == OrientationHelper.Vertical) {
                    orientation = OrientationHelper.Horizontal;
                } else {
                    orientation = OrientationHelper.Vertical;
                }
                deckOfCardsLayoutManager = new DeckOfCardsLayoutManager(Activity, orientation, reverseLayout);
                listView.SetLayoutManager(deckOfCardsLayoutManager);
            };

            Button reverseBtn = (Button)rootView.FindViewById (Resource.Id.reverseBtn);
            reverseBtn.Click += (object sender, EventArgs e) => {
                reverseLayout = !reverseLayout;
                deckOfCardsLayoutManager = new DeckOfCardsLayoutManager(Activity, orientation, reverseLayout);
                listView.SetLayoutManager(deckOfCardsLayoutManager);
            };

            Button countBtn = (Button)rootView.FindViewById (Resource.Id.countBtn);
            countBtn.Click += (object sender, EventArgs e) => {
                if(deckOfCardsLayoutManager.PerspectiveItemsCount == 2) {
                    deckOfCardsLayoutManager.PerspectiveItemsCount = 5;
                } else {
                    deckOfCardsLayoutManager.PerspectiveItemsCount = 2;
                }
            };

            Button perspectiveBtn = (Button)rootView.FindViewById(Resource.Id.perspectiveBtn);
            perspectiveBtn.Click += (object sender, EventArgs e) => {
                if(deckOfCardsLayoutManager.Perspective().TranslateStart != PerspectiveChangeInfo.DefaultTranslation) {
                    deckOfCardsLayoutManager.Perspective().TranslateStart = PerspectiveChangeInfo.DefaultTranslation;
                    deckOfCardsLayoutManager.Perspective().TranslateTop = PerspectiveChangeInfo.DefaultTranslation;
                    deckOfCardsLayoutManager.Perspective().TranslateEnd = PerspectiveChangeInfo.DefaultTranslation;
                } else {
                    deckOfCardsLayoutManager.Perspective().TranslateStart = -50;
                    deckOfCardsLayoutManager.Perspective().TranslateTop = -50;
                    deckOfCardsLayoutManager.Perspective().TranslateEnd = -50;
                }
            };

            Button previousBtn = (Button)rootView.FindViewById(Resource.Id.previousBtn);
            previousBtn.Click += (object sender, EventArgs e) => {
                deckOfCardsLayoutManager.ScrollToPrevious();
            };

            Button nextBtn = (Button)rootView.FindViewById(Resource.Id.nextBtn);
            nextBtn.Click += (object sender, EventArgs e) => {
                deckOfCardsLayoutManager.ScrollToNext();
            };

            return rootView;
        }
예제 #9
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_slide, container, false);

            listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();

            CountryAdapter adapter = new CountryAdapter(GetData());

            listView.SetAdapter(adapter);

            slideLayoutManager = new SlideLayoutManager(Activity);
            listView.SetLayoutManager(slideLayoutManager);

            Button orientationBtn = (Button)rootView.FindViewById(Resource.Id.orientationBtn);

            orientationBtn.Click += (object sender, EventArgs e) => {
                if (orientation == OrientationHelper.Vertical)
                {
                    orientation = OrientationHelper.Horizontal;
                }
                else
                {
                    orientation = OrientationHelper.Vertical;
                }
                slideLayoutManager = new SlideLayoutManager(Activity, orientation);
                listView.SetLayoutManager(slideLayoutManager);
            };

            Button transitionBtn = (Button)rootView.FindViewById(Resource.Id.transitionBtn);

            transitionBtn.Click += (object sender, EventArgs e) => {
                if (slideLayoutManager.TransitionMode == SlideLayoutManager.Transition.SlideAway)
                {
                    slideLayoutManager.TransitionMode = SlideLayoutManager.Transition.SlideOver;
                }
                else
                {
                    slideLayoutManager.TransitionMode = SlideLayoutManager.Transition.SlideAway;
                }
            };

            ToggleButton spacingBtn = (ToggleButton)rootView.FindViewById(Resource.Id.spacingBtn);

            spacingBtn.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                if (e.IsChecked)
                {
                    slideLayoutManager.ItemSpacing = 50;
                }
                else
                {
                    slideLayoutManager.ItemSpacing = 0;
                }
            };

            ToggleButton showPreviousButton = (ToggleButton)rootView.FindViewById(Resource.Id.showPrevBtn);

            showPreviousButton.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                if (e.IsChecked)
                {
                    slideLayoutManager.PreviousItemPreview = 100;
                }
                else
                {
                    slideLayoutManager.PreviousItemPreview = 0;
                }
            };

            ToggleButton showNextButton = (ToggleButton)rootView.FindViewById(Resource.Id.showNextBtn);

            showNextButton.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                if (e.IsChecked)
                {
                    slideLayoutManager.NextItemPreview = 100;
                }
                else
                {
                    slideLayoutManager.NextItemPreview = 0;
                }
            };

            Button previousBtn = (Button)rootView.FindViewById(Resource.Id.previousBtn);

            previousBtn.Click += (object sender, EventArgs e) => {
                slideLayoutManager.ScrollToPrevious();
            };

            Button nextBtn = (Button)rootView.FindViewById(Resource.Id.nextBtn);

            nextBtn.Click += (object sender, EventArgs e) => {
                slideLayoutManager.ScrollToNext();
            };

            return(rootView);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_deck, container, false);

            listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();

            CountryAdapter adapter = new CountryAdapter(getData());

            listView.SetAdapter(adapter);

            deckOfCardsLayoutManager = new DeckOfCardsLayoutManager(Activity);
            listView.SetLayoutManager(deckOfCardsLayoutManager);

            Button orientationBtn = (Button)rootView.FindViewById(Resource.Id.orientationBtn);

            orientationBtn.Click += (object sender, EventArgs e) => {
                if (orientation == OrientationHelper.Vertical)
                {
                    orientation = OrientationHelper.Horizontal;
                }
                else
                {
                    orientation = OrientationHelper.Vertical;
                }
                deckOfCardsLayoutManager = new DeckOfCardsLayoutManager(Activity, orientation, reverseLayout);
                listView.SetLayoutManager(deckOfCardsLayoutManager);
            };

            Button reverseBtn = (Button)rootView.FindViewById(Resource.Id.reverseBtn);

            reverseBtn.Click += (object sender, EventArgs e) => {
                reverseLayout            = !reverseLayout;
                deckOfCardsLayoutManager = new DeckOfCardsLayoutManager(Activity, orientation, reverseLayout);
                listView.SetLayoutManager(deckOfCardsLayoutManager);
            };

            Button countBtn = (Button)rootView.FindViewById(Resource.Id.countBtn);

            countBtn.Click += (object sender, EventArgs e) => {
                if (deckOfCardsLayoutManager.PerspectiveItemsCount == 2)
                {
                    deckOfCardsLayoutManager.PerspectiveItemsCount = 5;
                }
                else
                {
                    deckOfCardsLayoutManager.PerspectiveItemsCount = 2;
                }
            };

            Button perspectiveBtn = (Button)rootView.FindViewById(Resource.Id.perspectiveBtn);

            perspectiveBtn.Click += (object sender, EventArgs e) => {
                if (deckOfCardsLayoutManager.Perspective().TranslateStart != PerspectiveChangeInfo.DefaultTranslation)
                {
                    deckOfCardsLayoutManager.Perspective().TranslateStart = PerspectiveChangeInfo.DefaultTranslation;
                    deckOfCardsLayoutManager.Perspective().TranslateTop   = PerspectiveChangeInfo.DefaultTranslation;
                    deckOfCardsLayoutManager.Perspective().TranslateEnd   = PerspectiveChangeInfo.DefaultTranslation;
                }
                else
                {
                    deckOfCardsLayoutManager.Perspective().TranslateStart = -50;
                    deckOfCardsLayoutManager.Perspective().TranslateTop   = -50;
                    deckOfCardsLayoutManager.Perspective().TranslateEnd   = -50;
                }
            };

            Button previousBtn = (Button)rootView.FindViewById(Resource.Id.previousBtn);

            previousBtn.Click += (object sender, EventArgs e) => {
                deckOfCardsLayoutManager.ScrollToPrevious();
            };

            Button nextBtn = (Button)rootView.FindViewById(Resource.Id.nextBtn);

            nextBtn.Click += (object sender, EventArgs e) => {
                deckOfCardsLayoutManager.ScrollToNext();
            };

            return(rootView);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_wrap, container, false);

            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();

            wrapLayoutManager = new WrapLayoutManager(Activity);
            this.listView.SetLayoutManager(wrapLayoutManager);

            MyWrapLayoutAdapter myWrapAdapter = new MyWrapLayoutAdapter(GetData());

            this.listView.SetAdapter(myWrapAdapter);

            Button orientationBtn = (Button)rootView.FindViewById(Resource.Id.orientationBtn);

            orientationBtn.Click += (object sender, EventArgs e) => {
                if (wrapLayoutManager.CanScrollHorizontally())
                {
                    wrapLayoutManager = new WrapLayoutManager(Activity, OrientationHelper.Vertical);
                }
                else
                {
                    wrapLayoutManager = new WrapLayoutManager(Activity, OrientationHelper.Horizontal);
                }
                listView.SetLayoutManager(wrapLayoutManager);
            };

            Button lineSpacingBtn = (Button)rootView.FindViewById(Resource.Id.lineSpacingBtn);

            lineSpacingBtn.Click += (object sender, EventArgs e) => {
                if (wrapLayoutManager.LineSpacing == 0)
                {
                    wrapLayoutManager.LineSpacing = 20;
                }
                else
                {
                    wrapLayoutManager.LineSpacing = 0;
                }
            };

            Button minItemSpacingBtn = (Button)rootView.FindViewById(Resource.Id.minItemSpacingBtn);

            minItemSpacingBtn.Click += (object sender, EventArgs e) => {
                if (wrapLayoutManager.MinimumItemSpacing == 0)
                {
                    wrapLayoutManager.MinimumItemSpacing = 20;
                }
                else
                {
                    wrapLayoutManager.MinimumItemSpacing = 0;
                }
            };

            Button gravityBtn = (Button)rootView.FindViewById(Resource.Id.gravityBtn);

            gravityBtn.Click += (object sender, EventArgs e) => {
                gravityCounter++;
                if (gravityCounter > 6)
                {
                    gravityCounter = 1;
                }
                switch (gravityCounter)
                {
                case 1: wrapLayoutManager.Gravity = (int)(GravityFlags.End | GravityFlags.Bottom); break;

                case 2: wrapLayoutManager.Gravity = (int)(GravityFlags.End | GravityFlags.Top); break;

                case 3: wrapLayoutManager.Gravity = (int)(GravityFlags.Start | GravityFlags.Bottom); break;

                case 4: wrapLayoutManager.Gravity = (int)(GravityFlags.Start | GravityFlags.Top); break;

                case 5: wrapLayoutManager.Gravity = (int)(GravityFlags.CenterHorizontal | GravityFlags.CenterVertical); break;

                case 6: wrapLayoutManager.Gravity = (int)(GravityFlags.FillHorizontal | GravityFlags.FillVertical); break;
                }
            };

            return(rootView);
        }