Skip to content
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

Fix scrollbars #13

Closed
wants to merge 2 commits into from
Closed

Fix scrollbars #13

wants to merge 2 commits into from

Conversation

Mygod
Copy link
Contributor

@Mygod Mygod commented Feb 9, 2016

This solution is based on NeoSpb's (see #12). Yet simpler and more flexible I think.

I haven't thoroughly tested this but it should work and you should get the idea. 😄

@gregkorossy
Copy link
Owner

I finally had some time to review the things. As I see, you still don't need to use reflections nor custom classes. Calling getListView().scrollBy(0, 0) in onResume() does the same thing. Quoting from the description of awakenScrollBars():

This method is automatically invoked by scrollBy(int, int) and scrollTo(int, int).

@Mygod
Copy link
Contributor Author

Mygod commented Feb 19, 2016

You're right! I've fixed it now.

@gregkorossy
Copy link
Owner

I wish we could just enable vertical scrollbars from code instead of using custom styles for that. I was trying to debug the process of initializing scrollbars in a View because calling certain methods seems to do the same thing as declaring scrollbars="vertical" in the layout (or in the styles in our case), but no luck so far...

@Mygod
Copy link
Contributor Author

Mygod commented Feb 19, 2016

If I remember correctly, it's easier to disable scrollbars than to enable them in code because of a bug.

EDIT: Found it.

…reference-V7-Fix

Update to 23.2.0.

Conflicts:
	app/src/main/java/android/support/v7/preference/PreferenceFragmentCompatFix.java
@Mygod Mygod mentioned this pull request Jul 19, 2016
@Mygod
Copy link
Contributor Author

Mygod commented Mar 17, 2017

http://gph.is/2csjxsu

@gregkorossy
Copy link
Owner

gregkorossy commented Mar 17, 2017

Is this really needed? Even the Settings in Android has no scrollbars (at least on my HTC).

@Mygod
Copy link
Contributor Author

Mygod commented Mar 17, 2017

@Gericop There is one on my Lineage OS 14.1.

@gregkorossy
Copy link
Owner

Checked this, the Java modification is not needed anymore, the scrollbars automatically show up and fade away with the XML only. If I can create a solution such that the scrollbars can be turned on / off with a single XML attribute, I'll add it to the styles.

@Mygod
Copy link
Contributor Author

Mygod commented Mar 30, 2017

I don't think it hurts to have a scrollbar.

@FranckRJ
Copy link

I would like to have a scrollbar too, Settings on Android 8.0 (Nexus 5X) has a scrollbar.

@gregkorossy
Copy link
Owner

Scrollbars enabled in v27.0.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants