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

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

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

origin: commonsguy/cw-omnibus

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

/**
 * 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

String[] afHints = node.getAutofillHints();
CharSequence[] options = node.getAutofillOptions();
builder.append(prefix).append("afType: ").append(getAutofillTypeAsString(node.getAutofillType()))
origin: googlesamples/android-AutofillFramework

String[] afHints = node.getAutofillHints();
CharSequence[] options = node.getAutofillOptions();
builder.append(prefix).append("afType: ").append(getTypeAsString(node.getAutofillType()))
origin: googlesamples/android-AutofillFramework

String[] hints = node.getAutofillHints();
if (hints != null) {
origin: googlesamples/android-AutofillFramework

private void parseAutofillFields(AssistStructure.ViewNode viewNode,
    DatasetWithFilledAutofillFields datasetWithFilledAutofillFields, int partition) {
  String[] hints = viewNode.getAutofillHints();
  if (hints == null || hints.length == 0) {
    return;
  }
  AutofillValue autofillValue = viewNode.getAutofillValue();
  String textValue = null;
  Long dateValue = null;
  Boolean toggleValue = null;
  CharSequence[] autofillOptions = null;
  Integer listIndex = null;
  if (autofillValue != null) {
    if (autofillValue.isText()) {
      // Using toString of AutofillValue.getTextValue in order to save it to
      // SharedPreferences.
      textValue = autofillValue.getTextValue().toString();
    } else if (autofillValue.isDate()) {
      dateValue = autofillValue.getDateValue();
    } else if (autofillValue.isList()) {
      autofillOptions = viewNode.getAutofillOptions();
      listIndex = autofillValue.getListValue();
    } else if (autofillValue.isToggle()) {
      toggleValue = autofillValue.getToggleValue();
    }
  }
  appendViewMetadata(datasetWithFilledAutofillFields,
      hints, partition, textValue, dateValue, toggleValue,
      autofillOptions, listIndex);
}
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

private void parseAutofillFields(AssistStructure.ViewNode viewNode,
    HashMap<String, FieldTypeWithHeuristics> fieldTypesByAutofillHint,
    Map<String, FilledAutofillField> filledAutofillFieldsByTypeName,
    Dataset.Builder builder, MutableBoolean setValueAtLeastOnce) {
  String[] rawHints = viewNode.getAutofillHints();
  if (rawHints == null || rawHints.length == 0) {
    logv("No af hints at ViewNode - %s", viewNode.getIdEntry());
    return;
  }
  String fieldTypeName = AutofillHints.getFieldTypeNameFromAutofillHints(
      fieldTypesByAutofillHint, Arrays.asList(rawHints));
  if (fieldTypeName == null) {
    return;
  }
  FilledAutofillField field = filledAutofillFieldsByTypeName.get(fieldTypeName);
  if (field == null) {
    return;
  }
  bindValueToNode(viewNode, field, builder, setValueAtLeastOnce);
}
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());
    }
  }
}
android.app.assistAssistStructure$ViewNodegetAutofillHints

Popular methods of AssistStructure$ViewNode

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

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • findViewById (Activity)
  • putExtra (Intent)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Join (org.hibernate.mapping)
  • CodeWhisperer alternatives
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