void linkToScrollBar(MaterialScrollBar msb, boolean addSpace) {
        this.addSpace = addSpace;
        materialScrollBar = msb;

        if(addSpace) {
            size = Utils.getDP(15, this)  + materialScrollBar.handleThumb.getWidth();
        } else {
            size = Utils.getDP(2, this)  + materialScrollBar.handleThumb.getWidth();
        }

        ViewCompat.setBackground(this, ContextCompat.getDrawable(context, rtl ? R.drawable.indicator_ltr : R.drawable.indicator));

        LayoutParams lp = new LayoutParams(Utils.getDP(getIndicatorWidth(), this), Utils.getDP(getIndicatorHeight(), this));
        lp = refreshMargins(lp);

        textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, getTextSize());
        LayoutParams tvlp = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
        tvlp.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);

        addView(textView, tvlp);

        ((GradientDrawable)getBackground()).setColor(msb.handleColor);

        if(rtl) {
            lp.addRule(ALIGN_LEFT, msb.getId());
        } else {
            lp.addRule(ALIGN_RIGHT, msb.getId());
        }
        ((ViewGroup)msb.getParent()).addView(this, lp);
    }
Devs should not normally need to extend this class. Just use {@link CustomIndicator} instead.
However, this is public to leave the option open.

T is the interface needed in the corresponding {@link RecyclerView.Adapter}.
U is the sub-class of indicator.
The second parameter for the constructor is the class of T.
lib/src/main/java/com/turingtechnologies/materialscrollbar/Indicator.java