private void ListView_ItemTapped(object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e)
 {
     if (popupLayout != null)
     {
         popupLayout.Dismiss();
     }
 }
Ejemplo n.º 2
0
        private async void LoopView() 

        {
            System.Drawing.Point point1 = new System.Drawing.Point(0, 0);
            animationPopup = new SfPopupLayout();
            animationPopup.PopupView.AnimationMode = AnimationMode.None;
            if (LoadImage("Images/Popup_DateSelected.png", new CGRect(10 + 5, 70 + 5, 175, 75)))
            {
                await Task.Delay(1800);
            }
            animationPopup.Dismiss();
            await Task.Delay(300);

            animationPopup.PopupView.AnimationMode = AnimationMode.SlideOnLeft;
            if (LoadImage("Images/Popup_TheatrInfo.png", new CGRect(UIScreen.MainScreen.Bounds.Width - 200, 180, 150, 35)))
            {
                await Task.Delay(1800);
            }
            animationPopup.Dismiss();
            await Task.Delay(300);

            animationPopup.PopupView.AnimationMode = AnimationMode.Zoom;
            if (LoadImage("Images/Popup_SelectSeats.png", new CGRect(10, 180 + 30, 175, 75)))
            {
                await Task.Delay(1800);
            }

            animationPopup.Dismiss();
            await Task.Delay(200); 


            backgroundView.RemoveFromSuperview();
        }
Ejemplo n.º 3
0
        private async void B_Clicked(object sender, EventArgs e)
        {
            await PreBumpWork();

            Device.BeginInvokeOnMainThread(() => {
                loadPop.Dismiss();
                loadPop.IsOpen    = false;
                loadPop.IsVisible = false;
            });
        }
Ejemplo n.º 4
0
 private void Messages_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
 {
     if (attachmentPopup.IsOpen)
     {
         attachmentPopup.Dismiss();
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Action to be performed when decline button is clicked.
 /// </summary>
 /// <param name="popupObject">Popup's object in view</param>
 private void OnDeclineButtonClicked(SfPopupLayout popupObject)
 {
     if (popupObject != null)
     {
         popupObject.Dismiss();
     }
 }
        public void Purchase_Ride_Credits()
        {
            RhodeITService rhodeITServices = new RhodeITService();
            RhodeITDB      db     = new RhodeITDB();
            IUserDialogs   dialog = UserDialogs.Instance;

            dialog.ShowLoading("Purchasing Ride Credits...");
            try
            {
                bool result = int.TryParse(amount.Text, out int rideCredit);
                if (!result)
                {
                    throw new InvalidNumberException("Invalid");
                }
                try
                {
                    if (rideCredit <= 0)
                    {
                        throw new InvalidNumberException("");
                    }
                    else
                    {
                        Details = db.GetUserDetails();
                        rhodeITServices.UpdateCreditRequestAsync(Details.Ethereum_Address, rideCredit).ConfigureAwait(false);
                        Details.RideCredits += rideCredit;
                        RhodesDataBase.ChargeUserRideCreditBalanceToAccount(Details).ConfigureAwait(false);
                        db.UpdateLoginDetails(Details);
                        dialog.HideLoading();
                        dialog.Alert(string.Format("Succesfully recharged ride credits with {0}", rideCredit), "Success", "OK");
                    }
                }
                catch (Exception e)
                {
                    dialog.HideLoading();
                    PopupLayout.Dismiss();
                    Console.WriteLine("Error whilst purcasing credits: " + e.Message);
                    dialog.Alert("Something went wrong whilst purchasing credit", "Insufficient Funds", "OK");
                }
            }
            catch (InvalidNumberException e)
            {
                dialog.HideLoading();
                PopupLayout.Dismiss();
                Console.WriteLine("Error whilst purcasing credits: " + e.Message);
                dialog.Alert("Please ensure you entered a valid number e.g. 12", "Invalid Number", "OK");
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Action to be performed when accept button is clicked.
        /// </summary>
        /// <param name="popupObject">Popup's object in view</param>
        private async void OnAcceptButtonClicked(SfPopupLayout popupObject)
        {
            if (popupObject != null)
            {
                popupObject.Dismiss();
            }

            await Task.Delay(200);

            ((popupObject.Parent as NavigationPage).CurrentPage.Resources["BookingDialog"] as SfPopupLayout).Show();
        }
Ejemplo n.º 8
0
        private void ShowEditor(FileManager item)
        {
            var textEditPopup = new SfPopupLayout()
            {
                IsOpen = true
            };

            textEditPopup.PopupView.AutoSizeMode = AutoSizeMode.Height;
            textEditPopup.PopupView.ShowHeader   = false;
            textEditPopup.PopupView.ShowFooter   = false;
            var editor = new Editor()
            {
                Text = item.ItemName
            };

            textEditPopup.PopupView.ContentTemplate = new DataTemplate(() => { return(editor); });
            editor.Completed += (sender, args) =>
            {
                item.ItemName = editor.Text;
                textEditPopup.Dismiss();
            };
        }
Ejemplo n.º 9
0
        private Task PreBumpWork()
        {
            return(Task.Factory.StartNew(() =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    bumpPop.Dismiss();
                    DataTemplate loadView = new DataTemplate(() =>
                    {
                        SfBusyIndicator busy = new SfBusyIndicator();
                        busy.IsBusy = true;
                        return busy;
                    });
                    loadPop.PopupView.ContentTemplate = loadView;
                    loadPop.PopupView.ShowFooter = false;
                    loadPop.PopupView.ShowHeader = false;
                    loadPop.ClosePopupOnBackButtonPressed = false;
                    loadPop.Show();
                });

                if (String.IsNullOrEmpty((string)gradeSel.SelectedValue) || String.IsNullOrWhiteSpace((string)gradeSel.SelectedValue))
                {
                    Device.BeginInvokeOnMainThread(() => {
                        gradeSel.Watermark = "Please select a grade";
                        loadPop.Dismiss();
                        bumpPop.Show();
                    });
                }
                else
                {
                    string grade = (string)gradeSel.SelectedValue;

                    Task.Run(async() => await BumpGrade(grade));
                }
            }));
        }
        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);
        }
Ejemplo n.º 11
0
 private void CancelButton_Click(object sender, EventArgs e)
 {
     termsAndConditionsPopup.Dismiss();
 }
Ejemplo n.º 12
0
 private void BackButton_Clicked(object sender, EventArgs e)
 {
     popup.Dismiss();
 }
Ejemplo n.º 13
0
 private void TreeView_ItemTapped(object sender, Syncfusion.XForms.TreeView.ItemTappedEventArgs e)
 {
     popupLayout.Dismiss();
 }