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

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

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

origin: commonsguy/cw-omnibus

json.put("autofillId", wrap(node.getAutofillId()));
json.put("autofillOptions", wrap(node.getAutofillOptions()));
json.put("autofillType", wrap(node.getAutofillType()));
json.put("autofillValue", wrap(node.getAutofillValue()));
json.put("checkable", wrap(node.isCheckable()));
origin: googlesamples/android-AutofillFramework

/**
 * Uses heuristics to infer an autofill hint from a {@code string}.
 *
 * @return standard autofill hint, or {@code null} when it could not be inferred.
 */
@Nullable
protected String inferHint(ViewNode node, @Nullable String actualHint) {
  if (actualHint == null) return null;
  String hint = actualHint.toLowerCase();
  if (hint.contains("label") || hint.contains("container")) {
    Log.v(TAG, "Ignoring 'label/container' hint: " + hint);
    return null;
  }
  if (hint.contains("password")) return View.AUTOFILL_HINT_PASSWORD;
  if (hint.contains("username")
      || (hint.contains("login") && hint.contains("id")))
    return View.AUTOFILL_HINT_USERNAME;
  if (hint.contains("email")) return View.AUTOFILL_HINT_EMAIL_ADDRESS;
  if (hint.contains("name")) return View.AUTOFILL_HINT_NAME;
  if (hint.contains("phone")) return View.AUTOFILL_HINT_PHONE;
  // When everything else fails, return the full string - this is helpful to help app
  // developers visualize when autofill is triggered when it shouldn't (for example, in a
  // chat conversation window), so they can mark the root view of such activities with
  // android:importantForAutofill=noExcludeDescendants
  if (node.isEnabled() && node.getAutofillType() != View.AUTOFILL_TYPE_NONE) {
    Log.v(TAG, "Falling back to " + actualHint);
    return actualHint;
  }
  return null;
}
origin: googlesamples/android-AutofillFramework

builder.append(prefix).append("afType: ").append(getAutofillTypeAsString(node.getAutofillType()))
    .append("\tafValue:")
    .append(getAutofillValueAndTypeAsString(node.getAutofillValue()))
origin: googlesamples/android-AutofillFramework

builder.append(prefix).append("afType: ").append(getTypeAsString(node.getAutofillType()))
    .append("\tafValue:")
    .append(getAutofillValueAndTypeAsString(node.getAutofillValue()))
origin: googlesamples/android-AutofillFramework

  return;
int autofillType = viewNode.getAutofillType();
switch (autofillType) {
  case View.AUTOFILL_TYPE_LIST:
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));
}
android.app.assistAssistStructure$ViewNodegetAutofillType

Popular methods of AssistStructure$ViewNode

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • getContentResolver (Context)
  • setScale (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • JLabel (javax.swing)
  • 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