android.view.View#AUTOFILL_TYPE_TEXT源码实例Demo

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

源代码1 项目: input-samples   文件: Util.java
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";
}
 
源代码2 项目: input-samples   文件: Util.java
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";
}
 
源代码3 项目: android-AutofillFramework   文件: Util.java
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";
}
 
源代码4 项目: android-AutofillFramework   文件: Util.java
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";
}
 
源代码5 项目: input-samples   文件: DatasetAdapter.java
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;
    }
}
 
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;
    }
}
 
 方法所在类
 同类方法