turing-tech / MaterialScrollBar

An Android library that brings the Material Design 5.1 sidebar to pre-5.1 devices.
Apache License 2.0
781 stars 126 forks source link

ScrollBar is not shown #85

Open m190 opened 7 years ago

m190 commented 7 years ago

Hi,

I noticed that since v12 the ScrollBar (used programmatically) is not shown. The same configuration for v10 and v11 is working without problem.

DragScrollBar materialScrollBar = new DragScrollBar(this, recyclerView, true);
materialScrollBar.setIndicator(new AlphabetIndicator(this), true);
turing-tech commented 7 years ago

After version 11, programmatic addition is no longer fully supported, since it was a massive headache to maintain. You should either switch to XML or, if you want to keep going the programmatic route, you'll need to set the alignment and everything yourself. In theory there should be no problem as long as you set the rules the same as the library did in earlier versions (alignEnd, alignParentTop, alignParentBottom).

m190 commented 7 years ago

Do you have any working example? Earlier, the example provided, was enough.

turing-tech commented 7 years ago

Look at the code removed in this commit to see how it used to work. https://github.com/turing-tech/MaterialScrollBar/commit/8adc930fcdb093f0aac4d801975b6b8a3e4976e3

In short, adding align end, algin top, and align bottom should do the trick.