コード例 #1
0
        protected virtual void ApplyTheme()
        {
            if (Element.BorderColor.IsDefault)
            {
                CardThemer.ApplyScheme(_cardScheme, this);
            }
            else
            {
                CardThemer.ApplyOutlinedVariant(_cardScheme, this);
            }

            // a special case for no shadow
            if (!Element.HasShadow)
            {
                SetShadowElevation(0, UIControlState.Normal);
            }

            // this is set in the theme, so we must always disable it
            Interactable = false;
        }
コード例 #2
0
        protected virtual void ApplyTheme()
        {
            UpdateCornerRadius();
            UpdateBorderColor();
            UpdateBackgroundColor();

            if (Element.BorderColor.IsDefault)
            {
                CardThemer.ApplyScheme(_cardScheme, this);
            }
            else
            {
                CardThemer.ApplyOutlinedVariant(_cardScheme, this);
            }

            // a special case for no shadow
            if (!Element.HasShadow)
            {
                SetShadowElevation(0, UIControlState.Normal);
            }

            if (Element.GestureRecognizers != null && Element.GestureRecognizers.Any())
            {
                Interactable = true;

                // disable ink (ripple) and elevation effect while tapped
                InkView.Hidden = true;
                if (Element.HasShadow)
                {
                    SetShadowElevation(1f, UIControlState.Highlighted);
                }
            }
            else
            {
                // this is set in the theme, so we must always disable it
                Interactable = false;
            }
        }