How can I use a Horizontal GridLayout inside a Recylerview adapter - android

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 :)

Related

how to make section grid in 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.

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.

Android, Is it possible to set list to be scroll-able horizontally?

In my project i have a list. this list includes thumbnail images which should be scrollable horizontally.
If i add a list inside HorizontalScrollView and inflate my list what will be output? I want to arrange all images horizontally.
How can I do that? Thanks
You can go with Gallery widget.
using Gallery would be easy for you as it is also implemented using Adapter pattern. So what you need to do is to provide Adapter implementation as you simply do for ListView as single image thumbnail.
or you can have a look at HorizontalListview

Vertical gallery in android

i am developing an app, for which I need a gallery to be set in vertical mode instead of horizontal mode. my question is, is there any possibilities for me to show a vertical gallery kind of widget?
Any help is appreciated.
Why dont you create a custom adapter for the listview? If you define a custom adapter with one imageview then it will be same as vertical Gallery view. So once you define this adapter then you will be having 1 imageview per one item so it will look like vertical gallery view.
FYI, here is a listview with image, you can use the same listview, play with it.
you can use a ScrollView which contains some imageView setted to fill_parent , and then you can Scroll them as a vertical Gallery
Ok. so i came to know that vertical gallery in android is not possible with the normal gallery widget. So I tried using Custom Listview with some modifications to change the look of the listview. Now my listview looks exactly like a vertical scrollable gallery.

add the image for each listview item in out of the listview

Hi i want to add the particular image for each listView item left side .but that is not included in the listview ,see the image from below link
Image
I understand you are talking about the image with red circle. This is functionality of Iphone and not available in android by default. You will have to create custom listview and make the image part of the list item. It cannot be outside listview. That way it will be difficult to access it later on.
Take one scrollview in taht scrollview take 2 linearlayouts as horizontal and then assign images to one linear layout as vertical and add listview to another layout
Here is a nice article http://blog.sptechnolab.com/2011/02/01/android/android-custom-listview-items-and-adapters. It works.

Categories

Resources