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

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

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

origin: commonsguy/cw-omnibus

json.put("assistBlocked", wrap(node.isAssistBlocked()));
json.put("autofillHints", wrap(node.getAutofillHints()));
json.put("autofillId", wrap(node.getAutofillId()));
json.put("autofillOptions", wrap(node.getAutofillOptions()));
json.put("autofillType", wrap(node.getAutofillType()));
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

private static void dumpNode(String prefix, ViewNode node) {
  StringBuilder builder = new StringBuilder();
  builder.append(prefix)
      .append("autoFillId: ").append(node.getAutofillId())
      .append("\tidEntry: ").append(node.getIdEntry())
      .append("\tid: ").append(node.getId())
origin: googlesamples/android-AutofillFramework

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

.append("autoFillId: ").append(node.getAutofillId())
.append("\tidEntry: ").append(node.getIdEntry())
.append("\tid: ").append(node.getId())
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

  private void parseNode(AssistStructure.ViewNode root, List<String> allHints,
      MutableInt autofillSaveType, List<AutofillId> autofillIds,
      List<AutofillId> focusedAutofillIds) {
    String[] hints = root.getAutofillHints();
    if (hints != null) {
      for (String hint : hints) {
        FieldTypeWithHeuristics fieldTypeWithHints = mFieldTypesByAutofillHint.get(hint);
        if (fieldTypeWithHints != null && fieldTypeWithHints.fieldType != null) {
          allHints.add(hint);
          autofillSaveType.value |= fieldTypeWithHints.fieldType.getSaveInfo();
          autofillIds.add(root.getAutofillId());
        }
      }
    }
    if (root.isFocused()) {
      focusedAutofillIds.add(root.getAutofillId());
    }
  }
}
origin: googlesamples/android-AutofillFramework

private boolean bindDatasetToFocusedNode(FilledAutofillField field,
    FieldType fieldType, Dataset.Builder builder) {
  MutableBoolean setValueAtLeastOnce = new MutableBoolean(false);
  mClientParser.parse((node) -> {
    if (node.isFocused() && node.getAutofillId() != null) {
      bindValueToNode(node, field, builder, setValueAtLeastOnce);
    }
  });
  return setValueAtLeastOnce.value;
}
android.app.assistAssistStructure$ViewNodegetAutofillId

Popular methods of AssistStructure$ViewNode

  • getChildAt
  • getChildCount
  • getAutofillHints
  • 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
  • Top Sublime Text plugins
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