how to make section grid in android - android

I have to create list of gridview like section gridview where it has title and grid items below, i achieved this by using recyclerview and gridview, but the issue is, scroll doesn't goes smoother, it gives zerk while scrolling. and then i tried with recyclerview, cardview, along with GridLayoutManager, but now i'm not able to set background to the section. please see the attached image, you will get idea on what i am trying.
suggest me which are the best approach to set background without using gridview and listview combination.

Related

using staggered gridlayout manager in recycler view sorting of items in particulate order is possible

I have recyclerview which is displaying lot of items in card views those views are dynamic height like following pic.
I achieved it but i have an other problem if i apply any order like increase like that iam getting this one.
If we look in 5th and 6th cards are not following order.it is disturbing UI.
i know it is happening because of Staggered.
Is there any way without disturbing staggered we can achieve ordering also.

Display unknown amount of images

I want a layout that will display images without knowing how many. First i thought of a ScrollView, but don't know how to add different images to it. How can that be done? Or is there any other solution?
How can that be done?
Have the ScrollView wrap around a vertical LinearLayout, into which you add your ImageView widgets.
Or is there any other solution?
ListView. GridView. RecyclerView. ViewPager. And so on.
Depending on how you want to display the images, you can also use GridView : Grid View Android Developpers
There is an example : Gridview with two columns and auto resized images
You don't need to use ScrollView or know the amount of images you're gonna show. Just use a ListView with an ArrayAdapter that binds a List of Bitmaps (images) to your ListView (each item of your ListView is an ImageView). Each time you add a new image to your list, just call notifyDataSetChanged() method of your adapter, that's gonna update your ListView.
Just google for a relevant tutorial. You're gonna see lots of examples.

How can I use a Horizontal GridLayout inside a Recylerview adapter

I have Recyclerview in my layout. I am showing images inside the row Layout of this recyclerview. I am using Gallery widget for now to show the images.
But it is not giving me the desired results. I want to use GridView to show images. I want images to scroll horizontally in this gridview when there are more images than the width of device.
Please suggest me how can I achieve this.
https://guides.codepath.com/android/using-the-recyclerview great tutorial to use with everything. The layout manager would be what you need :)

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.

How to add Parallax Effects to List Item in android

I have an listview in my app, which displays list of images only. Now I want to add parallax effect for list items while scrolling the listview. I just now implemented listview only.
In a nutshell, you need to set a header to your ListView. This header will contain the image you want to apply a parallax on as well as the content that should go over (it usually is a classic ListView header but it could as well be something that looks like any element of your list).
The second main thing is to add a ScrollListener to your ListView, and create a custom ImageView (which overrides ImageView) that is able to receive how much your list has scrolled. In the onScroll callback, you can retrieve the first element of the list if it is visible, do a getTop() on it and send it to your custom ImageView.
You now have an ImageView that knows where it is on the screen even when your List scrolls. All you need to know is to translate the Y of your view (with either canvas.translate() or view.translate() depending on which SDK version you're working on).
I don't think it takes much more time than integrating a library and it works great!
I generally use ParallaxListView by Gnod. Check the below link
https://github.com/Gnod/ParallaxListView

Categories

Resources