1.I wish my gallery widget can dispaly 6 images at the same time, and the layout is a 2*3 matrix, and when I slide the screen, the widget display another 6 images, how to code this function?
2.I want to add some dots under the gallery widget to show which page the gallery is displaying, is there a widget can achieve this function?
3.I know hot to load pitcures in the res/drawable, but if my pitcures are in a database, how to load them?
4.I want to add some buttons to set the gallery widget to display different category images, how to code?
thx for your answer!!
Related
I've just written an app with a nice photo gallery for iOS, now I'd like to do the same thing with my Android version of the app. I see that the Android Gallery API allows me to build a scrolling gallery of images. But what I really want is an apple-photo gallery style interface with a grid of thumbnails which, when tapped, open up a full screen display of the selected image and allows me to navigate through the photo gallery using swipes or left/right arrows on a tool bar.
In iOS I used the KTPhotoBrowser to achieve this interface, but I haven't been able to find anything like that for Android. Can anybody point me to a library, or even a tutorial with example code which will give me an interface like that without having to roll it myself?
Update: I've found the GridView Tutorial which describes how to put image thumbnails into a grid, seems to be the perfect thing. The Gallery API can be used for the full size photo browser as shown in #ariefbayu sample code (see link in comments below). It's not quite the same as the iPhone style gallery, but it's pretty good.
I've done this kind of interface. The basic is:
MainActivity load images into GridView.
On each Gallery click, load another activity using Intent, called SlideActivity which extends 'Gallery' in full screen mode where this will:
show Gallery and set current image to selected
set currently selected image in gallery, to what is clicked in first layout.
Link to sample code: https://www.dropbox.com/s/xk2oupma8zcxqpf/GridToGallery.zip
I have a gallery that I use to display some ImageViews. I'd like to know which image in the gallery is currently highlighted/focused.
So far, setOnItemClickListener only fires if I actually click on the images. If I scroll through the images, a new image takes focus. I want to know which image that is.
How can I do this?
Get the images number in the list
Get the image (view) it self
I have followed the android gallery tutorial to build a simple gallery which is exactly the same as the tutorial's.
Now, I would like to improve the gallery from the tutorial to show only one image at one time(in the tutorial, several images are showing at once), that's only show one image which occupy the whole gallery area.
Then, only finger touch and move the current image to left or right will make the neighboring next(left or right) image to be shown.
How should I modify the tutorial's code? any suggestions?
You could make the Image the same size as the screen:
i.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.FILL_PARENT, Gallery.LayoutParams.FILL_PARENT));
i.setScaleType(ImageView.ScaleType.FIT_XY);
This thread might be useful
Android GalleryView Problem
Hi
I need to implement a photo library with 2 screens. one with image thumbnails, when we click on any one of the thumbnail, need to display the 2nd screen with full image that fits into the entire screen, need to have "Prev", "Next", "back to gallary" links.
I can implement the 1st screen using GridView, can anybody help me how to develop the 2nd screen with slideshow.
Thanks in advance
Nehatha
I am new to android, I have learned how to display drawable pic in gallery,
and display a url pic use ImageView. Now I dont know how to display online pictures in gallery. Should I use listview or not? In addtion, I want to know how to get pictures urls from flickrs with given userid
Do you mean like a photo gallery? is that what your app is supposed to do? Then, yes you could use a ListActivity/ListView. However i do not know if this will provide you with exactly the effect you want. A list view would load ALL of the pictures before the UI could be displayed and you would view them by scrolling. typically a photo viewer shows pictures full screen and switches with either a button or a swipe (gesture).
To get the latter effect, your app could display an ImageView with the first pic while it loads the next pic, and then switch to a new ImageView when the user clicks a button or swipes. this will prevent your app from eating up resources and will give you an interface that people are more used to.
as for flickr, you will have to ask someone else (you should separate these into two separate questions because they are so different)