Java Code Examples for android.view.View#AUTOFILL_TYPE_LIST

The following examples show how to use android.view.View#AUTOFILL_TYPE_LIST . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Util.java    From input-samples with Apache License 2.0 5 votes vote down vote up
public static String getTypeAsString(int type) {
    switch (type) {
        case View.AUTOFILL_TYPE_TEXT:
            return "TYPE_TEXT";
        case View.AUTOFILL_TYPE_LIST:
            return "TYPE_LIST";
        case View.AUTOFILL_TYPE_NONE:
            return "TYPE_NONE";
        case View.AUTOFILL_TYPE_TOGGLE:
            return "TYPE_TOGGLE";
        case View.AUTOFILL_TYPE_DATE:
            return "TYPE_DATE";
    }
    return "UNKNOWN_TYPE";
}
 
Example 2
Source File: Util.java    From input-samples with Apache License 2.0 5 votes vote down vote up
public static String getAutofillTypeAsString(int type) {
    switch (type) {
        case View.AUTOFILL_TYPE_TEXT:
            return "TYPE_TEXT";
        case View.AUTOFILL_TYPE_LIST:
            return "TYPE_LIST";
        case View.AUTOFILL_TYPE_NONE:
            return "TYPE_NONE";
        case View.AUTOFILL_TYPE_TOGGLE:
            return "TYPE_TOGGLE";
        case View.AUTOFILL_TYPE_DATE:
            return "TYPE_DATE";
    }
    return "UNKNOWN_TYPE";
}
 
Example 3
Source File: Util.java    From android-AutofillFramework with Apache License 2.0 5 votes vote down vote up
public static String getTypeAsString(int type) {
    switch (type) {
        case View.AUTOFILL_TYPE_TEXT:
            return "TYPE_TEXT";
        case View.AUTOFILL_TYPE_LIST:
            return "TYPE_LIST";
        case View.AUTOFILL_TYPE_NONE:
            return "TYPE_NONE";
        case View.AUTOFILL_TYPE_TOGGLE:
            return "TYPE_TOGGLE";
        case View.AUTOFILL_TYPE_DATE:
            return "TYPE_DATE";
    }
    return "UNKNOWN_TYPE";
}
 
Example 4
Source File: Util.java    From android-AutofillFramework with Apache License 2.0 5 votes vote down vote up
public static String getAutofillTypeAsString(int type) {
    switch (type) {
        case View.AUTOFILL_TYPE_TEXT:
            return "TYPE_TEXT";
        case View.AUTOFILL_TYPE_LIST:
            return "TYPE_LIST";
        case View.AUTOFILL_TYPE_NONE:
            return "TYPE_NONE";
        case View.AUTOFILL_TYPE_TOGGLE:
            return "TYPE_TOGGLE";
        case View.AUTOFILL_TYPE_DATE:
            return "TYPE_DATE";
    }
    return "UNKNOWN_TYPE";
}
 
Example 5
Source File: DatasetAdapter.java    From input-samples with Apache License 2.0 4 votes vote down vote up
void bindValueToNode(AssistStructure.ViewNode viewNode,
        FilledAutofillField field, Dataset.Builder builder,
        MutableBoolean setValueAtLeastOnce) {
    AutofillId autofillId = viewNode.getAutofillId();
    if (autofillId == null) {
        logw("Autofill ID null for %s", viewNode.toString());
        return;
    }
    int autofillType = viewNode.getAutofillType();
    switch (autofillType) {
        case View.AUTOFILL_TYPE_LIST:
            CharSequence[] options = viewNode.getAutofillOptions();
            int listValue = -1;
            if (options != null) {
                listValue = indexOf(viewNode.getAutofillOptions(), field.getTextValue());
            }
            if (listValue != -1) {
                builder.setValue(autofillId, AutofillValue.forList(listValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_DATE:
            Long dateValue = field.getDateValue();
            if (dateValue != null) {
                builder.setValue(autofillId, AutofillValue.forDate(dateValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_TEXT:
            String textValue = field.getTextValue();
            if (textValue != null) {
                builder.setValue(autofillId, AutofillValue.forText(textValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_TOGGLE:
            Boolean toggleValue = field.getToggleValue();
            if (toggleValue != null) {
                builder.setValue(autofillId, AutofillValue.forToggle(toggleValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_NONE:
        default:
            logw("Invalid autofill type - %d", autofillType);
            break;
    }
}
 
Example 6
Source File: DatasetAdapter.java    From android-AutofillFramework with Apache License 2.0 4 votes vote down vote up
void bindValueToNode(AssistStructure.ViewNode viewNode,
        FilledAutofillField field, Dataset.Builder builder,
        MutableBoolean setValueAtLeastOnce) {
    AutofillId autofillId = viewNode.getAutofillId();
    if (autofillId == null) {
        logw("Autofill ID null for %s", viewNode.toString());
        return;
    }
    int autofillType = viewNode.getAutofillType();
    switch (autofillType) {
        case View.AUTOFILL_TYPE_LIST:
            CharSequence[] options = viewNode.getAutofillOptions();
            int listValue = -1;
            if (options != null) {
                listValue = indexOf(viewNode.getAutofillOptions(), field.getTextValue());
            }
            if (listValue != -1) {
                builder.setValue(autofillId, AutofillValue.forList(listValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_DATE:
            Long dateValue = field.getDateValue();
            if (dateValue != null) {
                builder.setValue(autofillId, AutofillValue.forDate(dateValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_TEXT:
            String textValue = field.getTextValue();
            if (textValue != null) {
                builder.setValue(autofillId, AutofillValue.forText(textValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_TOGGLE:
            Boolean toggleValue = field.getToggleValue();
            if (toggleValue != null) {
                builder.setValue(autofillId, AutofillValue.forToggle(toggleValue));
                setValueAtLeastOnce.value = true;
            }
            break;
        case View.AUTOFILL_TYPE_NONE:
        default:
            logw("Invalid autofill type - %d", autofillType);
            break;
    }
}