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();
     }
 }
Example #2
0
 private void UpdatePressedColor(Xamarin.Forms.Color pressedColor)
 {
     if (pressedColor.IsDefault)
     {
         _pressedColor = _normalColor.IsColorDark() ? Color.ParseColor("#52FFFFFF") : Color.ParseColor("#52000000");
     }
     else
     {
         _pressedColor = pressedColor.ToAndroid();
     }
 }
Example #3
0
 private void UpdateDisabledColor(Xamarin.Forms.Color disabledColor)
 {
     if (disabledColor.IsDefault)
     {
         _disabledColor = _normalColor.GetDisabledColor();
     }
     else
     {
         _disabledColor = disabledColor.ToAndroid();
     }
 }
 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());
 }