Search in sources :

Example 1 with GistItem

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

the class GistsViewActivity method createIntent.

/**
 * Create an intent to show gists with an initial selected Gist
 *
 * @param items
 * @param position
 * @return intent
 */
public static Intent createIntent(List<Item> items, int position) {
    String[] ids = new String[items.size()];
    int index = 0;
    for (Item item : items) {
        Gist gist = ((GistItem) item).getGist();
        ids[index++] = gist.id();
    }
    return new Builder("gists.VIEW").add(EXTRA_GIST_IDS, (Serializable) ids).add(EXTRA_POSITION, position).toIntent();
}
Also used : GistItem(com.github.pockethub.android.ui.item.gist.GistItem) MenuItem(android.view.MenuItem) Item(com.xwray.groupie.Item) Gist(com.meisolsson.githubsdk.model.Gist) GistItem(com.github.pockethub.android.ui.item.gist.GistItem) Builder(com.github.pockethub.android.Intents.Builder)

Aggregations

MenuItem (android.view.MenuItem)1 Builder (com.github.pockethub.android.Intents.Builder)1 GistItem (com.github.pockethub.android.ui.item.gist.GistItem)1 Gist (com.meisolsson.githubsdk.model.Gist)1 Item (com.xwray.groupie.Item)1