|
20 | 20 | import android.view.View; |
21 | 21 | import android.widget.ListView; |
22 | 22 |
|
| 23 | +import com.github.pockethub.android.util.InfoUtils; |
23 | 24 | import com.meisolsson.githubsdk.core.ServiceGenerator; |
24 | 25 | import com.meisolsson.githubsdk.model.Issue; |
25 | 26 | import com.meisolsson.githubsdk.model.Repository; |
@@ -95,13 +96,16 @@ public List<Issue> loadData() throws Exception { |
95 | 96 | return Collections.emptyList(); |
96 | 97 | } |
97 | 98 | List<Issue> matches = new ArrayList<>(); |
| 99 | + // We need to add the repo parameter to allow us to search only the repo issues |
| 100 | + String searchQuery = query + "+repo:" + InfoUtils.createRepoId(repository); |
98 | 101 |
|
99 | | - SearchService service = ServiceGenerator.createService(getActivity(), SearchService.class); |
| 102 | + SearchService service = ServiceGenerator.createService(getActivity(), |
| 103 | + SearchService.class); |
100 | 104 |
|
101 | 105 | int current = 1; |
102 | 106 | int last = 0; |
103 | 107 | while (current != last) { |
104 | | - SearchPage<Issue> page = service.searchIssues(query, null, null, current) |
| 108 | + SearchPage<Issue> page = service.searchIssues(searchQuery, null, null, current) |
105 | 109 | .blockingGet() |
106 | 110 | .body(); |
107 | 111 |
|
@@ -129,6 +133,6 @@ protected SingleTypeAdapter<Issue> createAdapter( |
129 | 133 |
|
130 | 134 | @Override |
131 | 135 | public int compare(Issue lhs, Issue rhs) { |
132 | | - return (int) (rhs.number() - lhs.number()); |
| 136 | + return rhs.number() - lhs.number(); |
133 | 137 | } |
134 | 138 | } |
0 commit comments