use of com.meisolsson.githubsdk.model.Repository in project PocketHub by pockethub.
the class RepositoryListFragment method onListItemLongClick.
@Override
public boolean onListItemLongClick(ListView list, View v, int position, long itemId) {
if (!isUsable()) {
return false;
}
final Repository repo = (Repository) list.getItemAtPosition(position);
if (repo == null) {
return false;
}
MaterialDialog.Builder builder = new MaterialDialog.Builder(getActivity()).title(InfoUtils.createRepoId(repo));
final MaterialDialog[] dialogHolder = new MaterialDialog[1];
View view = getActivity().getLayoutInflater().inflate(R.layout.repo_dialog, null);
ViewFinder finder = new ViewFinder(view);
final User owner = repo.owner();
avatars.bind(finder.imageView(R.id.iv_owner_avatar), owner);
finder.setText(R.id.tv_owner_name, getString(R.string.navigate_to_user, owner.login()));
finder.onClick(R.id.ll_owner_area, new OnClickListener() {
@Override
public void onClick(View v) {
dialogHolder[0].dismiss();
viewUser(owner);
}
});
if ((recentRepos != null) && (recentRepos.contains(repo))) {
finder.find(R.id.divider).setVisibility(View.VISIBLE);
finder.find(R.id.ll_recent_repo_area).setVisibility(View.VISIBLE);
finder.onClick(R.id.ll_recent_repo_area, new OnClickListener() {
@Override
public void onClick(View v) {
dialogHolder[0].dismiss();
recentRepos.remove(repo);
refresh();
}
});
}
builder.customView(view, false);
MaterialDialog dialog = builder.build();
dialogHolder[0] = dialog;
dialog.setCanceledOnTouchOutside(true);
dialog.show();
return true;
}
use of com.meisolsson.githubsdk.model.Repository in project PocketHub by pockethub.
the class RepositoryListFragment method onListItemClick.
@Override
public void onListItemClick(ListView list, View v, int position, long id) {
Repository repo = (Repository) list.getItemAtPosition(position);
if (recentRepos != null) {
recentRepos.add(repo);
}
startActivityForResult(RepositoryViewActivity.createIntent(repo), REPOSITORY_VIEW);
}
use of com.meisolsson.githubsdk.model.Repository in project PocketHub by pockethub.
the class UserRepositoryListFragment method onListItemClick.
@Override
public void onListItemClick(ListView list, View v, int position, long id) {
Repository repo = (Repository) list.getItemAtPosition(position);
startActivityForResult(RepositoryViewActivity.createIntent(repo), REPOSITORY_VIEW);
}
use of com.meisolsson.githubsdk.model.Repository in project PocketHub by pockethub.
the class CommitFileViewActivity method onCreateLoader.
@Override
public Loader<CharSequence> onCreateLoader(int loader, Bundle args) {
final String raw = args.getString(ARG_TEXT);
final Repository repo = args.getParcelable(ARG_REPO);
return new MarkdownLoader(this, repo, raw, imageGetter, false);
}
use of com.meisolsson.githubsdk.model.Repository in project PocketHub by pockethub.
the class IconAndViewTextManager method formatTeamAdd.
void formatTeamAdd(GitHubEvent event, StyledText main, StyledText details) {
boldActor(main, event);
main.append(" added ");
TeamAddPayload payload = (TeamAddPayload) event.payload();
Repository repo = payload.repository();
String repoName = repo != null ? repo.name() : null;
if (repoName != null) {
main.bold(repoName);
}
main.append(" to team");
Team team = payload.team();
String teamName = team != null ? team.name() : null;
if (teamName != null) {
main.append(' ').bold(teamName);
}
}
Aggregations