use of io.plaidapp.data.api.dribbble.model.Comment in project plaid by nickbutcher.
the class DribbbleShot method postComment.
public void postComment(View view) {
if (dribbblePrefs.isLoggedIn()) {
if (TextUtils.isEmpty(enterComment.getText()))
return;
enterComment.setEnabled(false);
final Call<Comment> postCommentCall = dribbblePrefs.getApi().postComment(shot.id, enterComment.getText().toString().trim());
postCommentCall.enqueue(new Callback<Comment>() {
@Override
public void onResponse(Call<Comment> call, Response<Comment> response) {
loadComments();
enterComment.getText().clear();
enterComment.setEnabled(true);
}
@Override
public void onFailure(Call<Comment> call, Throwable t) {
enterComment.setEnabled(true);
}
});
} else {
Intent login = new Intent(DribbbleShot.this, DribbbleLogin.class);
FabTransform.addExtras(login, ContextCompat.getColor(DribbbleShot.this, R.color.background_light), R.drawable.ic_comment_add);
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(DribbbleShot.this, postComment, getString(R.string.transition_dribbble_login));
startActivityForResult(login, RC_LOGIN_COMMENT, options.toBundle());
}
}
Aggregations