Example #1
0
        public void SetStyle( )
        {
            // setup the text fonts and colors
            StatusLabel.SetFont(ControlStylingConfig.Font_Bold, 24);
            StatusLabel.TextColor = ControlStylingConfig.TextField_ActiveTextColor;

            ResultSymbol.SetFont(PrivateControlStylingConfig.Icon_Font_Secondary, 64);
            ResultSymbol.TextColor = ControlStylingConfig.TextField_PlaceholderTextColor;

            ResultCircle.BackgroundColor = ControlStylingConfig.BG_Layer_Color;

            ResultLabel.SetFont(ControlStylingConfig.Font_Light, 14);
            ResultLabel.TextColor = ControlStylingConfig.TextField_PlaceholderTextColor;

            DoneButton.SetFont(ControlStylingConfig.Font_Regular, 14);
            DoneButton.TextColor       = ControlStylingConfig.Button_TextColor;
            DoneButton.BackgroundColor = ControlStylingConfig.Button_BGColor;

            // setup the background layer colors
            //ResultBackground.BackgroundColor = ControlStylingConfig.BG_Layer_Color;
            //ResultBackground.BorderColor = ControlStylingConfig.BG_Layer_BorderColor;

            //StatusBackground.BackgroundColor = layerBgColor;
            //StatusBackground.BorderColor = layerBorderColor;

            View.BackgroundColor = ControlStylingConfig.BackgroundColor;

            DoneButton.CornerRadius = 4;
        }
Example #2
0
        public UIResultView(object parentView, RectangleF frame, DoneClickDelegate onClick)
        {
            View = PlatformView.Create( );
            View.AddAsSubview(parentView);
            View.UserInteractionEnabled = false;

            StatusLabel = PlatformLabel.Create( );
            //StatusBackground = PlatformView.Create( );

            ResultSymbol = PlatformLabel.Create( );
            ResultLabel  = PlatformLabel.Create( );
            //ResultBackground = PlatformView.Create( );


            ResultCircle = PlatformCircleView.Create( );
            ResultCircle.AddAsSubview(parentView);


            // setup our UI hierarchy
            //StatusBackground.AddAsSubview( parentView );
            //StatusBackground.UserInteractionEnabled = false;
            //StatusBackground.BorderWidth = .5f;

            StatusLabel.AddAsSubview(parentView);
            StatusLabel.UserInteractionEnabled = false;


            //ResultBackground.AddAsSubview( parentView );
            //ResultBackground.UserInteractionEnabled = false;
            //ResultBackground.BorderWidth = .5f;

            ResultSymbol.AddAsSubview(parentView);
            ResultSymbol.UserInteractionEnabled = false;

            ResultLabel.AddAsSubview(parentView);
            ResultLabel.UserInteractionEnabled = false;

            DoneButton = PlatformButton.Create( );
            DoneButton.AddAsSubview(parentView);
            DoneButton.ClickEvent = ( PlatformButton button ) =>
            {
                if (onClick != null)
                {
                    onClick( );
                }
            };


            // default the view size and opacity
            SetOpacity(0.00f);

            SetBounds(frame);

            // give it a default style
            SetStyle( );
        }
Example #3
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = InputState != null?InputState.GetHashCode() : 0;

                hashCode = (hashCode * 397) ^ (InputSymbol != null ? InputSymbol.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ResultState != null ? ResultState.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (ResultSymbol != null ? ResultSymbol.GetHashCode() : 0);
                hashCode = (hashCode * 397) ^ (int)MovementDirection;
                return(hashCode);
            }
        }
Example #4
0
        public void Show(string statusLabel, string resultSymbol, string resultLabel, string buttonLabel)
        {
            SetHidden(false);

            // set and position the status label

            /*if ( string.IsNullOrEmpty( statusLabel ) == false )
             * {
             *  StatusBackground.Hidden = false;
             * }
             * else
             * {
             *  StatusBackground.Hidden = true;
             * }*/
            StatusLabel.Text = statusLabel;
            StatusLabel.SizeToFit( );


            // set the result symbol
            ResultSymbol.Text = resultSymbol;
            ResultSymbol.SizeToFit( );


            // set the result text

            /*if ( string.IsNullOrEmpty( resultLabel ) == false )
             * {
             *  ResultBackground.Hidden = false;
             * }
             * else
             * {
             *  ResultBackground.Hidden = true;
             * }*/
            ResultLabel.Text = resultLabel;

            // set the done button
            if (string.IsNullOrEmpty(buttonLabel) == false)
            {
                DoneButton.Hidden = false;
            }
            else
            {
                DoneButton.Hidden = true;
            }
            DoneButton.Text = buttonLabel;
            DoneButton.SizeToFit( );

            SetOpacity(1.00f);

            SetBounds(View.Bounds);
        }
Example #5
0
        public void SetBounds(RectangleF containerBounds)
        {
            View.Bounds = containerBounds;

            // setup the background layers

            /*StatusBackground.Frame = new RectangleF( View.Frame.X,
             *  View.Frame.Top + Rock.Mobile.Graphics.Util.UnitToPx( 10 ),
             *  View.Frame.Width,
             *  Rock.Mobile.Graphics.Util.UnitToPx( 44 ) );*/

            /*ResultBackground.Frame = new RectangleF( View.Frame.X,
             *  View.Frame.Height / 3,
             *  View.Frame.Width,
             *  Rock.Mobile.Graphics.Util.UnitToPx( 150 ) );*/


            // and the labels
            StatusLabel.Frame = new RectangleF(0, 0, View.Frame.Width - Rock.Mobile.Graphics.Util.UnitToPx(40), 0);
            StatusLabel.SizeToFit( );
            StatusLabel.Frame = new RectangleF((View.Frame.Width - StatusLabel.Frame.Width) / 2,
                                               View.Frame.Top + Rock.Mobile.Graphics.Util.UnitToPx(10),
                                               StatusLabel.Frame.Width,
                                               StatusLabel.Frame.Height);

            ResultSymbol.Frame = new RectangleF(0, 0, View.Frame.Width - Rock.Mobile.Graphics.Util.UnitToPx(40), 0);
            ResultSymbol.SizeToFit( );

            float circleWidth = ResultSymbol.Frame.Width * 1.25f;

            ResultCircle.Frame = new RectangleF((View.Frame.Width - circleWidth) / 2, Rock.Mobile.Graphics.Util.UnitToPx(140), circleWidth, circleWidth);

            ResultSymbol.Frame = new RectangleF(ResultCircle.Frame.X + (ResultCircle.Frame.Width - ResultSymbol.Frame.Width) / 2,
                                                ResultCircle.Frame.Y + (ResultCircle.Frame.Height - ResultSymbol.Frame.Height) / 2,
                                                ResultSymbol.Frame.Width,
                                                ResultSymbol.Frame.Height);


            ResultLabel.Frame = new RectangleF(0, 0, View.Frame.Width - Rock.Mobile.Graphics.Util.UnitToPx(40), 0);
            ResultLabel.SizeToFit( );
            ResultLabel.Frame = new RectangleF((View.Frame.Width - ResultLabel.Frame.Width) / 2, ResultCircle.Frame.Bottom + Rock.Mobile.Graphics.Util.UnitToPx(5), ResultLabel.Frame.Width, ResultLabel.Frame.Height);

            // lastly the button
            float doneWidth = Rock.Mobile.Graphics.Util.UnitToPx(122);

            DoneButton.Frame = new RectangleF((View.Frame.Width - doneWidth) / 2, ResultLabel.Frame.Bottom + Rock.Mobile.Graphics.Util.UnitToPx(10), doneWidth, DoneButton.Frame.Height);
        }
Example #6
0
                public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
                {
                    if (container == null)
                    {
                        // Currently in a layout without a container, so no reason to create our view.
                        return(null);
                    }

                    View view = inflater.Inflate(Resource.Layout.Prayer_Primary, container, false);

                    view.SetOnTouchListener(this);

                    view.SetBackgroundColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.BackgroundColor));

                    ActivityIndicator            = (ProgressBar)view.FindViewById <ProgressBar>(Resource.Id.prayer_primary_activityIndicator);
                    ActivityIndicator.Visibility = ViewStates.Invisible;

                    // create the carousel
                    float prayerRegionHeight = GetPrayerRegionHeight( );

                    float cardWidth  = GetCardWidth( );
                    float cardHeight = GetCardHeight( );

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    float cardYOffset = (prayerRegionHeight - cardHeight) / 2;

                    PrayerCardSize = new RectangleF(0, 0, cardWidth, cardHeight);

                    // setup the card positions to be to the offscreen to the left, centered on screen, and offscreen to the right
                    Carousel = PlatformCardCarousel.Create(view, cardWidth, cardHeight, new RectangleF(0, cardYOffset, NavbarFragment.GetCurrentContainerDisplayWidth( ), prayerRegionHeight), PrivatePrayerConfig.Card_AnimationDuration);


                    // setup our error UI
                    StatusLayer = view.FindViewById <View>(Resource.Id.status_background);
                    ControlStyling.StyleBGLayer(StatusLayer);

                    StatusText = StatusLayer.FindViewById <TextView>(Resource.Id.text);
                    ControlStyling.StyleUILabel(StatusText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize);

                    ResultLayer = view.FindViewById <View>(Resource.Id.result_background);
                    ControlStyling.StyleBGLayer(ResultLayer);

                    ResultSymbol = ResultLayer.FindViewById <TextView>(Resource.Id.resultSymbol);
                    ResultSymbol.SetTypeface(FontManager.Instance.GetFont(PrivateControlStylingConfig.Icon_Font_Secondary), TypefaceStyle.Normal);
                    ResultSymbol.SetTextSize(ComplexUnitType.Dip, PrivatePrayerConfig.PostPrayer_ResultSymbolSize_Droid);
                    ResultSymbol.SetTextColor(Rock.Mobile.UI.Util.GetUIColor(ControlStylingConfig.TextField_ActiveTextColor));
                    ResultSymbol.Text = PrivateControlStylingConfig.Result_Symbol_Failed;

                    ResultText = ResultLayer.FindViewById <TextView>(Resource.Id.text);
                    ControlStyling.StyleUILabel(ResultText, ControlStylingConfig.Font_Regular, ControlStylingConfig.Large_FontSize);

                    RetryButton = view.FindViewById <Button>(Resource.Id.retryButton);
                    ControlStyling.StyleButton(RetryButton, GeneralStrings.Retry, ControlStylingConfig.Font_Regular, ControlStylingConfig.Large_FontSize);

                    RetryButton.Click += (object sender, EventArgs e) =>
                    {
                        if (IsRequesting == false)
                        {
                            DownloadPrayers( );
                        }
                    };

                    return(view);
                }