use of com.github.pockethub.android.ui.comment.CommentListAdapter in project PocketHub by pockethub.
the class IssueFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
list = finder.find(android.R.id.list);
progress = finder.find(R.id.pb_loading);
LayoutInflater inflater = getLayoutInflater(savedInstanceState);
headerView = inflater.inflate(R.layout.issue_header, null);
stateText = (TextView) headerView.findViewById(R.id.tv_state);
titleText = (TextView) headerView.findViewById(R.id.tv_issue_title);
authorText = (TextView) headerView.findViewById(R.id.tv_issue_author);
createdDateText = (TextView) headerView.findViewById(R.id.tv_issue_creation_date);
creatorAvatar = (ImageView) headerView.findViewById(R.id.iv_avatar);
commitsView = (ViewGroup) headerView.findViewById(R.id.ll_issue_commits);
assigneeText = (TextView) headerView.findViewById(R.id.tv_assignee_name);
assigneeAvatar = (ImageView) headerView.findViewById(R.id.iv_assignee_avatar);
labelsArea = (TextView) headerView.findViewById(R.id.tv_labels);
milestoneArea = headerView.findViewById(R.id.ll_milestone);
milestoneText = (TextView) headerView.findViewById(R.id.tv_milestone);
milestoneProgressArea = headerView.findViewById(R.id.v_closed);
bodyText = (TextView) headerView.findViewById(R.id.tv_issue_body);
bodyText.setMovementMethod(SelectableLinkMovementMethod.getInstance());
loadingView = inflater.inflate(R.layout.loading_item, null);
footerView = inflater.inflate(R.layout.footer_separator, null);
commitsView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (IssueUtils.isPullRequest(issue)) {
openPullRequestCommits();
}
}
});
stateText.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (issue != null) {
stateTask.confirm(IssueState.open.equals(issue.state()));
}
}
});
milestoneArea.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (issue != null && canWrite) {
milestoneTask.prompt(issue.milestone());
}
}
});
headerView.findViewById(R.id.ll_assignee).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (issue != null && canWrite) {
assigneeTask.prompt(issue.assignee());
}
}
});
labelsArea.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (issue != null && canWrite) {
labelsTask.prompt(issue.labels());
}
}
});
Activity activity = getActivity();
String userName = AccountUtils.getLogin(activity);
adapter = new HeaderFooterListAdapter<>(list, new CommentListAdapter(activity.getLayoutInflater(), null, avatars, commentImageGetter, editCommentListener, deleteCommentListener, userName, canWrite, issue));
list.setAdapter(adapter);
}
use of com.github.pockethub.android.ui.comment.CommentListAdapter in project PocketHub by pockethub.
the class GistFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
list = finder.find(android.R.id.list);
progress = finder.find(R.id.pb_loading);
Activity activity = getActivity();
User user = gist.owner();
String userName = null;
if (user != null) {
userName = user.login();
}
adapter = new HeaderFooterListAdapter<>(list, new CommentListAdapter(activity.getLayoutInflater(), null, avatars, imageGetter, editCommentListener, deleteCommentListener, userName, isOwner(), null));
list.setAdapter(adapter);
}
Aggregations