Search in sources :

Example 6 with Builder

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

the class BranchFileViewActivity method createIntent.

/**
 * Create intent to show file in commit
 *
 * @param repository
 * @param branch
 * @param file
 * @param blobSha
 * @return intent
 */
public static Intent createIntent(Repository repository, String branch, String file, String blobSha) {
    Builder builder = new Builder("branch.file.VIEW");
    builder.repo(repository);
    builder.add(EXTRA_BASE, blobSha);
    builder.add(EXTRA_PATH, file);
    builder.add(EXTRA_HEAD, branch);
    return builder.toIntent();
}
Also used : Builder(com.github.pockethub.android.Intents.Builder)

Example 7 with Builder

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

the class CommitFileViewActivity method createIntent.

/**
 * Create intent to show file in commit
 *
 * @param repository
 * @param commit
 * @param file
 * @return intent
 */
public static Intent createIntent(Repository repository, String commit, GitHubFile file) {
    Builder builder = new Builder("commit.file.VIEW");
    builder.repo(repository);
    builder.add(EXTRA_HEAD, commit);
    builder.add(EXTRA_PATH, file.filename());
    builder.add(EXTRA_BASE, file.sha());
    return builder.toIntent();
}
Also used : Builder(com.github.pockethub.android.Intents.Builder)

Example 8 with Builder

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

the class CreateCommentActivity method createIntent.

/**
 * Create intent to create a comment on a diff position
 *
 * @param repository
 * @param commit
 * @param path
 * @param position
 * @return intent
 */
public static Intent createIntent(Repository repository, String commit, String path, int position) {
    Builder builder = new Builder("commit.comment.create.VIEW");
    builder.repo(repository);
    builder.add(EXTRA_BASE, commit);
    if (isLineComment(path, position)) {
        builder.add(EXTRA_PATH, path).add(EXTRA_POSITION, position);
    }
    return builder.toIntent();
}
Also used : Builder(com.github.pockethub.android.Intents.Builder)

Example 9 with Builder

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

the class CreateCommentActivity method createIntent.

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

Example 10 with Builder

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

the class CreateCommentActivity method createIntent.

/**
 * Create intent to create a comment
 *
 * @param repoId
 * @param issueNumber
 * @param user
 * @return intent
 */
public static Intent createIntent(Repository repoId, int issueNumber, User user) {
    Builder builder = new Builder("issue.comment.create.VIEW");
    builder.repo(repoId);
    builder.add(EXTRA_ISSUE_NUMBER, issueNumber);
    builder.add(EXTRA_USER, user);
    return builder.toIntent();
}
Also used : 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