Question

As the title says I want to hide a listview's scrollbar when the listview isn't scrolling and show it when scrolling. I know this can be done very easy by setting "android:fadeScrollbars" as an application style if the API is 5 or newer. But I want the feature to be available on all android devices. So I've implemented the "setOnScrollListener" method, and switched the scrollbar visibility using the setVerticalScrollBarEnabled method. This works great on G2. The problem is that on Motorola Milestone the SCROLL_STATE_IDLE event isn't received when the scrolling stops, and so the scrollbar remains visible.

Thank you for reading!

Was it helpful?

Solution

Instead of using setOnScrollListener, I've used setOnTouchListener and switched the scrollbar's visibility at the MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP events.

OTHER TIPS

Whatever I could have said as a solution has already been done by you. Sorry! but thanks a lot for posting that this particular Moto has this issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top