Recently I've tried to search for a concrete GitHub user and found that mobile client lacks this possibility. So I've implemented this by myself.
Since this PR contains a lot of changes I'll try to describe them in details.
I've changed RepositorySearchActivity to a SearchActivity with a tabbed pager. Now it contains two tabs - repositories and users. "Repositories" tab displays searched repos, same as before, while "Users" tab displays a user with user_login = search_query. Screenshots below:
Currently GitHub Java API lib has no possibility to search users with GitHub Search API.
So I've used UserService.getUser(login) method to find a user that exactly matches search query (better than nothing I guess).
I though about extending UserService class and adding a method there to get users with Search API. This can be done similar to RepositoryService.searchRepositories method.
But Search API does not return any info to get user avatar (avatar_url / gravatar_id / user_email) though it should return gravatar_id as stated in docs. A possible implementation for me is to invoke RefreshUserTask on each list item to retrieve full User model.
I've moved search related classes to ui.search package. Also tried to stick with the existing code style in this PR, hope I have not missed anything.
@kevinsawicki how do you like the idea? Waiting for feedback
It seems that user search API is fixed now and it returns gravatar_id field.
So I can implement a complete user search as suggested earlier.
I've implemented complete user search. Screenshot below:
Some implementation details
I've used Github Search API for this.
I had to create a SearchUser class similar to how it is done in GitHub Java API.
Next I've implemented a SearchUserService class. It is an extension to UserService class from GitHub Java API with some methods to search for users.
Also, I've rebased the branch to remove those "formatting fix" commits.
Waiting for feedback on this.
Any updates on this one?
Sorry for the delay, I'll review this soon.
Move search repo classes to new ui.search package
Add skeleton classes for SearchActivity and Search Fragments
Create tab pager for repos/users search fragments
Remove unneeded files
Implement search for a particular user
Implement requery from SearchActivity
Add SearchUser model class
Implementation of SearchUserService
SearchUserService is an extension to UserService
with methods for users search using Search API
UI for searching users
Add SearchUserListAdapter, support for SearchUser class in
Rename searchable meta-data