android.app.assist.AssistStructure.ViewNode#getAutofillId ( )源码实例Demo

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

源代码1 项目: input-samples   文件: MultiStepsService.java
private void addAutofillableFields(@NonNull Map<String, AutofillId> fields,
        @NonNull ViewNode node) {
    String[] hints = node.getAutofillHints();
    if (hints != null) {
        // We're simple, we only care about the first hint
        String hint = hints[0];
        AutofillId id = node.getAutofillId();
        if (!fields.containsKey(hint)) {
            Log.v(TAG, "Setting hint '" + hint + "' on " + id);
            fields.put(hint, id);
        } else {
            Log.v(TAG, "Ignoring hint '" + hint + "' on " + id
                    + " because it was already set");
        }
    }
    int childrenSize = node.getChildCount();
    for (int i = 0; i < childrenSize; i++) {
        addAutofillableFields(fields, node.getChildAt(i));
    }
}
 
源代码2 项目: input-samples   文件: BasicService.java
/**
 * Adds any autofillable view from the {@link ViewNode} and its descendants to the map.
 */
private void addAutofillableFields(@NonNull Map<String, AutofillId> fields,
        @NonNull ViewNode node) {
    String[] hints = node.getAutofillHints();
    if (hints != null) {
        // We're simple, we only care about the first hint
        String hint = hints[0].toLowerCase();

        if (hint != null) {
            AutofillId id = node.getAutofillId();
            if (!fields.containsKey(hint)) {
                Log.v(TAG, "Setting hint '" + hint + "' on " + id);
                fields.put(hint, id);
            } else {
                Log.v(TAG, "Ignoring hint '" + hint + "' on " + id
                        + " because it was already set");
            }
        }
    }
    int childrenSize = node.getChildCount();
    for (int i = 0; i < childrenSize; i++) {
        addAutofillableFields(fields, node.getChildAt(i));
    }
}
 
源代码3 项目: input-samples   文件: DebugService.java
/**
 * Adds any autofillable view from the {@link ViewNode} and its descendants to the map.
 */
private void addAutofillableFields(@NonNull Map<String, AutofillId> fields,
        @NonNull ViewNode node) {
    String hint = getHint(node);
    if (hint != null) {
        AutofillId id = node.getAutofillId();
        if (!fields.containsKey(hint)) {
            Log.v(TAG, "Setting hint '" + hint + "' on " + id);
            fields.put(hint, id);
        } else {
            Log.v(TAG, "Ignoring hint '" + hint + "' on " + id
                    + " because it was already set");
        }
    }
    int childrenSize = node.getChildCount();
    for (int i = 0; i < childrenSize; i++) {
        addAutofillableFields(fields, node.getChildAt(i));
    }
}
 
private void addAutofillableFields(@NonNull Map<String, AutofillId> fields,
        @NonNull ViewNode node) {
    String[] hints = node.getAutofillHints();
    if (hints != null) {
        // We're simple, we only care about the first hint
        String hint = hints[0];
        AutofillId id = node.getAutofillId();
        if (!fields.containsKey(hint)) {
            Log.v(TAG, "Setting hint '" + hint + "' on " + id);
            fields.put(hint, id);
        } else {
            Log.v(TAG, "Ignoring hint '" + hint + "' on " + id
                    + " because it was already set");
        }
    }
    int childrenSize = node.getChildCount();
    for (int i = 0; i < childrenSize; i++) {
        addAutofillableFields(fields, node.getChildAt(i));
    }
}
 
源代码5 项目: android-AutofillFramework   文件: BasicService.java
/**
 * Adds any autofillable view from the {@link ViewNode} and its descendants to the map.
 */
private void addAutofillableFields(@NonNull Map<String, AutofillId> fields,
        @NonNull ViewNode node) {
    String[] hints = node.getAutofillHints();
    if (hints != null) {
        // We're simple, we only care about the first hint
        String hint = hints[0].toLowerCase();

        if (hint != null) {
            AutofillId id = node.getAutofillId();
            if (!fields.containsKey(hint)) {
                Log.v(TAG, "Setting hint '" + hint + "' on " + id);
                fields.put(hint, id);
            } else {
                Log.v(TAG, "Ignoring hint '" + hint + "' on " + id
                        + " because it was already set");
            }
        }
    }
    int childrenSize = node.getChildCount();
    for (int i = 0; i < childrenSize; i++) {
        addAutofillableFields(fields, node.getChildAt(i));
    }
}
 
源代码6 项目: android-AutofillFramework   文件: DebugService.java
/**
 * Adds any autofillable view from the {@link ViewNode} and its descendants to the map.
 */
private void addAutofillableFields(@NonNull Map<String, AutofillId> fields,
        @NonNull ViewNode node) {
    String hint = getHint(node);
    if (hint != null) {
        AutofillId id = node.getAutofillId();
        if (!fields.containsKey(hint)) {
            Log.v(TAG, "Setting hint '" + hint + "' on " + id);
            fields.put(hint, id);
        } else {
            Log.v(TAG, "Ignoring hint '" + hint + "' on " + id
                    + " because it was already set");
        }
    }
    int childrenSize = node.getChildCount();
    for (int i = 0; i < childrenSize; i++) {
        addAutofillableFields(fields, node.getChildAt(i));
    }
}