Exemplo n.º 1
0
        void ReleaseDesignerOutlets()
        {
            if (DismissButton != null)
            {
                DismissButton.Dispose();
                DismissButton = null;
            }

            if (MainContainer != null)
            {
                MainContainer.Dispose();
                MainContainer = null;
            }

            if (RateButton != null)
            {
                RateButton.Dispose();
                RateButton = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }
        }
Exemplo n.º 2
0
        public dynamic SelectNextButton()
        {
            dynamic page;
            string  currentUrl = WebDriver.Url;

            NextButton.ScrollIntoViewBottom();
            WaitForElementClickable(_btnNext);
            NextButton.ClickWithJS();
            if (IsElementDisplayed(_eleWarningBar, 3))
            {
                GetLastNode().Info("Closing warning bar");
                DismissButton.ClickWithJS();
                WaitForElementInvisible(_eleWarningBar);
                NextButton.ClickWithJS();
            }
            WaitForUrlChanged(currentUrl);
            if (WebDriver.Url.Contains("vehicle-suggestions"))
            {
                page = new VehicleSuggestionsPage();
            }
            else
            {
                page = new VehicleEntryPage();
            }
            page.WaitForPageLoad();
            return(page);
        }
Exemplo n.º 3
0
 void SetStyles()
 {
     View.BackgroundColor          = AppColors.PageBackground;
     MainContainer.BackgroundColor = AppColors.GrayBackground;
     TableView.BackgroundColor     = AppColors.GrayBackground;
     RateButton.StyleStandardButton();
     DismissButton.StyleFlatButton();
     RateButton.SetTitle("RATE US ON GOOGLE PLAY", UIControlState.Normal);
     DismissButton.SetTitle("DISMISS", UIControlState.Normal);
 }
Exemplo n.º 4
0
        void ReleaseDesignerOutlets()
        {
            if (DismissButton != null)
            {
                DismissButton.Dispose();
                DismissButton = null;
            }

            if (TimerLabel != null)
            {
                TimerLabel.Dispose();
                TimerLabel = null;
            }
        }
Exemplo n.º 5
0
        void ReleaseDesignerOutlets()
        {
            if (DismissButton != null)
            {
                DismissButton.Dispose();
                DismissButton = null;
            }

            if (MessageLb != null)
            {
                MessageLb.Dispose();
                MessageLb = null;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Shows the notification.
        /// </summary>
        /// <param name="notification">The notification.</param>
        public void ShowNotification(Rest.Notification notification)
        {
            Notification = notification;

            //
            // If no notification, then clear the notification view immediately.
            //
            if (notification == null)
            {
                ContainerView.ClearAnimation();
                ContainerView.Visibility   = ViewStates.Invisible;
                ContainerView.TranslationY = Utility.DipToPixel(-120);

                DismissButton.Focusable = false;
                DismissButton.ClearFocus();

                return;
            }

            MessageView.Text = notification.Message;

            if (notification.Image != null)
            {
                Task.Run(async() =>
                {
                    Bitmap image;

                    try
                    {
                        image = await Utility.LoadImageFromUrlAsync(Crex.Application.Current.GetAbsoluteUrl(notification.Image.BestMatch));
                    }
                    catch
                    {
                        image = null;
                    }

                    Post(() =>
                    {
                        ImageView.SetImageBitmap(image);
                        ShowCurrentNotification();
                    });
                });
            }
            else
            {
                ImageView.SetImageBitmap(null);
                ShowCurrentNotification();
            }
        }
        protected override void ConstrainChildren()
        {
            MessageLabel.SafeTrailingAnchor().ConstraintEqualTo(DismissButton.SafeLeadingAnchor(), -Toast.Layout.Spacing).Active = true;
            MessageLabel.SafeLeadingAnchor().ConstraintEqualTo(this.SafeLeadingAnchor(), Toast.Layout.PaddingLeading).Active     = true;
            MessageLabel.SafeBottomAnchor().ConstraintEqualTo(this.SafeBottomAnchor(), -Toast.Layout.PaddingBottom).Active       = true;
            MessageLabel.SafeTopAnchor().ConstraintEqualTo(this.SafeTopAnchor(), Toast.Layout.PaddingTop).Active = true;

            DismissButton.SafeTrailingAnchor().ConstraintEqualTo(this.SafeTrailingAnchor(), -Toast.Layout.PaddingTrailing).Active = true;
            DismissButton.SafeCenterYAnchor().ConstraintEqualTo(this.SafeCenterYAnchor()).Active = true;
            // The following constraint makes sure that button is not wider than specified amount of available width
            DismissButton.SafeWidthAnchor().ConstraintLessThanOrEqualTo(this.SafeWidthAnchor(), DismissButtonMaxWidth, 0f).Active = true;

            DismissButton.SetContentCompressionResistancePriority(
                MessageLabel.ContentCompressionResistancePriority(UILayoutConstraintAxis.Horizontal) + 1,
                UILayoutConstraintAxis.Horizontal);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Hides the current notification.
        /// </summary>
        private void HideCurrentNotification()
        {
            var animation = ObjectAnimator.OfFloat(ContainerView, "translationY", Utility.DipToPixel(-120));

            animation.SetDuration(Crex.Application.Current.Config.AnimationTime.Value);
            animation.AnimationEnd += (sender, args) =>
            {
                ContainerView.Visibility = ViewStates.Invisible;
                NotificationWasDismissed?.Invoke(this, new EventArgs());
            };

            ContainerView.ClearAnimation();
            DismissButton.ClearFocus();
            DismissButton.Focusable = false;

            animation.Start();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Look for a descendant to call <c><see cref="M:Android.Views.View.RequestFocus" /></c> on.
        /// </summary>
        /// <param name="direction">One of FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, and FOCUS_RIGHT</param>
        /// <param name="previouslyFocusedRect">The rectangle (in this View's coordinate system)
        /// to give a finer grained hint about where focus is coming from.  May be null
        /// if there is no hint.</param>
        /// <returns>true to indicate the event has been handled.</returns>
        protected override bool OnRequestFocusInDescendants(int direction, Rect previouslyFocusedRect)
        {
            DismissButton.RequestFocus();

            return(true);
        }
Exemplo n.º 10
0
        void ReleaseDesignerOutlets()
        {
            if (CtaButton != null)
            {
                CtaButton.Dispose();
                CtaButton = null;
            }

            if (CtaDescription != null)
            {
                CtaDescription.Dispose();
                CtaDescription = null;
            }

            if (CtaTitle != null)
            {
                CtaTitle.Dispose();
                CtaTitle = null;
            }

            if (CtaView != null)
            {
                CtaView.Dispose();
                CtaView = null;
            }

            if (CtaViewToTopConstraint != null)
            {
                CtaViewToTopConstraint.Dispose();
                CtaViewToTopConstraint = null;
            }

            if (DismissButton != null)
            {
                DismissButton.Dispose();
                DismissButton = null;
            }

            if (NotReallyLabel != null)
            {
                NotReallyLabel.Dispose();
                NotReallyLabel = null;
            }

            if (NotReallyView != null)
            {
                NotReallyView.Dispose();
                NotReallyView = null;
            }

            if (QuestionView != null)
            {
                QuestionView.Dispose();
                QuestionView = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }

            if (YesLabel != null)
            {
                YesLabel.Dispose();
                YesLabel = null;
            }

            if (YesView != null)
            {
                YesView.Dispose();
                YesView = null;
            }

            if (CtaViewBottomConstraint != null)
            {
                CtaViewBottomConstraint.Dispose();
                CtaViewBottomConstraint = null;
            }

            if (QuestionViewBottomConstraint != null)
            {
                QuestionViewBottomConstraint.Dispose();
                QuestionViewBottomConstraint = null;
            }
        }