View Pager change dynamic height on scroll - android

I have a ViewPager and scrolling list view items but I want height of the ViewPager be dynamic based after list view scrolling. So When I scroll list view items towards view pager, three view pager on one screen should changing its height.
My ViewPager and list view looks like this.
and I want to achieve this view after scrolling my list view towards viewpager so first and third both corner view pager with middle one should change its view like this.
I tried Sticky Header library to achieve this but I didn't get success.
Please help me achieve this or is there any library to do this ?

Related

How to create a custom layout with cards scrolling horizontal and posts scrolling vertically( recycler view ) which should work with pagination

enter image description here
Here what I tried:
I can able to achieve this layout using Wrapping Horizontal scroll view and recyclerview inside Nestedscroll view.
The problem is :
When I put recycler view inside any of the scrolling containers such as scroll view or Nested scroll view
Its loading all the items in recylerview at once which is not a implementation of recylerview,hence pagination is not achieved.
Requirement:
1.Top header cards should scroll horizontally which is of a (fixed) Limited size.
2.Label for the vertical scroll view
3.Recycler view for vertical scroll of items
All the above should scroll vertically.Please help, or suggest any better way doing this layouot.enter image description here
Yes you can achieve this by having parent layout as <nestedScrollView> and in child you can take 2 recycler view of which one of them should be horizontal and another should be vertical.
set property android:nestedScrollingEnabled:true and your are good to go.

addHeaderView or addFooterView not available in Recycler VIew

I was trying to design my screen as of same in Swiggy App. First, it has horizontal recycler or horizontal scroll view.
Second, it has tab bar which will stick on the top once we will scroll up. Third, it has a vertical recycler view or maybe listView showing restaurants.
So, if we have vertical listView, it's very easy to stick that tab bar(view, the second thing on screen) on the top.
You can see an example here: https://dzone.com/articles/creating-a-listview-parallax-effect-with-a-sticky
But in case of RecyclerView, it doesn't have any direct method addHeaderView. So how do we implement this with RecyclerView.
Use getItemViewType method and create three view holders for first, middle and last items.
RecyclerView with multiple view type

how to use gridview in scrollview so that after grid view other layout also shows up?

I have to make a layout in following manner:
grid with all content showing and a footer but when I enclosed grid view in scroll view so that after grid view end the footer scrolls up, grid view height cuts into one row only. how to overcome that….
I searched online there is something called expandableheightgridview but it is totally out of my reach……
so, can you explain that or any other solution in detail.

HorizontalScrollView in View Pager

I have view pager with list of child views. Every child is horizontal view. When horizontal view is not active view pager not scroll to the next page. If horizontal view is active then It scrolls horizontally but in horizontal scroll view. I need to scroll to next page of view pager if the horizontal view is not active. So I don't know where to handle this action and how to do it.
The following is a complete example of how to implement a ViewPager with different fragment Types and different layout files.
Try This

How to scroll a view above a list view with the list view (Not with header views....)

So to be clear, I can solve this with a header view and trickiness, but I'd rather not.
I'd like to have a set of tabs (which also contains some profile information) above a view pager, which could have multiple pages, where each page has a list view. I'd like when you start scrolling initially, that the above tab / profile view will move with the list view (so if you try scrolling the list view, the area above scrolls up) and once the listview is scrolled down until it is at the first item, that the above view starts to scroll back into view.
This is not solveable with a header view, as far as I can tell, without stuffing this profile / tab view into the header of every list view the view pager holds, and to keep them in sync (which just sounds silly).
I feel there's a way I can make use of onInterceptTouchEvent with a custom layout / scrollview of sorts, any tips on doing this?

Categories

Resources