Exemplo n.º 1
0
        void UpdateEffectColor()
        {
            var color = VisualFeedbackEffect.GetFeedbackColor(Element);

            alpha = color.A < 1.0f ? 1f : 0.1f;
            layer.BackgroundColor = color.ToUIColor();
        }
Exemplo n.º 2
0
        void UpdateEffectColor()
        {
            var color = VisualFeedbackEffect.GetFeedbackColor(Element);

            var nativeColor = color.ToAndroid();

            nativeColor.A = 80;

            ripple?.SetColor(GetPressedColorSelector(nativeColor));
        }
Exemplo n.º 3
0
        public MaterialTabViewItemTemplate()
        {
            visualFeedback = new VisualFeedbackEffect();
            Effects.Add(visualFeedback);

            RowSpacing = 0;

            HorizontalOptions = LayoutOptions.FillAndExpand;
            VerticalOptions   = LayoutOptions.FillAndExpand;

            RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Star
            });
            RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });

            icon = new Image
            {
                Aspect            = Aspect.AspectFit,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = new Thickness(0, 6)
            };

            text = new Label
            {
                FontSize          = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                FontAttributes    = FontAttributes.Bold,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = new Thickness(0, 6)
            };

            badge = new TabBadgeView
            {
                PlacementTarget = icon,
                Margin          = new Thickness(0)
            };

            Children.Add(icon);
            Children.Add(text);
            Children.Add(badge);

            SetRow(icon, 0);
            SetRow(text, 1);
            SetRow(badge, 0);
            SetRowSpan(badge, 2);
        }
Exemplo n.º 4
0
        public CupertinoTabViewItemTemplate()
        {
            visualFeedback = new VisualFeedbackEffect();
            Effects.Add(visualFeedback);

            RowSpacing = 0;

            HorizontalOptions = LayoutOptions.FillAndExpand;
            VerticalOptions   = LayoutOptions.FillAndExpand;

            RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Star
            });
            RowDefinitions.Add(new RowDefinition {
                Height = GridLength.Auto
            });

            icon = new Image
            {
                Aspect            = Aspect.AspectFit,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = new Thickness(0, 6)
            };

            text = new Label
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Margin            = new Thickness(0, 6)
            };

            badge = new TabBadgeView
            {
                PlacementTarget = icon,
                Margin          = new Thickness(0)
            };

            Children.Add(icon);
            Children.Add(text);
            Children.Add(badge);

            SetRow(icon, 0);
            SetRow(text, 1);
            SetRow(badge, 0);
            SetRowSpan(badge, 2);
        }
Exemplo n.º 5
0
        protected override void OnParentSet()
        {
            base.OnParentSet();

            BindingContext = Parent;

            icon.SetBinding(Image.SourceProperty, "CurrentIcon");

            text.SetBinding(Label.TextProperty, "Text");
            text.SetBinding(Label.TextColorProperty, "CurrentTextColor");
            text.SetBinding(Label.FontSizeProperty, "CurrentFontSize");
            text.SetBinding(Label.FontAttributesProperty, "CurrentFontAttributes");

            badge.SetBinding(TabBadgeView.BackgroundColorProperty, "CurrentBadgeBackgroundColor");
            badge.SetBinding(TabBadgeView.BorderColorProperty, "CurrentBadgeBorderColor");
            badge.SetBinding(TabBadgeView.TextProperty, "BadgeText");
            badge.SetBinding(TabBadgeView.TextColorProperty, "BadgeTextColor");

            VisualFeedbackEffect.SetFeedbackColor(this, Color.White);
        }
Exemplo n.º 6
0
        protected override void OnParentSet()
        {
            base.OnParentSet();

            BindingContext = Parent;

            icon.SetBinding(Image.SourceProperty, "CurrentIcon");

            text.SetBinding(Label.TextProperty, "Text", BindingMode.OneWay, new TextCaseConverter {
                Type = TextCaseType.Upper
            });
            text.SetBinding(Label.TextColorProperty, "CurrentTextColor");
            text.SetBinding(Label.FontSizeProperty, "CurrentFontSize");
            text.SetBinding(Label.FontAttributesProperty, "CurrentFontAttributes");
            text.SetBinding(Label.FontFamilyProperty, "CurrentFontFamily");

            badge.SetBinding(TabBadgeView.BackgroundColorProperty, "CurrentBadgeBackgroundColor");
            badge.SetBinding(TabBadgeView.TextProperty, "BadgeText");
            badge.SetBinding(TabBadgeView.TextColorProperty, "BadgeTextColor");

            VisualFeedbackEffect.SetFeedbackColor(this, Color.White);
        }