Android: scrollable image gallery layout - android

I would like to have a scrollable image gallery that takes up most of the screen. My images are small icons all of the same size. I can have a lot of images. Once the maximum number of images fills the screen horizontally, they should wrap to the next row. If there are more images than will fit in the vertical direction, then it should be possible to scroll vertically to view additional images. I am not sure what layout controls I should be using to accomplish this. An additional feature (be not a must have), is that the images are equally spaced horizontally with the same amount of margin. Any suggestions? Thank you.

Try a GridView.

Use GridView. Perfectly fits your needs.

Related

ImageViewPager Wrapping height dynamically according to the child image (view)

Is there a way to dynamically set the ViewPager to wrap the child image just nice without leaving any space in between the height of the view pager and the top and bottom of the image?
I tried using the solution of https://gist.github.com/egslava/589b82a6add9c816a007
But the solution in the link only wraps all the images according to the height of the highest child view. Which makes every other smaller lower images look even flatter.
Is there a way to wrap the images according to each height of the child images? I don't mind the width being cropped off, I'm just more worried about the height. Some of my images fits perfectly without any loose spaces but there are a few which seems too flat in the view pager.
Hope to see your answers soon. Thanks for reading.
If it's white space you want to avoid why not try setting background to transparent.

How can i make a image grid with different heights and fixed width like Offer up app?

How to make a offer up kind of grid UI (please look the image 1), it has three same sized columns and height differs according to image size. i have implemented the view with the 3 linear layouts and a scroll view. but it's not very supportive when it comes to memory management. Can i make the view with grid view (since height is different)? or should i use any other method? or is it ok to use scrollview to load about 100 images at a time?

Grid of Views with unequal size

I have an Android app with an image detail screen. Images have tags, and these need to be displayed at the bottom of the screen. When the horizontal space for tags is exhausted, they wrap to the next line up. Each tag should only occupy the minimum necessary horizontal space. Here is an image of the effect I need, from an iOS app:
How can I achieve this effect in Android?
You will need to implement such FlowLayout yourself or use some library. Have a look at this question.

Resizing ImageViews efficiently in HorizontalScrollView

I'm making a scrollable view that contains images and edittexts below each image. The images shown below do not have the edittexts for simplicity. As a image is centered, it needs to "grow" and the image leaving needs to "shrink".
I'd like the images to resize as they become centered. I know how to calculate the sizes and positions in the view of each image as a function of scrollX. I have not tried to implement this, but I'd like to hear some opinions before trying to do this.
What is the best way to efficiently do this?
Will it be computationally expensive to have 10 images (that will be the max) loaded and being constantly resized as the view scrolls? Will this be choppy?
Ideas:
- Calculate each image size and position upon the scrollX changing. Resize and reposition each image.
- Keep track of only the images that will be growing/shrinking as they are centered/leaving the center. Resize and reposition these as the view
Thoughts? What do you think would be the best implementation of this? Thanks!

How to merge elements of a GridView

i'm implementing a activity where the user can see images from different sizes and proportions on a GridView. I don't want to modify this images proportions.
Is it possible with GridViews or my best option is to build a TableLayout and just add each image to a TableRow?
Example: If it loads a 3x4 image, i want it to scale to satify some width and height constraint and them merge the necessary GridView's elements to keep the 3x4 proportion rate.
My objective is to reach something like this: https://www.dropbox.com/s/6jmt2x5ly1k2p92/grid.png
It seems you can as a custom gridview, I haven't tested my own, and too low to comment. So on this link you will find an image on the bottom using a gridview notice that the last item is larger that the rest and the middle left item is also off scaled.

Categories

Resources