private void ReadMask(IGradientControl view, TypedArray typedArray) { var maskShape = (MaskShape)typedArray.GetInt(Resource.Styleable.GradientView_maskShape, 0); GradientMask mask = maskShape switch { MaskShape.Rectangle => new RectangleMask { Size = GetSize(typedArray), Corners = GetCorners(typedArray) }, MaskShape.Ellipse => new EllipseMask { Size = GetSize(typedArray) }, MaskShape.Path => new PathMask(typedArray.GetString(Resource.Styleable.GradientView_maskData)), _ => null }; if (mask != null) { mask.Stretch = (Stretch)typedArray.GetInt(Resource.Styleable.GradientView_maskStretch, 0); view.Mask = mask; } }
protected void FillValues(GradientMask mask) { mask.ClipMode = ClipMode; mask.Stretch = Stretch; }