Press on the image to return to the main documentation page.
LabelExtras
Written by Martin Pearman
LabelExtras enables you to apply click listeners to sub-strings of a Label text. A click on a sub-string raises an event and you can take whatever action you desire on such a click.
Initialize the ClickableSpan. Color defines the color of the clickable text, pass -1 if you do not wish to change that text color. UnderlineText defines whether the clickable text shall be underlined. The Click(SelectionStart As Int, SelectionEnd As Int) event will be raised when this ClickableSpan is clicked.
Initialize the ClickableSpan. Color defines the color of the clickable text, pass -1 if you do not wish to change that text color. UnderlineText defines whether the clickable text shall be underlined. Pass any Object as the Tag and this Object will be returned to the Click2 event. The Click2(SelectionStart As Int, SelectionEnd As Int, Tag As Object) event will be raised when this ClickableSpan is clicked.
Returns displayable styled text from the provided HTML string. Using optional ImageGetter (to handle HTML IMG tags in the String) and TagHandler (to handle unrecognised tags in the String) callbacks. The drawable returned by the ImageGetter sub has to be sized with setBounds.
Sets the movement method (arrow key handler) to be used for this TextView. To enable the LabelExtras click functionality you must set your Label movement method to an instance of LinkMovementMethod. The LinkMovementMethod.GetInstance method returns the instance required.
Initialize the SpannableStringBuilder with a CharSequence. A CharSequence can be obtained using the Html.FromHtml method, a String can also be passed as a CharacterSequence.
Constant which can be passed as the SpannableStringBuilder.SetSpan method Flags parameter. Spans of type SPAN_EXCLUSIVE_EXCLUSIVE do not expand to include text inserted at either their starting or ending point.
SPAN_EXCLUSIVE_INCLUSIVEAsInt
Constant which can be passed as the SpannableStringBuilder.SetSpan method Flags parameter. Non-0-length spans of type SPAN_EXCLUSIVE_INCLUSIVE expand to include text inserted at their ending point but not at their starting point.
SPAN_INCLUSIVE_EXCLUSIVEAsInt
Constant which can be passed as the SpannableStringBuilder.SetSpan method Flags parameter. Non-0-length spans of type SPAN_INCLUSIVE_EXCLUSIVE expand to include text inserted at their starting point but not at their ending point.
SPAN_INCLUSIVE_INCLUSIVEAsInt
Constant which can be passed as the SpannableStringBuilder.SetSpan method Flags parameter. Spans of type SPAN_INCLUSIVE_INCLUSIVE expand to include text inserted at either their starting or ending point.