OnReceiveContentViewBehavior

Added in 1.5.0

public interface OnReceiveContentViewBehavior

Known direct subclasses
AppCompatEditText

A EditText which supports compatible features on older versions of the platform, including:

Known indirect subclasses
EmojiAppCompatEditText

AppCompatEditText widget enhanced with emoji capability by using EmojiEditTextHelper.

GuidedActionAppCompatEditText

A custom EditText that satisfies the IME key monitoring requirements of GuidedStepFragment.


Interface for widgets to implement default behavior for receiving content. Content may be both text and non-text (plain/styled text, HTML, images, videos, audio files, etc).

Widgets should implement this interface to define the default behavior for receiving content when the SDK is <= 30. When doing so, widgets should also override onReceiveContent for SDK >30.

Apps wishing to provide custom behavior for receiving content should not implement this interface but rather set a listener via setOnReceiveContentListener. See performReceiveContent for more info.

Summary

Public methods

abstract @Nullable ContentInfoCompat

Implements a view's default behavior for receiving content.

Public methods

onReceiveContent

Added in 1.5.0
abstract @Nullable ContentInfoCompat onReceiveContent(@NonNull ContentInfoCompat payload)

Implements a view's default behavior for receiving content.

Parameters
@NonNull ContentInfoCompat payload

The content to insert and related metadata.

Returns
@Nullable ContentInfoCompat

The portion of the passed-in content that was not handled (may be all, some, or none of the passed-in content).