VerticalViewPager inside ViewPager - java

I want a parent ViewPager (Horizontal Scroll) that will have fragments inside it and in each fragment i want a ViewPager (Vertical Scroll) displaying some static data.
I have implemented this but i am not able to scroll horizontally. Any solution?


Android how do I get the Visible height of a View

I have a ViewPager that is surrounded by a ScrollView.
I am trying to determine just the visible height of the ViewPager (since it is longer than the screen).

HorizontalScrollView inside PagerAdapter

When I add ScrollView inside pager and scroll right it is scrolling between pages, and not inside the ScrollView.
How do I prevent scrolling between pages until the condition happens?
How do I make it scroll inside ScrollView until reaching the end, then scrolling between pages?

NestedScrollView clipping content

I am currently having issues with one of my activities, I am using a collapsible toolbar layout and a nestedscrollview directly under to house content. When the toolbar has collapsed fully, the NestedScrollView doesn't expand and scroll with any content that falls out of it's initial bounds, and instead cuts the content as shown in these images:
You can see by the bottom image that the contents of the CardView are being hidden due to the issue. Here is a link to a gist which includes my activity layout xml.
Thanks for any help in advance.

Android ViewPager Detect Vertical Swipe

I would like to allow the ViewPager to swipe normally to the right/left as it is and detect Vertical Flings. I tried to assign a GestureDetector but the problem is that returning true from the method public boolean onDown(MotionEvent e) disables the normal horizontal swiping of the ViewPager. Any ideas how to allow both?
There are already some custom controls for this. Try looking into these threads of how to implement a Vertical ViewPager.
How to put Vertically swiped ViewPager in a Horizontally swiped ViewPager
Hope this helps.:)

GridView and custom child View - how to setup the layout params

I want to have GridView with custom view. The custom view is simply RelativeLayout wirg 2 ImageViews. I want that there is no vertical and horizontal spacing between items and the GridLayout has 4 columns when screen orientation is vertical and 7 columns when orientation is horizontal. Of course I want the child views to adjust their sizes in order to fullfill the above requirements.
How to define the layout xmls?