Search in sources :

Example 1 with Builder

use of com.github.pockethub.android.Intents.Builder in project PocketHub by pockethub.

the class EditIssueActivity method createIntent.

/**
     * Create intent to edit an issue
     *
     * @param issue
     * @param repositoryOwner
     * @param repositoryName
     * @param user
     * @return intent
     */
public static Intent createIntent(final Issue issue, final String repositoryOwner, final String repositoryName, final User user) {
    Builder builder = new Builder("repo.issues.edit.VIEW");
    if (user != null) {
        builder.add(EXTRA_USER, user);
    }
    builder.add(EXTRA_REPOSITORY_NAME, repositoryName);
    builder.add(EXTRA_REPOSITORY_OWNER, repositoryOwner);
    if (issue != null) {
        builder.issue(issue);
    }
    return builder.toIntent();
}
Also used : Builder(com.github.pockethub.android.Intents.Builder)

Example 2 with Builder

use of com.github.pockethub.android.Intents.Builder in project PocketHub by pockethub.

the class GistsViewActivity method createIntent.

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

Example 3 with Builder

use of com.github.pockethub.android.Intents.Builder in project PocketHub by pockethub.

the class CommitViewActivity method createIntent.

/**
 * Create intent for this activity
 *
 * @param repository
 * @param position
 * @param ids
 * @return intent
 */
public static Intent createIntent(final Repository repository, final int position, final String... ids) {
    Builder builder = new Builder("commits.VIEW");
    builder.add(EXTRA_POSITION, position);
    builder.add(EXTRA_BASES, ids);
    builder.repo(repository);
    return builder.toIntent();
}
Also used : Builder(com.github.pockethub.android.Intents.Builder)

Example 4 with Builder

use of com.github.pockethub.android.Intents.Builder in project PocketHub by pockethub.

the class EditCommentActivity method createIntent.

/**
 * Create intent to edit a comment
 *
 * @param gist
 * @return intent
 */
public static Intent createIntent(Gist gist, GitHubComment comment) {
    Builder builder = new Builder("gist.comment.edit.VIEW");
    builder.gist(gist);
    builder.add(EXTRA_COMMENT, comment);
    return builder.toIntent();
}
Also used : Builder(com.github.pockethub.android.Intents.Builder)

Example 5 with Builder

use of com.github.pockethub.android.Intents.Builder 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

Builder (com.github.pockethub.android.Intents.Builder)14 Gist (com.meisolsson.githubsdk.model.Gist)2 Issue (com.meisolsson.githubsdk.model.Issue)2 MenuItem (android.view.MenuItem)1 GistItem (com.github.pockethub.android.ui.item.gist.GistItem)1 Repository (com.meisolsson.githubsdk.model.Repository)1 User (com.meisolsson.githubsdk.model.User)1 Item (com.xwray.groupie.Item)1 ArrayList (java.util.ArrayList)1