Tabnine Logo
AssistStructure$ViewNode.getChildCount
Code IndexAdd Tabnine to your IDE (free)

How to use
getChildCount
method
in
android.app.assist.AssistStructure$ViewNode

Best Java code snippets using android.app.assist.AssistStructure$ViewNode.getChildCount (Showing top 11 results out of 315)

origin: commonsguy/cw-omnibus

private JSONArray dumpStructureNodes(
 AssistStructure.ViewNode node,
 JSONArray children) throws JSONException {
 for (int i=0; i<node.getChildCount(); i++) {
  children.put(dumpStructureNode(node.getChildAt(i),
   new JSONObject()));
 }
 return (children);
}
origin: commonsguy/cw-omnibus

private JSONArray dumpStructureNodes(
 AssistStructure.ViewNode node,
 JSONArray children) throws JSONException {
 for (int i=0; i<node.getChildCount(); i++) {
  children.put(dumpStructureNode(node.getChildAt(i),
   new JSONObject()));
 }
 return(children);
}
origin: commonsguy/cw-omnibus

private AutofillId collectViewIds(AssistStructure.ViewNode node,
                 Set<AutofillId> ids) {
 AutofillId result=null;
 if (node.getAutofillHints()!=null && node.getAutofillHints().length>0) {
  result=node.getAutofillId();
  ids.add(result);
 }
 for (int i=0; i<node.getChildCount(); i++) {
  AutofillId temp=collectViewIds(node.getChildAt(i), ids);
  if (result==null) {
   result=temp;
  }
 }
 return(result);
}
origin: googlesamples/android-AutofillFramework

    .append('\n');
int numberChildren = node.getChildCount();
builder.append(prefix).append("# children: ").append(numberChildren)
    .append("\ttext: ").append(node.getText())
origin: googlesamples/android-AutofillFramework

    .append('\n');
int numberChildren = node.getChildCount();
builder.append(prefix).append("# children: ").append(numberChildren)
    .append("\ttext: ").append(node.getText())
origin: sorz/TinyKeePass

private void parseViewNode(AssistStructure.ViewNode node) {
  String[] hints = node.getAutofillHints();
  if (hints != null && hints.length > 0) {
    if (Arrays.stream(hints).anyMatch(View.AUTOFILL_HINT_USERNAME::equals))
      result.username.add(node.getAutofillId());
    else if (Arrays.stream(hints).anyMatch(View.AUTOFILL_HINT_EMAIL_ADDRESS::equals))
      result.email.add(node.getAutofillId());
    else if (Arrays.stream(hints).anyMatch(View.AUTOFILL_HINT_PASSWORD::equals))
      result.password.add(node.getAutofillId());
    else
      Log.d(TAG, "unsupported hints");
  } else if (node.getAutofillType() == View.AUTOFILL_TYPE_TEXT) {
    int inputType = node.getInputType();
    if ((inputType & InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS) > 0)
      result.email.add(node.getAutofillId());
    else if ((inputType & InputType.TYPE_TEXT_VARIATION_PASSWORD) > 0)
      result.password.add(node.getAutofillId());
    else if (result.password.isEmpty())
      usernameCandidate = node.getAutofillId();
  }
  for (int i=0; i<node.getChildCount(); ++i)
    parseViewNode(node.getChildAt(i));
}
origin: googlesamples/android-AutofillFramework

/**
 * 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));
  }
}
origin: googlesamples/android-AutofillFramework

/**
 * 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));
  }
}
origin: googlesamples/android-AutofillFramework

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));
  }
}
origin: googlesamples/android-AutofillFramework

/**
 * Gets a node if it matches the filter criteria for the given id.
 */
public static ViewNode findNodeByFilter(@NonNull ViewNode node, @NonNull Object id,
    @NonNull NodeFilter filter) {
  if (filter.matches(node, id)) {
    return node;
  }
  final int childrenSize = node.getChildCount();
  if (childrenSize > 0) {
    for (int i = 0; i < childrenSize; i++) {
      final ViewNode found = findNodeByFilter(node.getChildAt(i), id, filter);
      if (found != null) {
        return found;
      }
    }
  }
  return null;
}
origin: googlesamples/android-AutofillFramework

private void traverseRoot(AssistStructure.ViewNode viewNode, NodeProcessor processor) {
  processor.processNode(viewNode);
  int childrenSize = viewNode.getChildCount();
  if (childrenSize > 0) {
    for (int i = 0; i < childrenSize; i++) {
      traverseRoot(viewNode.getChildAt(i), processor);
    }
  }
}
android.app.assistAssistStructure$ViewNodegetChildCount

Popular methods of AssistStructure$ViewNode

  • getChildAt
  • getAutofillHints
  • getAutofillId
  • getAutofillType
  • getClassName
  • getHint
  • getId
  • getIdEntry
  • getInputType
  • getText
  • getVisibility
  • getWebDomain
  • getVisibility,
  • getWebDomain,
  • isChecked,
  • isFocused,
  • getAutofillOptions,
  • getAutofillValue,
  • getHtmlInfo,
  • isEnabled,
  • getAlpha

Popular in Java

  • Parsing JSON documents to java classes using gson
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JLabel (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now