use of com.github.pockethub.android.ui.item.TextItem in project PocketHub by pockethub.
the class CommitDiffListFragment method updateList.
private void updateList(Commit commit, List<GitComment> comments, List<FullCommitFile> files) {
if (!isAdded()) {
return;
}
this.commit = commit;
this.comments = comments;
this.files = files;
updateHeader(commit);
mainSection.removeFooter();
filesSection.setHeader(new TextItem(R.layout.commit_file_details_header, R.id.tv_commit_file_summary, CommitUtils.formatStats(commit.files())));
updateItems(comments, files);
}
use of com.github.pockethub.android.ui.item.TextItem in project PocketHub by pockethub.
the class CommitCompareListFragment method updateList.
private void updateList(CommitCompare compare) {
if (!isAdded()) {
return;
}
this.compare = compare;
progress.setVisibility(View.GONE);
list.setVisibility(View.VISIBLE);
List<Commit> commits = compare.commits();
if (!commits.isEmpty()) {
String comparingCommits = getString(R.string.comparing_commits);
String text = MessageFormat.format(comparingCommits, commits.size());
commitsSection.setHeader(new TextItem(R.layout.commit_details_header, R.id.tv_commit_summary, text));
List<CommitItem> items = new ArrayList<>();
for (Commit commit : commits) {
items.add(new CommitItem(avatars, commit));
}
commitsSection.update(items);
}
List<GitHubFile> files = compare.files();
if (!files.isEmpty()) {
filesSection.setHeader(new TextItem(R.layout.commit_compare_file_details_header, R.id.tv_commit_file_summary, CommitUtils.formatStats(files)));
filesSection.update(createFileSections(files));
}
}
Aggregations