github/android — pull request #318 by atermenji (2013-02-06 12:31:29+00:00)
Title: Added a possibility to search for a particular user

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.

### UI side
I've changed [RepositorySearchActivity](https://github.com/github/android/blob/master/app/src/main/java/com/github/mobile/ui/repo/RepositorySearchActivity.java) 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:

![left](https://f.cloud.github.com/assets/1188140/131345/d124ece6-7055-11e2-82af-b6375838ac64.jpg)

![right](https://f.cloud.github.com/assets/1188140/131346/d454ba2c-7055-11e2-832d-f7d6b84c6615.jpg)

### Implementation

Currently [GitHub Java API lib](https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core) has no possibility to search users with [GitHub Search API](http://developer.github.com/v3/search/#search-users).
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](https://github.com/eclipse/egit-github/blob/master/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java#L477) 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](https://github.com/github/android/blob/master/app/src/main/java/com/github/mobile/core/user/RefreshUserTask.java) 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