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

Re-adding a removed Indicator leads to crash #65

Closed awenger closed 8 years ago

awenger commented 8 years ago
fastScrollIndexIndicator = new CustomIndicator(this);
materialScrollBar.addIndicator(fastScrollIndexIndicator, true);
materialScrollBar.removeIndicator();
materialScrollBar.addIndicator(fastScrollIndexIndicator, true);
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first
awenger commented 8 years ago

Looking at the source it also looks that only a single Indicator is possible. Maybe the method should be renamed to setIndicator?

awenger commented 8 years ago

removing a Indicator while it is visible also makes it visible forever. I would expect that a removed indicator becomes invisible/gone/removed from the ui