How to set full row section view for gridview? - android

I have tried and worked for listview with section view between list items and it works fine for me .
When I tried for gridview it is showing till the each item width not full row because obviously gridview comes with 2 or more items in a row .
So I want to make full row as section item between grid view items .
I searched elsewhere before posting here so can anyone help me ??

I don't think you can do that with GridView widget because it works in terms of columns. You can hack it with adding 3 Views in a row if that will work for you, but it will have obvious drawbacks such as you won't be able to put a text there that will take more that 1/3 of the screen width.
Use RecyclerView vs StaggeredGridLayoutManager instead: http://enoent.fr/blog/2015/01/18/recyclerview-basics/

Related

Grid view with show more option

I want to implement a grid view with show more option. I have 16 pre-defined categories. I want to show only first row of grid view with more option at the end. User can see all 16 items by clicking more button like drop down menu.
I'm trying to find some library but noting work for me.
Any help would be great.
We suggest, please use the staggered grid with recycler view which is same like grid view also some extra benefits like, In this, you are using recycler view so its good another one you can span how you want also you can enlarge how you want, Bellow is some link which helps you.
No good example about RecyclerView and StaggeredGridLayoutManager in Android Docs
https://abhiandroid.com/materialdesign/recyclerview-as-staggered-grid-example.html
https://android--code.blogspot.com/2015/12/android-recyclerview.html

How to make Grid View (using Recycle View) with dynamic item width in android?

i want to make grid view that has fixed item height but width is dynamic based on content with like screen below
i want to make it like this screen
If you are looking for a number of items fixed per row staggeredGridLayoutManager or GridLayoutManager .
Here is a tutorial for each one:
GridLayoutManager
staggeredGridLayoutManager
Select the one acording your needs, good luck.
[EDIT]
You could try this widget if you need to fill a row with the number of elements that fits on screen

Custom GridView's Last row items not showing fully

In My application I have to show all List Items in GridView and then while scroll down the GridView it needed to scroll the upper View(top of GridView) also along with Grid.For this purpose I have used HeaderGridView Add a Header to a GridView (Android). What I needed is working fine but the GridView's last row items are not viewing fully as like attached image.So,anyone please help me to solve this issue.
This is the default property of the gridview. It will show as like that only. If you need it in your own way, then you can solve it only by customizing the gridview by displaying the items in the gridview according to the screen height. This is only just a hint to solve your problem. So Please check this and if you doesn't got solution, please let me know.
Android gridview adjusting to screen size
android How to stretch rows in the gridview to fill screen?
How to make customAdapter fill gridview height
I think this links may give you some guidelines.

scrolling in listview with different cell height

I have a listview and its rows have different heights.
When I scroll up, rows appear to move up or down erratically.
(I don't find the behavior when I scroll down)
I suspect its due to the fact
listView picks one of used rows
the row is placed on top of visible rows.
listView changes the row's height(here erratic movement)
but it's a guess.
I tried googling since this should be a common problem but couldn't find any.
In this case, setting the right item height did the trick :
How to set different heights for each row in a ListView?
Edit: oh, and make sure you recycle the items correctly :
ListView reusing views when ... I don't want it to

Android scrollview with list of items

I want to have a view with the following vertical layout
An image (IamgeView)
A description of the image (TextView)
A list of comments
The constraint is that I want the entire page to scroll and not just the list of comments.
The number of comments may vary. If I use a ListView for the comments the entire screen doesn't scroll.
Please suggest a way to do this.
You can add a header view to your ListView. Whatever you put in the header view will scroll just like the list.

Categories

Resources