use of org.wordpress.android.models.CommentList in project WordPress-Android by wordpress-mobile.
the class CommentsListFragment method moderateSelectedComments.
private void moderateSelectedComments(final CommentStatus newStatus) {
final CommentList selectedComments = getAdapter().getSelectedComments();
final CommentList updateComments = new CommentList();
// build list of comments whose status is different than passed
for (CommentModel comment : selectedComments) {
if (CommentStatus.fromString(comment.getStatus()) != newStatus) {
updateComments.add(comment);
}
}
if (updateComments.size() == 0)
return;
if (!NetworkUtils.checkConnection(getActivity()))
return;
getAdapter().clearSelectedComments();
finishActionMode();
moderateComments(updateComments, newStatus);
}
use of org.wordpress.android.models.CommentList in project WordPress-Android by wordpress-mobile.
the class CommentsListFragment method deleteSelectedComments.
private void deleteSelectedComments(boolean deletePermanently) {
if (!NetworkUtils.checkConnection(getActivity())) {
return;
}
final int dlgId = deletePermanently ? CommentDialogs.ID_COMMENT_DLG_DELETING : CommentDialogs.ID_COMMENT_DLG_TRASHING;
final CommentList selectedComments = getAdapter().getSelectedComments();
CommentStatus newStatus = CommentStatus.TRASH;
if (deletePermanently) {
newStatus = CommentStatus.DELETED;
}
dismissDialog(dlgId);
finishActionMode();
moderateComments(selectedComments, newStatus);
}
Aggregations