I would like to create a gridview of images, in which, these images will be downloaded based on a web service response.
The thumbnails of images will be displayed in a gridview, similar to how iPhone displays photos.
User can tap on the image and the corresponding full-res image will be shown, sized to fit within the android phone. Upon tapping on the full-res image, it will minimize and return to the gridview.
So far, following the guide here, I had manage to create the gridview of images, but I would like to have it expand to the original size upon tapping and tapping again, return to the gridview.
See the Gallery, maybe all you need to do is change the OnItemClick behaviour.
http://developer.android.com/resources/tutorials/views/hello-gallery.html
Related
I have been trying to display multiple images with a image holder in a textview like in notes app but the solutions I have seen only support one image and the image view where just hidden and shows when you add images.
Example
enter image description here
It could be images, audio or links
I have taught of you creating multiple image view and hide and show them but I can't predict a user amount of image and that just inefficient
I have cardview list with each item containing image view and text. Each image for each item is provided as url with image to download.
Now, instead of converting each image to bitmap and putting it into my adapter I want to get functionality similar to Google Play search results, where images are refreshing after list is shown.
My idea is to use Universal Image Loader: https://github.com/nostra13/Android-Universal-Image-Loader so my images will be loaded in background.
However, I have no idea how to force refreshing only visible items. The rest should be refreshed on scroll, just after they appear when list is scrolled down. So basically, the same as it works in Google Playstore app.
Any tips?
After getting solution to call my splash activity only one time (Part1 Question), Now i have to set up my splash activity.
On My First Layout i want functionality like this :
Image One <--> Image Two <--> Imgage Three --> Second xml(Activity)
Also on every image their will be a page control that will indicate on which image is currently on layout(Like the attached screenshot)/ or can be any other way to show this.
That Means From Image one i can go to image two on scrolling to right(I can come back to image one on scrolling to left) From Image two i can go to Image Three on scrolling right(I can come back to image 2 from Image three if i scroll to left)But if i scroll to right from Third Image then i should get to my Second Activity and never return back on those images.
i.e
I want to have scroll view having those three images with the page controller then after we scroll down to the third/last image on further scrolling to right i want that my second activity should be loaded and the splash should never come up.
Can any one tell me any idea how this can be done.
To make splash sheet with scroll view and page control & switch to second activity when done scrolling.
I don't want animation i want it to work manually like scrolling/ or any other way to implement this.
Coding will be much appreciated.
To implement scrollable images like shown above use ViewPagerIndicator library given HERE. Its simple to integrate and will take few minutes. All you have to do is read the usage section in given link.
For switching activity on last page, simply implement onPageChangeListener described in link and check for page number.
Here's the situation:
I have a custom list item containing an ImageView, and some TextViews. I am lazy loading images to the ImageViews. When I use this in a ListView, it works fine.
I also want to use it in a Gallery. There are three scenarios:
lazy load images, not touching the spacing: The items overlap, but
scroll fine
don't load images, Gallery.setSpacing(0): The items are spaced
correctly, the scrolling works, but I have no images.
lazy load images, Gallery.setSpacing(0): The items are spaced
correctly, scrolling doesn't work, just behaves really jittery and
snaps back to original position. If I scroll very fast, repeatedly, it will start moving, but very poorly
Because it all works perfectly in a ListView, I can't understand what's going wrong. I know it's nothing wrong with my image loader, and I know it's nothing wrong with my layout. It seems like Gallery is having trouble handling changes to the list item.
EDIT: I forgot to mention, there's a placeholder image loaded in the ImageView before the images are loaded, and the ImageView has a fixed size.
Does anybody have any idea what I could be missing?
I think that because yo are lazy loading the images, when onMeasure is called on each item in the gallery, it doesn't know how big the image going to be (as it isn't loaded yet), and so it can't set the spacing to 0.
Maybe you should set your default gallery item size, or update the size of the view as the image is loaded?
I've been learning android programming for some days. I am creating an ebook application which reads images from the drawable folder. I've successfully implemented the pageviewer activity which loads bitmaps using asyncTask in background and shows a text "loading..." until loading is completed.
I wanted to show a pagelist in another activity using gridview so that user can scroll through a grid of pages and select any. I followed the android gridview tutorial and wasnt much problem. But since i have about 50 images in drawable and it seems gridview adapter shows the grid once all images are croped and placed in grid. It takes a lot of time to show the grid and its quite slow on scroll.
I was wondering if there was a better way to show the grid, asynchronously, like show the first item and then the 2nd and so on, instead of waiting for a long time and displaying the grid. I saw some topics like lazy load which seems similar to what i want, but they all show image from web, it was confusing. Hope i can get some sugestions, or if there is any other way.
Have you tried Fedor's Image Lazy Loader?
Here is the link: Lazy load of images in ListView ,
I know you want to implement it for GridView, but still you can refer the ImageLoader class given in the example code.
Update:
You can even try this example Lazy Loading GridView. I haven't tried it, but as i found it, i thought it may be of your help.
The images you show are probably a bit too large to be used with GridView in their current form.
I guess you need the GridView to display thumbnails, so one possible approach would be to store a thumbnail sized copy of every page you have, and use those in the Grid.
You can also try switching hardware acceleration on in the manifest, that might help you with the scrolling once the images are small enough to load them faster. But afaik hw acceleration is only available in 3.0 and up.