@Override
    protected String getTextElement(Integer currentSection, ICustomAdapter adapter) {
        String text = adapter.getCustomStringForElement(currentSection);
        LayoutParams layoutParams = (LayoutParams) getLayoutParams();
        if(layoutParams == null) {
            return "";
        }
        Paint paint = new Paint();
        paint.setTextSize(textSize);
        int width = Utils.getDP((int) paint.measureText(text), context) + Utils.getDP(30, context);
        if(width < Utils.getDP(75, context)) {
            width = Utils.getDP(75, context);
        }
        layoutParams.width = width;
        setLayoutParams(layoutParams);
        return text;
    }
Indicator which should be used in all other cases.
lib/src/main/java/com/turingtechnologies/materialscrollbar/CustomIndicator.java