private void CreateDateSelectionPage()
        {
            secondPage = new RelativeLayout(cont);
            LinearLayout secondPageContent = new LinearLayout(cont);

            secondPageContent.Orientation = Orientation.Vertical;
            secondPage.Id = 2;
            TouchObserverView rel = new TouchObserverView(cont);

            rel.Alpha = 0.8f;
            rel.ViewAttachedToWindow += async delegate
            {
                for (int i = 0; i < 3; i++)
                {
                    if (pageExited)
                    {
                        return;
                    }
                    if (TheaterAdapter.counter == 0)
                    {
                        rel.Visibility = ViewStates.Visible;
                        CreateAnimationPopup();
                        animationPopup.Show(10, 0);
                        TheaterAdapter.counter++;
                        await Task.Delay(700);
                    }
                    else if (TheaterAdapter.counter == 1)
                    {
                        animationPopup.Dismiss();
                        await Task.Delay(700);

                        rel.Visibility = ViewStates.Visible;
                        var image = new ImageView(cont);
                        animationPopup.PopupView.AnimationMode = AnimationMode.SlideOnLeft;
                        image.SetImageResource(Resource.Drawable.Popup_TheatrInfo);
                        animationPopup.PopupView.ContentView = image;
                        animationPopup.Show((int)(cont.Resources.DisplayMetrics.WidthPixels / density - 40), 135);
                        TheaterAdapter.counter++;
                        await Task.Delay(700);
                    }
                    else if (TheaterAdapter.counter == 2)
                    {
                        animationPopup.Dismiss();
                        await Task.Delay(700);

                        rel.Visibility = ViewStates.Visible;
                        var image = new ImageView(cont);
                        animationPopup.PopupView.AnimationMode = AnimationMode.SlideOnTop;
                        image.SetImageResource(Resource.Drawable.Popup_SelectSeats);
                        animationPopup.PopupView.ContentView = image;
                        animationPopup.Show(10, 80);
                        TheaterAdapter.counter++;
                        await Task.Delay(700);

                        rel.Visibility           = ViewStates.Gone;
                        animationPopup.StaysOpen = false;
                        animationPopup.Dismiss();
                    }
                    if (TheaterAdapter.counter >= 4)
                    {
                        animationPopup.StaysOpen = false;
                        animationPopup.Dismiss();
                    }
                }
                animationPopup.StaysOpen = false;
                rel.Visibility           = ViewStates.Gone;
                animationPopup.Dismiss();
                TheaterAdapter.counter = 0;
            };
            dateSelectionView             = new LinearLayout(cont);
            dateSelectionView.Orientation = Orientation.Horizontal;
            dateSelectionView.AddView(CreateDateView(0, 0), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(1), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(2), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(3), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(4), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(5), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(6), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);

            theatreList = new ListView(cont);
            PopulateTheatreList();
            theatreList.Adapter    = new TheaterAdapter((cont as AllControlsSamplePage), items, mainView);
            theatreList.ItemClick += MovieList_ItemClick;
            theatreList.ViewDetachedFromWindow += TheatreList_ViewDetachedFromWindow;

            secondPageContent.AddView(dateSelectionView, ViewGroup.LayoutParams.MatchParent, (int)(62 * density));
            secondPageContent.AddView(theatreList, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            secondPage.AddView(secondPageContent, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            secondPage.AddView(rel, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            rel.SetBackgroundColor(Color.Black);
        }
Exemple #2
0
        private void CreateDateSelectionPage()
        {
            secondPage = new RelativeLayout(cont);
            LinearLayout secondPageContent = new LinearLayout(cont);

            secondPageContent.Orientation = Orientation.Vertical;
            secondPage.Id = 2;
            popup.IsOpen  = false;
            TouchObserverView rel = new TouchObserverView(cont);

            rel.Alpha = 0.8f;
            rel.ViewAttachedToWindow += async delegate
            {
                for (int i = 0; i < 3; i++)
                {
                    if (TheaterAdapter.counter == 0)
                    {
                        popup.IsOpen   = false;
                        rel.Visibility = ViewStates.Visible;
                        popup.PopupView.AnimationMode = AnimationMode.Zoom;
                        var image = new ImageView(cont);
                        image.SetImageResource(Resource.Drawable.Popup_DateSelected);
                        popup.PopupView.ShowHeader    = false;
                        popup.PopupView.ShowFooter    = false;
                        popup.PopupView.ContentView   = image;
                        popup.PopupView.HeightRequest = 200;
                        popup.PopupView.WidthRequest  = 200;
                        popup.PopupView.SetBackgroundColor(Color.Transparent);
                        popup.PopupView.SetBackgroundColor(Color.Transparent);
                        popup.PopupView.ContentView.SetBackgroundColor(Color.Transparent);
                        popup.PopupView.PopupStyle.BorderColor = Color.Transparent;
                        popup.Show((int)(10 * density), 0);
                        TheaterAdapter.counter++;
                        await Task.Delay(700);
                    }
                    else if (TheaterAdapter.counter == 1)
                    {
                        popup.IsOpen = false;
                        await Task.Delay(700);

                        rel.Visibility = ViewStates.Visible;
                        var image = new ImageView(cont);
                        popup.PopupView.AnimationMode = AnimationMode.SlideOnLeft;
                        image.SetImageResource(Resource.Drawable.Popup_TheatrInfo);
                        popup.PopupView.ContentView = image;
                        popup.Show((int)(cont.Resources.DisplayMetrics.WidthPixels - 40 * density), (int)(135 * density));
                        TheaterAdapter.counter++;
                        await Task.Delay(700);
                    }
                    else if (TheaterAdapter.counter == 2)
                    {
                        popup.IsOpen = false;
                        await Task.Delay(700);

                        rel.Visibility = ViewStates.Visible;
                        var image = new ImageView(cont);
                        popup.PopupView.AnimationMode = AnimationMode.SlideOnTop;
                        image.SetImageResource(Resource.Drawable.Popup_SelectSeats);
                        popup.PopupView.ContentView = image;
                        popup.Show((int)(10 * density), (int)(80 * density));
                        TheaterAdapter.counter++;
                        await Task.Delay(700);

                        rel.Visibility  = ViewStates.Gone;
                        popup.StaysOpen = false;
                        popup.IsOpen    = false;
                    }
                    if (TheaterAdapter.counter >= 4)
                    {
                        popup.StaysOpen = false;
                        popup.IsOpen    = false;
                    }
                }
                popup.StaysOpen        = false;
                rel.Visibility         = ViewStates.Gone;
                popup.IsOpen           = false;
                TheaterAdapter.counter = 0;
            };
            dateSelectionView             = new LinearLayout(cont);
            dateSelectionView.Orientation = Orientation.Horizontal;
            dateSelectionView.AddView(CreateDateView(0, 0), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(1), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(2), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(3), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(4), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(5), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);
            dateSelectionView.AddView(CreateDateView(6), cont.Resources.DisplayMetrics.WidthPixels / 7, ViewGroup.LayoutParams.MatchParent);

            theatreList = new ListView(cont);
            PopulateTheatreList();
            theatreList.Adapter    = new TheaterAdapter((cont as FeaturesTabbedPage), items, popup, mainView);
            theatreList.ItemClick += MovieList_ItemClick;

            secondPageContent.AddView(dateSelectionView, ViewGroup.LayoutParams.MatchParent, (int)(62 * density));
            secondPageContent.AddView(theatreList, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            secondPage.AddView(secondPageContent, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            secondPage.AddView(rel, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            rel.SetBackgroundColor(Color.Black);
        }