Highlights.Builder.AddRange(Paint, Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add single range highlight.
[Android.Runtime.Register("addRange", "(Landroid/graphics/Paint;II)Landroid/text/Highlights$Builder;", "", ApiSince=34)]
public Android.Text.Highlights.Builder AddRange(Android.Graphics.Paint paint, int start, int end);
[<Android.Runtime.Register("addRange", "(Landroid/graphics/Paint;II)Landroid/text/Highlights$Builder;", "", ApiSince=34)>]
member this.AddRange : Android.Graphics.Paint * int * int -> Android.Text.Highlights.Builder
Parameters
- paint
- Paint
a paint object used for drawing highlight path.
- start
- Int32
an inclusive offset of the text.
- end
- Int32
an exclusive offset of the text.
Returns
this builder instance.
- Attributes
Remarks
Add single range highlight. The TextView and underlying Layout draws highlight in the order of the addRange(Paint, int, int) calls. For example, the following code draws (1, 2) with red and (2, 5) with blue. val redPaint = Paint().apply { color = Color.RED } val bluePaint = Paint().apply { color = Color.BLUE } val highlight = Highlights.Builder().addRange(redPaint, 1, 4).addRange(bluePaint, 2, 5).build()
Android reference for android.text.Highlights.Builder.addRange.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.