void UpdateToolbarTextColor(AppCompatTextView textView, Xamarin.Forms.Color?titleColor, ColorStateList defaultColorStateList) { if (titleColor != null) { textView.SetTextColor(titleColor?.ToAndroid() ?? Android.Graphics.Color.White); } else { textView.SetTextColor(defaultColorStateList); } }
void UpdateToolbarTextColor(AppCompatTextView textView, Xamarin.Forms.Color?titleColor, ColorStateList defaultColorStateList) { if (titleColor != null) { textView.SetTextColor(titleColor?.ToAndroid() ?? Android.Graphics.Color.White); } else { try { textView.SetTextColor(defaultColorStateList); //MLKL } catch (Java.Lang.Exception ex) { } } }
Drawable CreateShape(ShapeType type, int strokeWidth, int cornerRadius, Xamarin.Forms.Color?fillColor, Xamarin.Forms.Color?strokeColor) { GradientDrawable shape = new GradientDrawable(); shape.SetShape(type); if (fillColor != null) { shape.SetColor(fillColor?.ToAndroid() ?? Xamarin.Forms.Color.Transparent.ToAndroid()); } if (strokeColor != null) { shape.SetStroke(strokeWidth, strokeColor?.ToAndroid() ?? Xamarin.Forms.Color.Transparent.ToAndroid()); } shape.SetCornerRadius(cornerRadius); return(shape); }