RecylerView with a fixed first row as header - android

I would like to create a recycler view with a fixed first row, which should act as the header. Also ,how can I prevent it from scrolling with other row elements ?

Don't put your fixed header in the RecyclerView. Wrap the RecyclerView in a vertical LinearLayout, with your fixed header above it.

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.

Recycler view cant wrap height of its children items

Am trying to use RecyclerView but it cant show all the items of its children, but i want to show all the items
The list Items were wrapped in a Linear Layout i changed it and wrapped it in a Relative layout and it solved the problem

Android listview items with horizontal scroll

I would like to use horizontall scrolling items in a vertically scrolling Listview.
Note that the items should scroll horizontally independently of the other items, i.e the whole list should not scroll sideways when dragging sideways.
Take vertical scroll first and in that vertical view take a table row and in that row take Horizontal View. Do these as many time as much you need horizontal view in vertical scroll view......
for easy implementation use TABLE and its Rows instead of vertical view
This should be the code for you list-view-item:
<ScrollView
....attrs...>
<!---Your layout---->
</ScrollView>
Use this layout as one row of the list view and this should work well.
Also if you already have a code for the adapter class, you wont have to make any changes to it.

Margin bottom headerview in listview

I'm implementing a listview that looks like this :
So basicly I have a listview, with a headerview. My problem is to set the space between the headerview and the rest of the listview. If anyone has a clue, thanks :)
To set a gap below the header view you can just add marginBottom to the header view. That should do it. But like Pauland said, never ever EVER put a listview inside a scrollview. You are basically placing two vertical-scrolling views ontop of each other and Android can't tell which one to scroll when the user swipes!

Not scrollable listview in scroll view android

i need to make a layout that is scrollable, holds a listview that is not scrollable(full height of the content). So when i scroll the content above the listview is showed, and the full listview is displayed.
Is this possible in android?
what do you mean by ListView ( not scrollable).. will it have predefined items(count) ?
you can have a <ScrollView></ScrollView> inside of which a normal(linear/relative layout say id insidelayout1)
For single item of your ListView, create a separate xml(say item.xml) and try to inflate item.xml into insideLayout1.
Will that work for you.. or detail out your requirement...
If you want to put list view inside the scroll view than you have to fix the height of list view.
otherwise you can't scroll it properly.

Categories

Resources