Closed ghost closed 5 years ago
When calling setMarkerColor()
, pass a color value instead of a color resource id (e.g. R.color.colorPrimaryLight
).
You can get color value from color resource id by ContextCompat.getColor()
.
For examlpe,
MultiSelectToggleGroup interestsMultiSelectToggleGroup = findViewById(R.id.interests_multi_select_toggle_group);
String[] interests = {"Photography", "Hiking", "Skiing"};
for (String interest : interests) {
LabelToggle toggle = new LabelToggle(this);
toggle.setText(interest);
toggle.setMarkerColor(ContextCompat.getColor(this, R.color.colorPrimaryLight)); // get actual color value from resource id
interestsMultiSelectToggleGroup.addView(toggle);
}
will give you
Thanks a lot Man, works perfect. The owners of libraries usually don't help this much like you do. Can I have one more question here, or should I create a separate issue?
Of course. Please create a separate issue.
Hi @nex3z , Thanks for developing such a great library. I am using your library in my project, I would like to know how I can simply just use my own background and border color and everything else the same. Currently i am doing something like this:
But with this I am getting a greyish border and background color instead of my defined
colorPrimaryLight
.PS: You mentioned that we can use our custom buttons, but just for changing the background and border color, I don't think creating a whole new custom button is a good idea, plus I (beginner) am confused on how I can create a custom button (Complete Steps to create a custom button) . Please help me with this
Thanks in advance.