fix poll button being visible below voted poll (#1612)

This commit is contained in:
Konrad Pozniak 2019-12-31 16:56:04 +01:00 committed by GitHub
parent 8a9d62e654
commit 88d59da13c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -215,8 +215,11 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
LinkHelper.setClickableText(this.content, emojifiedText, mentions, listener);
if (poll != null) {
setupPoll(poll, emojis, listener);
} else {
hidePoll();
}
} else {
hidePoll();
LinkHelper.setClickableMentions(this.content, mentions, listener);
}
if (TextUtils.isEmpty(this.content.getText())) {
@ -224,14 +227,12 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
} else {
this.content.setVisibility(View.VISIBLE);
}
setPollVisible(poll != null && expanded);
}
private void setPollVisible(boolean visible) {
int visibility = visible ? View.VISIBLE : View.GONE;
pollButton.setVisibility(visibility);
pollDescription.setVisibility(visibility);
pollOptions.setVisibility(visibility);
private void hidePoll() {
pollButton.setVisibility(View.GONE);
pollDescription.setVisibility(View.GONE);
pollOptions.setVisibility(View.GONE);
}
private void setAvatar(String url,