I have working sample of image gallery.
Now if I have 10 images in gallery, few of them gets displayed initially, lets say 3 (based on image thumbnail dimensions), and rest of the images can be viewed by scrolling the gallery.
I want to change this a bit.
Based on image thumbnail dimensions, few images should be displayed initially and instead of scrolling, there should be previous and next buttons, on click of which images will shift left or right.
Any help appreciated.
You can use gallery and onButtonPress call onFling (for smooth scrolling, or simple select next image) event to change selected item.
Or you can use LinearLayout, calculate image dimensions runtime, create child imageViews for parent linearLayout and onclick fill this views with your images
Related
i got the list of images from gallery, now how to put images in single item like grid as facebook or other apps does?
Inside LinearLayout take 4 image view. let's call this imageview as imageView1,imageView2,imageView3, imageView4. each image view will have a height in dp or wrap content. set weight property 1 for each image view. now to show two images set the visibility of remaining image view as gone. or if you want to shows three image view set last image view visibility to gone.
I have a image with the size of 1299 * 625. I want to show the image in Gallery view like first half is one page and second of is another page. Sorry for my Bad English..
Use the ViewPager and add two ImageViews to it. Split you image in half and assign each half to one ImageView.
I have Gallery element with full screen image. And user can scroll such images.
Is it possible to add some listener to Gallery and receive actions when image is totally on screen and no more scrolling.
I show "Loading..." icon and then load the image. And it doesn't work good when image is changed during the scroll from "Loadin..." to right image. That's why I want to show real image only after scrolling is ended.
Thanks
I am using Gallery class for displaying images.
With the default implementation , the first image occupies the centre of the screen .
If the first image(centre image) is scrolled towards the left of the screen , then the second image(next image) occupies the centre of the screen.
My requirement is that for the very first time , the first image should be displayed 20 dip from the left margin. I'll keep some spacing (60 dip) between the first & the second image.
I wanted to know , whether this is possible or not.
Kindly provide your inputs/sample code.
Thanks in advance.
Warm Regards,
CB
If you don't want the Gallery to automatically move any Item to center after some user input, you should use an ScrollView, add your ImageViews there.
You can do that by placing your Gallery with 60dip padding or by overriding the Adapter from Gallery and return ImageViews with your own padding.
I'm an android-newbie and I'm looking for a solution, how to overlap a horizontal-scrolling image-gallery with a vertical-scrolling image-gallery. that means one transparent image of the vertical-scrolling gallery should overlap one image of the horizontal-scrolling gallery (like a cross).
furthermore it should be possible to scroll either vertical or horizontal so that the image of the vertical-scrolling gallery or the image of the horizontal-scrolling gallery will change. is there an way ?
thanks a lot!
Just an idea, but what about a 3x3 table layout like so:
--VG--
HGIVHG
--VG--
where VG means vertical gallery, HG is horizontal gallery, IV is an image view and -- is just an empty frame layout.
Now, you have two image lists, the vertical and the horizontal list. You remember the image list states and always recognize the focused images in your data model. The two focused images are composed in the centered image view, whereas the remaining images are distributed in the adjacent galleries. It's a bit of effort but should work.