예제 #1
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();
                    }
                });
            });
        }
예제 #2
0
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater.Inflate(Resource.Menu.menu_main, menu);
            var item   = menu.FindItem(Resource.Id.action_search);
            var search = MenuItemCompat.GetActionView(item);

            searchView = search.JavaCast <Android.Support.V7.Widget.SearchView>();
            dsSearch   = new List <District>();

            searchView.QueryTextChange += (s, e) =>
            {
                dsSearch.Clear();
                foreach (var ds in dsList)
                {
                    if (ds.Name.ToLower().Contains(e.NewText.ToLower()))
                    {
                        dsSearch.Add(ds);
                    }
                    SearchAdapter = new ExCityAdapter(dsSearch, this);
                    radListView.SetAdapter(SearchAdapter);
                }
            };

            return(true);
        }
예제 #3
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);

            LoadApplication(new App());

            SetContentView(Resource.Layout.Main);

            mViewModel = new SampleViewModel();

            mViewModel.Buckets.CollectionChanged += Buckets_CollectionChanged;

            this.mBucketListView = (RadListView)FindViewById(Resource.Id.lv_Dashboard_ListView);

            clickbtn = (Button)FindViewById(Resource.Id.click);

            clickbtn.Click += Clickbtn_Click;

            //clickbtn.SetCommand("Click", mViewModel.GetSampleSelection);

            mSampleAdapter = new SampleAdapter(this, mViewModel);

            mBucketListView.SetAdapter(mSampleAdapter);
        }
예제 #4
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_layouts, container, false);
            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            ArrayList source = new ArrayList();
            for (int i = 0; i < 50; i++) {
                source.Add(this.getRandomText());
            }
            this.listView.SetAdapter(new LayoutsListViewAdapter(source));

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

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

            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);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnDeck = (Button)rootView.FindViewById(Resource.Id.btnDeck);
            btnDeck.Click += (object sender, EventArgs e) => {
                DeckOfCardsLayoutManager dclm = new DeckOfCardsLayoutManager(this.Activity);
                listView.SetLayoutManager(dclm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnSlide = (Button)rootView.FindViewById(Resource.Id.btnSlide);
            btnSlide.Click += (object sender, EventArgs e) => {
                SlideLayoutManager slm = new SlideLayoutManager(this.Activity);
                listView.SetLayoutManager(slm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

            Button btnWrap = (Button)rootView.FindViewById(Resource.Id.btnWrap);
            btnWrap.Click += (object sender, EventArgs e) => {
                WrapLayoutManager wlm = new WrapLayoutManager(this.Activity);
                listView.SetLayoutManager(wlm);
                listView.SetAdapter(new MyWrapAdapter(source));
            };

            return rootView;
        }
예제 #6
0
        public async void LoadReviews()
        {
            await System.Threading.Tasks.Task.Run(() =>
            {
                this.RunOnUiThread(() =>
                {
                    if (reviewAdapter == null)
                    {
                        reviewAdapter = new ReviewAdapter(reviews, this);
                        radReviews.SetAdapter(reviewAdapter);
                    }
                });
            });

            lnMoreReviews.Visibility       = ViewStates.Visible;
            frReviews.Visibility           = ViewStates.Gone;
            lnReviewsTop.Visibility        = ViewStates.Gone;
            txtTopReviewsDetail.Visibility = ViewStates.Gone;
            txtMore.Visibility             = ViewStates.Gone;
        }
        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);
        }
예제 #11
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>();

            ArrayList source = new ArrayList();

            for (int i = 0; i < 50; i++)
            {
                source.Add(this.getRandomText());
            }
            this.listView.SetAdapter(new LayoutsListViewAdapter(source));

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

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

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

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

            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);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

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

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

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

            btnSlide.Click += (object sender, EventArgs e) => {
                SlideLayoutManager slm = new SlideLayoutManager(this.Activity);
                listView.SetLayoutManager(slm);
                listView.SetAdapter(new LayoutsListViewAdapter(source));
            };

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

            btnWrap.Click += (object sender, EventArgs e) => {
                WrapLayoutManager wlm = new WrapLayoutManager(this.Activity);
                listView.SetLayoutManager(wlm);
                listView.SetAdapter(new MyWrapAdapter(source));
            };

            return(rootView);
        }