Closed draskosaric closed 5 years ago
Hi, If you create your own AppSegmentViewHolder, you need to handle segment design inside your view holder. All attributes data from xml are available in segmentData filed inside SegmentViewHolder.class. Use Utils.class from library, it is pubic helper class for segment decoration, defining segment's current position radius, background and etc. will be much easier. Also check out, how Utils.class is used in default SegmentViewHolderImpl.class
Hi,
I have a segmented control which has imageViews instead of TextViews. None of xml attributes (
radius
,selectedBackgroundColor
,unSelectedBackgroundColor
,selectedStrokeColor
,unSelectedStrokeColor
,focusedBackgroundColor
) are visible on control. How can I set them programmatically? I managed to set background color.This is
item_segment.xml
:These are adapter and ViewHolder:
Next is xml code in
home_fragment.xml
:And finally, there is code of setting the view in fragment:
This is how it looks like:
Please, help.
Thanks in advance!