Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

Builder

class Builder
kotlin.Any
   ↳ androidx.textclassifier.TextClassificationContext.Builder

A builder for building a TextClassification context.

Summary

Public constructors
<init>(@NonNull packageName: String, @NonNull widgetType: String)

Initializes a new builder for text classification context objects.

Public methods
TextClassificationContext

Builds the text classification context object.

TextClassificationContext.Builder!
setWidgetVersion(@Nullable widgetVersion: String?)

Sets an optional custom version string for the widget type.

Public constructors

<init>

Builder(@NonNull packageName: String, @NonNull widgetType: String)

Initializes a new builder for text classification context objects.

Parameters
packageName String: the name of the calling package
widgetType String: the type of widget e.g. TextClassifier#WIDGET_TYPE_TEXTVIEW
Return
this builder

Public methods

build

@NonNull fun build(): TextClassificationContext

Builds the text classification context object.

Return
TextClassificationContext: the built TextClassificationContext object

setWidgetVersion

fun setWidgetVersion(@Nullable widgetVersion: String?): TextClassificationContext.Builder!

Sets an optional custom version string for the widget type.

Return
TextClassificationContext.Builder!: this builder