use of com.github.pockethub.android.core.user.UserEventMatcher.UserPair in project PocketHub by pockethub.
the class NewsFragment method onListItemClick.
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
GitHubEvent event = (GitHubEvent) l.getItemAtPosition(position);
if (DownloadEvent.equals(event.type())) {
openDownload(event);
return;
}
if (PushEvent.equals(event.type())) {
openPush(event);
return;
}
if (CommitCommentEvent.equals(event.type())) {
openCommitComment(event);
return;
}
Issue issue = issueMatcher.getIssue(event);
if (issue != null) {
Repository repo = ConvertUtils.eventRepoToRepo(event.repo());
viewIssue(issue, repo);
return;
}
Gist gist = gistMatcher.getGist(event);
if (gist != null) {
startActivity(GistsViewActivity.createIntent(gist));
return;
}
Repository repo = repoMatcher.getRepository(event);
if (repo != null) {
viewRepository(repo);
}
UserPair users = userMatcher.getUsers(event);
if (users != null) {
viewUser(users);
}
}
use of com.github.pockethub.android.core.user.UserEventMatcher.UserPair in project PocketHub by pockethub.
the class NewsFragment method onItemClick.
@Override
public void onItemClick(@NonNull Item item, @NonNull View view) {
if (!(item instanceof NewsItem)) {
return;
}
GitHubEvent event = ((NewsItem) item).getGitHubEvent();
if (DownloadEvent.equals(event.type())) {
openDownload(event);
return;
}
if (PushEvent.equals(event.type())) {
openPush(event);
return;
}
if (CommitCommentEvent.equals(event.type())) {
openCommitComment(event);
return;
}
Issue issue = IssueEventMatcher.getIssue(event);
if (issue != null) {
Repository repo = ConvertUtils.eventRepoToRepo(event.repo());
viewIssue(issue, repo);
return;
}
Gist gist = GistEventMatcher.getGist(event);
if (gist != null) {
startActivity(GistsViewActivity.createIntent(gist));
return;
}
Repository repo = RepositoryEventMatcher.getRepository(event);
if (repo != null) {
viewRepository(repo);
}
UserPair users = UserEventMatcher.getUsers(event);
if (users != null) {
viewUser(users);
}
}
Aggregations