-
Notifications
You must be signed in to change notification settings - Fork 529
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
Can't scroll vertically in 3.0 #371
Comments
I think the difference here is that Caldroid now calculates height of the viewpager correctly so it can be used safely in scrollview (previously client would need to wrap CaldroidFragment inside a fix height LinearLayout instead of wrap_content if it's used inside scrollview). And also now instead of scrolling the fragment, I modified the sample so it scrolls the whole screen instead. If you turn phone to landscape I believe you could scroll the whole screen vertically |
Thanks @thomasdao Not exactly related to this issue's description, but I've created a PR (#376) that fixes the issues I was having with scrolling |
Ok, I finally found why GridView is not handling scrolling on this library. To me, it was very weird that a GridView was wrapped by a ScrollView, and I didn't want the whole View (month name + calendar) to scroll but only the Calendar. Here goes the explanation: Since InfiniteViewPager's height is fixed and all rows fit in, all of the GridView's children are considered to be visible, because their mBottom property is always above GridViews mBottom. Hence, when the GridView is asked if it needs scrolling, it always says "No, I'm ok, all of my views are visible". I've forked Caldroid and removed the onMeasure in InfiniteViewPager, which inmediately resulted in GridView taking control of scrolling. Since I haven't seen anyone complain about this, I'll leave that code in my fork. You can now close this issue, but I would expect more people to complain about it. If anyone is interested on how an AbsListView decides whether it needs scrolling or not, check https://github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/AbsListView.java#L4912 |
PR #376 is still valid and will prevent unwanted scrolling when adding verticalSpacing |
Hi, I upgraded to Caldroid 3.0 and I can't scroll vertical anymore when the phone is in landscape.
The only difference I can see (using Android Device Monitor) is that the ViewPager (presumably managed by InfiniteViewPager) is focusable, whereas on 2.2.1 it wasn't.
You made some changes to InfiniteViewPager (75117ee#diff-573a72554170d4605348f2a96c1d3eb1), but I don't see how that could affect the scrolling.
This might be more a StackOverflow question, but maybe you are aware of a change that could result in this behaviour.
The text was updated successfully, but these errors were encountered: