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