Fix issue #71 - Fix colors for poll buttons

This commit is contained in:
Thomas 2022-05-19 16:17:59 +02:00
parent 59df0d65a7
commit cdeb2eb2db
1 changed files with 3 additions and 0 deletions

View File

@ -1001,6 +1001,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}); });
// --- POLL --- // --- POLL ---
if (statusToDeal.poll != null && statusToDeal.poll.options != null) { if (statusToDeal.poll != null && statusToDeal.poll.options != null) {
if (statusToDeal.poll.voted || statusToDeal.poll.expired) { if (statusToDeal.poll.voted || statusToDeal.poll.expired) {
holder.binding.poll.submitVote.setVisibility(View.GONE); holder.binding.poll.submitVote.setVisibility(View.GONE);
@ -1047,6 +1048,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
(holder.binding.poll.multipleChoice).removeAllViews(); (holder.binding.poll.multipleChoice).removeAllViews();
for (Poll.PollItem pollOption : statusToDeal.poll.options) { for (Poll.PollItem pollOption : statusToDeal.poll.options) {
CheckBox cb = new CheckBox(context); CheckBox cb = new CheckBox(context);
cb.setButtonTintList(ThemeHelper.getButtonColorStateList(context));
cb.setText(pollOption.span_title, TextView.BufferType.SPANNABLE); cb.setText(pollOption.span_title, TextView.BufferType.SPANNABLE);
holder.binding.poll.multipleChoice.addView(cb); holder.binding.poll.multipleChoice.addView(cb);
} }
@ -1057,6 +1059,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
(holder.binding.poll.singleChoiceRadioGroup).removeAllViews(); (holder.binding.poll.singleChoiceRadioGroup).removeAllViews();
for (Poll.PollItem pollOption : statusToDeal.poll.options) { for (Poll.PollItem pollOption : statusToDeal.poll.options) {
RadioButton rb = new RadioButton(context); RadioButton rb = new RadioButton(context);
rb.setButtonTintList(ThemeHelper.getButtonColorStateList(context));
rb.setText(pollOption.span_title, TextView.BufferType.SPANNABLE); rb.setText(pollOption.span_title, TextView.BufferType.SPANNABLE);
holder.binding.poll.singleChoiceRadioGroup.addView(rb); holder.binding.poll.singleChoiceRadioGroup.addView(rb);
} }