-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dinamicly disable IndexScroller #4
Comments
Hi, You can make method like this: public void hideMyScroller() { public void showMyScroller() { Ref Link: https://github.com/Abhan/ScrollableSideIndexer Thanks. |
Hi @nahba , Thanks |
@lcsd Do you use the latest version? In that version, IndexScroller is only displayed when it is not null. When you call setFastScrollEnabled(false), IndexScroller becomes null. I'm sorry that I have no environment for Android development now. So, first check the version of your code. |
@woozzu Exactly, when you you call setFastScrollEnabled(false), IndexScroller becomes null. And then when you scroll the list, onInterceptTouchEvent(..) is invoked which calls mScroller.contains(ev.getX(), ev.getY()) where the mScroller is NULL, and the app crashes. Same thing happens in onTouchEvent(..). Moreover when i call setFastScrollEnabled(true) to show again the Indexers, the object mIndexbarRect is NULL, so the app crashes again. Do you have something in mind about this? Thank you in advance! |
@icsd It seems that you already know what to change in the code. Could you submit a pull request? When it comes to mIndexbarRect, onSizeChanged() of IndexScroller must be called when ListView creates a new IndexScroller. |
I don't have a complete overview of the whole project, otherwise I would do a pull request. About mIndexarRect, onSizeChanged() is not called from the System (if I call setFastScrollEnabled(true) to show again the Indexers), so i don't know what arguments to pass if I invoke it manually. |
@icsd w, h are the current width and height of listview, respectively. And you can ignore oldw and oldh. |
I change adapter of listview, and a don't need IndexScroller on each.
How to disable or hide IndexScroller.
i've tired to setFastScrollEnabled, but only get NullPointerException
The text was updated successfully, but these errors were encountered: