예제 #1
0
 private void UpdatePressedColor(Xamarin.Forms.Color pressedColor)
 {
     if (pressedColor.IsDefault)
     {
         _pressedColor = _normalColor.IsColorDark() ? Color.ParseColor("#52FFFFFF") : Color.ParseColor("#52000000");
     }
     else
     {
         _pressedColor = pressedColor.ToAndroid();
     }
 }
예제 #2
0
 private void UpdateDisabledColor(Xamarin.Forms.Color disabledColor)
 {
     if (disabledColor.IsDefault)
     {
         _disabledColor = _normalColor.GetDisabledColor();
     }
     else
     {
         _disabledColor = disabledColor.ToAndroid();
     }
 }
예제 #3
0
 private void UpdateBitmap(IconView previous = null)
 {
     if (!_isDisposed && !string.IsNullOrWhiteSpace(Element.Source))
     {
         var d     = Resources.GetDrawable(Element.Source).Mutate();
         var color = GetColor(Element.Foreground);
         Xamarin.Forms.Color col = (Xamarin.Forms.Color)Element.Foreground;
         d.SetColorFilter(new LightingColorFilter(col.ToAndroid(), col.ToAndroid()));
         d.Alpha = col.ToAndroid().A;
         Control.SetImageDrawable(d);
         ((IVisualElementController)Element).NativeSizeChanged();
     }
 }
예제 #4
0
        private void UpdateRipple()
        {
            if (_effect.IsDisabled)
            {
                return;
            }

            if (_effect.NativeAnimationColor == _rippleColor && _effect.NativeAnimationRadius == _rippleRadius)
            {
                return;
            }
            _rippleColor  = _effect.NativeAnimationColor;
            _rippleRadius = _effect.NativeAnimationRadius;
            _ripple.SetColor(GetColorStateList());
            _ripple.Radius = (int)(View.Context.Resources.DisplayMetrics.Density * _effect.NativeAnimationRadius);
        }
예제 #5
0
        private void UpdateRipple()
        {
            if (_effect?.IsDisabled ?? true)
            {
                return;
            }

            if (_effect.NativeAnimationColor == _rippleColor && _effect.NativeAnimationRadius == _rippleRadius)
            {
                return;
            }
            _rippleColor  = _effect.NativeAnimationColor;
            _rippleRadius = _effect.NativeAnimationRadius;
            _ripple.SetColor(GetColorStateList());
            if (AndroidOS.Build.VERSION.SdkInt >= AndroidOS.BuildVersionCodes.M)
            {
                _ripple.Radius = (int)(View.Context.Resources.DisplayMetrics.Density * _effect.NativeAnimationRadius);
            }
        }
 private void UpdateBarBackgroundColor(Xamarin.Forms.Color color)
 {
     Toolbar.BackgroundTintMode = null;
     Toolbar.BackgroundTintList = null;
     Toolbar.SetBackgroundColor(color.ToAndroid());
 }
 private void UpdateBarTitleColor(Xamarin.Forms.Color color)
 {
     TextViewTitle.SetTextColor(color.ToAndroid());
 }