Search in sources :

Example 1 with Entry

use of com.github.pockethub.android.core.code.FullTree.Entry in project PocketHub by pockethub.

the class CodeTreeAdapter method update.

@Override
protected void update(final int position, final Object item, final int type) {
    if (indented) {
        updater.view.setPadding(indentedPaddingLeft, paddingTop, paddingRight, paddingBottom);
    } else {
        updater.view.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
    }
    switch(type) {
        case TYPE_BLOB:
            Entry file = (Entry) item;
            setText(0, file.name);
            setText(1, Formatter.formatFileSize(context, file.entry.size()));
            break;
        case TYPE_TREE:
            Folder folder = (Folder) item;
            setText(0, CommitUtils.getName(folder.name));
            setNumber(1, folder.folders.size());
            setNumber(2, folder.files.size());
            break;
    }
}
Also used : Entry(com.github.pockethub.android.core.code.FullTree.Entry) Folder(com.github.pockethub.android.core.code.FullTree.Folder)

Aggregations

Entry (com.github.pockethub.android.core.code.FullTree.Entry)1 Folder (com.github.pockethub.android.core.code.FullTree.Folder)1