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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations