Search in sources :

Example 1 with Section

use of com.xwray.groupie.Section 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;
}
Also used : FullCommitFile(com.github.pockethub.android.core.commit.FullCommitFile) CommitFileHeaderItem(com.github.pockethub.android.ui.item.commit.CommitFileHeaderItem) CommitFileLineItem(com.github.pockethub.android.ui.item.commit.CommitFileLineItem) ArrayList(java.util.ArrayList) CommitCommentItem(com.github.pockethub.android.ui.item.commit.CommitCommentItem) GitComment(com.meisolsson.githubsdk.model.git.GitComment) Section(com.xwray.groupie.Section)

Example 2 with Section

use of com.xwray.groupie.Section in project PocketHub by pockethub.

the class CommitCompareListFragment method createFileSections.

private List<Section> createFileSections(List<GitHubFile> files) {
    List<Section> sections = new ArrayList<>();
    for (GitHubFile file : files) {
        Section section = new Section(new CommitFileHeaderItem(getActivity(), file));
        List<CharSequence> lines = diffStyler.get(file.filename());
        for (CharSequence line : lines) {
            section.add(new CommitFileLineItem(diffStyler, line));
        }
        sections.add(section);
    }
    return sections;
}
Also used : CommitFileHeaderItem(com.github.pockethub.android.ui.item.commit.CommitFileHeaderItem) CommitFileLineItem(com.github.pockethub.android.ui.item.commit.CommitFileLineItem) ArrayList(java.util.ArrayList) GitHubFile(com.meisolsson.githubsdk.model.GitHubFile) Section(com.xwray.groupie.Section)

Aggregations

CommitFileHeaderItem (com.github.pockethub.android.ui.item.commit.CommitFileHeaderItem)2 CommitFileLineItem (com.github.pockethub.android.ui.item.commit.CommitFileLineItem)2 Section (com.xwray.groupie.Section)2 ArrayList (java.util.ArrayList)2 FullCommitFile (com.github.pockethub.android.core.commit.FullCommitFile)1 CommitCommentItem (com.github.pockethub.android.ui.item.commit.CommitCommentItem)1 GitHubFile (com.meisolsson.githubsdk.model.GitHubFile)1 GitComment (com.meisolsson.githubsdk.model.git.GitComment)1