コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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)
         {
         }
     }
 }
コード例 #3
0
        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);
        }