The programmatic constructor MaterialScrollBar(Context context, RecyclerView recyclerView, boolean lightOnTouch) cannot be used, because it calls method generalSetup(); which works with member field private TypedArray a; which in case of programmatic instantiation of this class is not initialized and the constructor fails on NullPointerException. The only workaround to create any of MaterialScrollBars by hand (i.e. using Anko) is to create XML layout with the scroll bar and inflate it using LayoutInflater.
The programmatic constructor MaterialScrollBar(Context context, RecyclerView recyclerView, boolean lightOnTouch) cannot be used, because it calls method generalSetup(); which works with member field private TypedArray a; which in case of programmatic instantiation of this class is not initialized and the constructor fails on NullPointerException. The only workaround to create any of MaterialScrollBars by hand (i.e. using Anko) is to create XML layout with the scroll bar and inflate it using LayoutInflater.