-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contact lookup by phone number added. #2233
Conversation
…ved license handling in sample
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed CLA. |
CLAs look good, thanks! |
Fixing issues reported by checkstyle on travis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me other than a couple of small nits. Thanks!
GlideRequests glideRequests = GlideApp.with(MainActivity.this); | ||
RequestOptions originalSize = new RequestOptions().override(Target.SIZE_ORIGINAL); | ||
|
||
glideRequests.load(uri).apply(originalSize).into(imageViewLookup); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can inline this:
GlideApp.with(MainActivity.this)
.load(uri)
.override(Target.SIZE_ORIGINAL)
.into(imageView);
@@ -40,6 +48,17 @@ protected void onCreate(Bundle savedInstanceState) { | |||
imageViewLookup = (ImageView) findViewById(R.id.image_lookup); | |||
imageViewPhoto = (ImageView) findViewById(R.id.image_photo); | |||
imageViewDisplayPhoto = (ImageView) findViewById(R.id.image_display_photo); | |||
numberEntry = (EditText) findViewById(R.id.number_entry); | |||
if (ContextCompat.checkSelfPermission(this.getApplication(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing looks a bit weird, maybe:
if (ContextCompat.checkSelfPermission(
getApplication(),
Manifeset.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) {
...
}
Updated formatting after code review. Removed line of code that was commented-out. Added comment for permission request.
Updated code according to comments and submitted updates. |
Thanks! |
…ved license handling in sample
Description
Added support to contact lookup by phone number. Since Android offers highly optimized way to lookup for contacts by their number, this extension allows us to use it. Also, I updated sample application to better handle permissions and added part which demonstrates searching contacts based on phone number and showing contact image.
Motivation and Context
My use-case is that I have application which shows information about missed calls on another phone, I just pass information about caller number to this application and I want to show profile thumbnail of a caller in a list, in which I use glide to handle images. Change that I am committing here allows me fetch contact image using glide, where contact phone number is used to find contact.