MichaelEvans / accounts-autocomplete

An M-compatible custom autocomplete textview that shows user's Google accounts as autocomplete suggestion.

Repository from Github https://github.comMichaelEvans/accounts-autocompleteRepository from Github https://github.comMichaelEvans/accounts-autocomplete

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

Drop in au.com.domain.AccountsAutoCompleteTextView in your layout 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);
    }

And that's it.

About

An M-compatible custom autocomplete textview that shows user's Google accounts as autocomplete suggestion.

License:Apache License 2.0


Languages

Language:Java 100.0%