use of com.github.pockethub.android.ui.item.commit.CommitCommentItem in project PocketHub by pockethub.
the class CommitDiffListFragment method updateItems.
private void updateItems(List<GitComment> comments, List<FullCommitFile> files) {
filesSection.update(createFileSections(files));
List<CommitCommentItem> items = new ArrayList<>();
for (GitComment comment : comments) {
items.add(new CommitCommentItem(avatars, commentImageGetter, comment));
}
commentSection.update(items);
}
use of com.github.pockethub.android.ui.item.commit.CommitCommentItem in project PocketHub by pockethub.
the class CommitDiffListFragment method createFileSections.
private List<Section> createFileSections(List<FullCommitFile> files) {
List<Section> sections = new ArrayList<>();
for (FullCommitFile file : files) {
Section section = new Section(new CommitFileHeaderItem(getActivity(), file.getFile()));
List<CharSequence> lines = diffStyler.get(file.getFile().filename());
int number = 0;
for (CharSequence line : lines) {
section.add(new CommitFileLineItem(diffStyler, line));
for (GitComment comment : file.get(number)) {
section.add(new CommitCommentItem(avatars, commentImageGetter, comment, true));
}
number++;
}
sections.add(section);
}
return sections;
}
Aggregations