GuidedActionAutofillSupport


interface GuidedActionAutofillSupport

Known direct subclasses
GuidedActionAppCompatEditText

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

GuidedActionEditText

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


Interface for a custom EditText subclass to support autofill in androidx.leanback.app.GuidedStepSupportFragment.

Apps who needs to supply custom layouts for GuidedActionsStylist with their own EditText classes should implement this interface in order to support autofill in androidx.leanback.app.GuidedStepSupportFragment. This ensures autofill event happened within custom EditText is propagated to GuidedStepSupportFragment. e.g.

public class MyEditText extends EditText implements GuidedActionAutofillSupport {
    OnAutofillListener mAutofillViewListener;
    @Override
    public void setOnAutofillListener(OnAutofillListener autofillViewListener) {
        mAutofillViewListener = autofillViewListener;
    }

    @Override
    public void autofill(AutofillValue values) {
        super.autofill(values);
        if (mAutofillViewListener != null) {
            mAutofillViewListener.onAutofill(this);
        }
    }
    // ...
}

Summary

Nested types

Listener for autofill event.

Public functions

Unit

Sets AutofillListener on the custom view.

Public functions

setOnAutofillListener

Added in 1.1.0
fun setOnAutofillListener(
    listener: GuidedActionAutofillSupport.OnAutofillListener!
): Unit

Sets AutofillListener on the custom view.