Search in sources :

Example 1 with GistFileItem

use of com.github.pockethub.android.ui.item.gist.GistFileItem in project PocketHub by pockethub.

the class GistFragment method updateFiles.

private void updateFiles(Gist gist) {
    final Activity activity = getActivity();
    if (activity == null) {
        return;
    }
    Map<String, GistFile> files = gist.files();
    if (files == null || files.isEmpty()) {
        filesSection.update(Collections.emptyList());
        return;
    }
    List<GistFileItem> fileItems = new ArrayList<>();
    for (GistFile file : files.values()) {
        fileItems.add(new GistFileItem(file));
    }
    filesSection.update(fileItems);
}
Also used : GistFileItem(com.github.pockethub.android.ui.item.gist.GistFileItem) ArrayList(java.util.ArrayList) FragmentActivity(android.support.v4.app.FragmentActivity) Activity(android.app.Activity) GistFile(com.meisolsson.githubsdk.model.GistFile)

Aggregations

Activity (android.app.Activity)1 FragmentActivity (android.support.v4.app.FragmentActivity)1 GistFileItem (com.github.pockethub.android.ui.item.gist.GistFileItem)1 GistFile (com.meisolsson.githubsdk.model.GistFile)1 ArrayList (java.util.ArrayList)1