Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.view.ContentInfo.Builder

Builder for ContentInfo.

Summary

Public constructors

Creates a new builder initialized with the data from the given builder.

Builder(clip: ClipData, source: Int)

Creates a new builder.

Public methods
ContentInfo

ContentInfo.Builder

Sets the data to be inserted.

ContentInfo.Builder
setExtras(extras: Bundle?)

Sets additional metadata.

ContentInfo.Builder
setFlags(flags: Int)

Sets flags that control content insertion behavior.

ContentInfo.Builder
setLinkUri(linkUri: Uri?)

Sets the http/https URI for the content.

ContentInfo.Builder
setSource(source: Int)

Sets the source of the operation.

Public constructors

Builder

Added in API level 31
Builder(other: ContentInfo)

Creates a new builder initialized with the data from the given builder.

Parameters
other ContentInfo: This value cannot be null.

Builder

Added in API level 31
Builder(
    clip: ClipData,
    source: Int)

Creates a new builder.

Parameters
clip ClipData: The data to insert. This value cannot be null.
source Int: The source of the operation. See SOURCE_ constants. Value is android.view.ContentInfo#SOURCE_APP, android.view.ContentInfo#SOURCE_CLIPBOARD, android.view.ContentInfo#SOURCE_INPUT_METHOD, android.view.ContentInfo#SOURCE_DRAG_AND_DROP, android.view.ContentInfo#SOURCE_AUTOFILL, or android.view.ContentInfo#SOURCE_PROCESS_TEXT

Public methods

build

Added in API level 31
fun build(): ContentInfo
Return
ContentInfo A new ContentInfo instance with the data from this builder. This value cannot be null.

setClip

Added in API level 31
fun setClip(clip: ClipData): ContentInfo.Builder

Sets the data to be inserted.

Parameters
clip ClipData: The data to insert. This value cannot be null.
Return
ContentInfo.Builder this builder This value cannot be null.

setExtras

Added in API level 31
fun setExtras(extras: Bundle?): ContentInfo.Builder

Sets additional metadata.

Parameters
extras Bundle?: Optional bundle with additional metadata. This value may be null.
Return
ContentInfo.Builder this builder This value cannot be null.

setFlags

Added in API level 31
fun setFlags(flags: Int): ContentInfo.Builder

Sets flags that control content insertion behavior.

Parameters
flags Int: Optional flags to configure the insertion behavior. Use 0 for default behavior. See FLAG_ constants. Value is either 0 or android.view.ContentInfo#FLAG_CONVERT_TO_PLAIN_TEXT
Return
ContentInfo.Builder this builder This value cannot be null.

setLinkUri

Added in API level 31
fun setLinkUri(linkUri: Uri?): ContentInfo.Builder

Sets the http/https URI for the content. See android.view.inputmethod.InputContentInfo#getLinkUri for more info.

Parameters
linkUri Uri?: Optional http/https URI for the content. This value may be null.
Return
ContentInfo.Builder this builder This value cannot be null.

setSource

Added in API level 31
fun setSource(source: Int): ContentInfo.Builder

Sets the source of the operation.

Parameters
source Int: The source of the operation. See SOURCE_ constants. Value is android.view.ContentInfo#SOURCE_APP, android.view.ContentInfo#SOURCE_CLIPBOARD, android.view.ContentInfo#SOURCE_INPUT_METHOD, android.view.ContentInfo#SOURCE_DRAG_AND_DROP, android.view.ContentInfo#SOURCE_AUTOFILL, or android.view.ContentInfo#SOURCE_PROCESS_TEXT
Return
ContentInfo.Builder this builder This value cannot be null.