android.view.autofill.AutofillValue#getListValue ( )源码实例Demo

下面列出了android.view.autofill.AutofillValue#getListValue ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: android_9.0.0_r45   文件: RadioGroup.java
@Override
public void autofill(AutofillValue value) {
    if (!isEnabled()) return;

    if (!value.isList()) {
        Log.w(LOG_TAG, value + " could not be autofilled into " + this);
        return;
    }

    final int index = value.getListValue();
    final View child = getChildAt(index);
    if (child == null) {
        Log.w(VIEW_LOG_TAG, "RadioGroup.autoFill(): no child with index " + index);
        return;
    }

    check(child.getId());
}
 
@TargetApi(Build.VERSION_CODES.O)
@Override
public void autofill(AutofillValue value) {
    if (!isEnabled()) return;

    if (!value.isList()) {
        Log.w(LOG_TAG, value + " could not be autofilled into " + this);
        return;
    }

    final int index = value.getListValue();
    final View child = getChildAt(index);
    if (child == null) {
        Log.w(VIEW_LOG_TAG, "RadioGroup.autoFill(): no child with index " + index);
        return;
    }

    nestedRadioGroupManager.check(child.getId());
}
 
@TargetApi(Build.VERSION_CODES.O)
@Override
public void autofill(AutofillValue value) {
    if (!isEnabled()) return;

    if (!value.isList()) {
        Log.w(LOG_TAG, value + " could not be autofilled into " + this);
        return;
    }

    final int index = value.getListValue();
    final View child = getChildAt(index);
    if (child == null) {
        Log.w(VIEW_LOG_TAG, "RadioGroup.autoFill(): no child with index " + index);
        return;
    }

    nestedRadioGroupManager.check(child.getId());
}
 
@TargetApi(Build.VERSION_CODES.O)
@Override
public void autofill(AutofillValue value) {
    if (!isEnabled()) return;

    if (!value.isList()) {
        Log.w(LOG_TAG, value + " could not be autofilled into " + this);
        return;
    }

    final int index = value.getListValue();
    final View child = getChildAt(index);
    if (child == null) {
        Log.w(VIEW_LOG_TAG, "RadioGroup.autoFill(): no child with index " + index);
        return;
    }

    nestedRadioGroupManager.check(child.getId());
}
 
源代码5 项目: NestedRadioButton   文件: NestedFrameRadioGroup.java
@TargetApi(Build.VERSION_CODES.O)
@Override
public void autofill(AutofillValue value) {
    if (!isEnabled()) return;

    if (!value.isList()) {
        Log.w(LOG_TAG, value + " could not be autofilled into " + this);
        return;
    }

    final int index = value.getListValue();
    final View child = getChildAt(index);
    if (child == null) {
        Log.w(VIEW_LOG_TAG, "RadioGroup.autoFill(): no child with index " + index);
        return;
    }

    nestedRadioGroupManager.check(child.getId());
}
 
源代码6 项目: input-samples   文件: ClientAutofillDataBuilder.java
private void parseAutofillFields(AssistStructure.ViewNode viewNode,
        DatasetWithFilledAutofillFields datasetWithFilledAutofillFields, int partition) {
    String[] hints = viewNode.getAutofillHints();
    if (hints == null || hints.length == 0) {
        return;
    }
    AutofillValue autofillValue = viewNode.getAutofillValue();
    String textValue = null;
    Long dateValue = null;
    Boolean toggleValue = null;
    CharSequence[] autofillOptions = null;
    Integer listIndex = null;
    if (autofillValue != null) {
        if (autofillValue.isText()) {
            // Using toString of AutofillValue.getTextValue in order to save it to
            // SharedPreferences.
            textValue = autofillValue.getTextValue().toString();
        } else if (autofillValue.isDate()) {
            dateValue = autofillValue.getDateValue();
        } else if (autofillValue.isList()) {
            autofillOptions = viewNode.getAutofillOptions();
            listIndex = autofillValue.getListValue();
        } else if (autofillValue.isToggle()) {
            toggleValue = autofillValue.getToggleValue();
        }
    }
    appendViewMetadata(datasetWithFilledAutofillFields,
            hints, partition, textValue, dateValue, toggleValue,
            autofillOptions, listIndex);
}
 
private void parseAutofillFields(AssistStructure.ViewNode viewNode,
        DatasetWithFilledAutofillFields datasetWithFilledAutofillFields, int partition) {
    String[] hints = viewNode.getAutofillHints();
    if (hints == null || hints.length == 0) {
        return;
    }
    AutofillValue autofillValue = viewNode.getAutofillValue();
    String textValue = null;
    Long dateValue = null;
    Boolean toggleValue = null;
    CharSequence[] autofillOptions = null;
    Integer listIndex = null;
    if (autofillValue != null) {
        if (autofillValue.isText()) {
            // Using toString of AutofillValue.getTextValue in order to save it to
            // SharedPreferences.
            textValue = autofillValue.getTextValue().toString();
        } else if (autofillValue.isDate()) {
            dateValue = autofillValue.getDateValue();
        } else if (autofillValue.isList()) {
            autofillOptions = viewNode.getAutofillOptions();
            listIndex = autofillValue.getListValue();
        } else if (autofillValue.isToggle()) {
            toggleValue = autofillValue.getToggleValue();
        }
    }
    appendViewMetadata(datasetWithFilledAutofillFields,
            hints, partition, textValue, dateValue, toggleValue,
            autofillOptions, listIndex);
}