diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java index c16169b04..c00edada3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java @@ -5,6 +5,7 @@ import android.graphics.drawable.Animatable; import android.graphics.drawable.Drawable; import android.view.View; import android.view.ViewGroup; +import android.widget.ImageView; import android.widget.TextView; import org.joinmastodon.android.R; @@ -60,7 +61,8 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{ public static class Holder extends StatusDisplayItem.Holder implements ImageLoaderViewHolder{ private final TextView text, percent; - private final View icon, button; + private final View button; + private final ImageView icon; private final Drawable progressBg; public Holder(Activity activity, ViewGroup parent){ @@ -76,9 +78,12 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{ @Override public void onBind(PollOptionStatusDisplayItem item){ text.setText(item.text); -// icon.setVisibility(item.showResults ? View.GONE : View.VISIBLE); percent.setVisibility(item.showResults ? View.VISIBLE : View.GONE); itemView.setClickable(!item.showResults); + icon.setImageDrawable(itemView.getContext().getDrawable(item.poll.multiple ? + item.showResults ? R.drawable.ic_poll_checkbox_regular_selector : R.drawable.ic_poll_checkbox_filled_selector : + item.showResults ? R.drawable.ic_poll_option_button : R.drawable.ic_fluent_radio_button_24_selector + )); if(item.showResults){ progressBg.setLevel(Math.round(10000f*item.votesFraction)); button.setBackground(progressBg); diff --git a/mastodon/src/main/res/drawable/ic_fluent_checkbox_checked_24_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_checkbox_checked_24_filled.xml new file mode 100644 index 000000000..fa9b028b3 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_checkbox_checked_24_filled.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_checkbox_checked_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_checkbox_checked_24_regular.xml new file mode 100644 index 000000000..033e1a14d --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_checkbox_checked_24_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_checkbox_unchecked_24_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_checkbox_unchecked_24_filled.xml new file mode 100644 index 000000000..49398070b --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_checkbox_unchecked_24_filled.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_checkbox_unchecked_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_checkbox_unchecked_24_regular.xml new file mode 100644 index 000000000..792b97833 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_checkbox_unchecked_24_regular.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_radio_button_24_filled.xml b/mastodon/src/main/res/drawable/ic_fluent_radio_button_24_filled.xml new file mode 100644 index 000000000..179f464bc --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_radio_button_24_filled.xml @@ -0,0 +1,3 @@ + + + diff --git a/mastodon/src/main/res/drawable/ic_fluent_radio_button_24_selector.xml b/mastodon/src/main/res/drawable/ic_fluent_radio_button_24_selector.xml new file mode 100644 index 000000000..80162e2b7 --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_fluent_radio_button_24_selector.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/mastodon/src/main/res/drawable/ic_poll_checkbox_filled_selector.xml b/mastodon/src/main/res/drawable/ic_poll_checkbox_filled_selector.xml new file mode 100644 index 000000000..1e03f145c --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_poll_checkbox_filled_selector.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/mastodon/src/main/res/drawable/ic_poll_checkbox_regular_selector.xml b/mastodon/src/main/res/drawable/ic_poll_checkbox_regular_selector.xml new file mode 100644 index 000000000..e22f22dea --- /dev/null +++ b/mastodon/src/main/res/drawable/ic_poll_checkbox_regular_selector.xml @@ -0,0 +1,7 @@ + + + + + + +