Skip to content

An M-compatible custom AutoCompleteTextView that shows the user's Google accounts as autocomplete suggestions.

License

Notifications You must be signed in to change notification settings

DomainGroupOSS/accounts-autocomplete

Repository files navigation

accounts-autocomplete

An M-compatible custom AutoCompleteTextView that shows the user's Google accounts as autocomplete suggestions.

This widget is based on the GMail behaviour of subtly asking for permissions for autcompleting email addresses.

Before permission is granted:
Allow Suggestions

After permission is granted:
With Suggestions

Usage

compile 'au.com.domain:accounts-autocomplete:1.0.0'

Drop in au.com.domain.AccountsAutoCompleteTextView in your layout:

<au.com.domain.AccountsAutoCompleteTextView
        android:id="@+id/accounts_autocomplete"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

and set it up in the Activity:

mAccountsAutoCompleteTextView.setParentActivity(this);

or Fragment:

mAccountsAutoCompleteTextView.setParentFragment(this);

You would then need to override the onRequestPermissionsResult callback:

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
    mAccountsAutoCompleteTextView.onPermissionResponse(requestCode, permissions, grantResults);
}

About

An M-compatible custom AutoCompleteTextView that shows the user's Google accounts as autocomplete suggestions.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages