Changing the image on flink action - android

I have retrieved the all the imaged from sd card and displayed in my grid view.On tap on one image icon from the grid it goes to second activity and display that clicked image in the image view.
But now i want to implement that when we flink/swap on image from the second activity then the image should be changed to next/previous.
Please give me solution.
Thanks

What you are looking for is ViewFlipper with GestureDetector. Here are few links which will get you started with.
http://android-er.blogspot.in/2012/02/implement-swiping-page-effect-using.html
And once you understand the concept, make use of answer here.
gesture Detector is used to detect fling events and view flipper to flip to next element.

Related

Animation in a listview

I got a listview with images and some info overlaying them. I want to make so, that when I tap an image info fades out from ALL OF THE LISTVIEW. then I can scroll images and tap on them for this info. how is it possible to do so?
Try to implement an onClickListener for the image view. When you tap on an image the listener will be called and you can change the view state of the info.

How to prevent image selection while Gallery is scrolling?

I'm trying to implement my ownt picrutes gallary app. I'm using ImageSwitche for showing big image and Gallery for showing thumbnails. The problem is that when user scrolls gallery it changes selection to thumbnain whic is in the middle of gallery but required behaviour is just scroll like ListView and change image when user tap on thumbnail.
Does anybody have suggestion how to implement such behaviour.
PS. HorizontalScrollView with LinearLayout inside is bad idea becaus of it does not recycle views and holds all the pictures of thumbnails in the memory.
Take a look at the solution I have for my own question here
Basically I ended up with slightly modified version of ViewPager to display N-number of pages instead of just one. The only thing that I don't like about that that you will not have velocity-based scrolling as in ListView

Is it possible to attach activities in gallery view instead of image in android

I have different activies in my project that need to be presented the same way images are displayed in Gallery view. below there should be scroll pan where all these activities are displayed and on clicking on one of them full view is displayed as it is done with image in gallery view. Can any one suggest if this is possible. If yes then give some tutorial link or example code.

how to create view like gallery

How can i create exact view like as below image? Image which are used for next and previous here are imagebuttons?please give me idea for this.
You can simply use a ViewFlipper to display your image and similarly as you click on the left or right button you can change the image correspondingly.
To begin with ViewFlipper you can use these below links,
http://android-journey.blogspot.com/2009/12/android-viewflipper-and-slidingdrawer.html
https://github.com/ivansf/ViewFlipper-Demo
Or you can go for ImageSwitcher. And sample tutorials are given here,
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/ImageSwitcher1.html
http://saigeethamn.blogspot.com/2010/05/image-switcher-view-android-developer.html

How to handle paging in Gallery view?

I have a Gallery view, the view is loaded with 10 images. The situation I'm struggling with is when the user scrolls to the end of the gallery how do I load the next 10 images?
I added a "Next" button to fetch the next 10 images the problem with this solution is when I switch the phones orientation to landscape gallery view wont scroll anymore. Plus I read here
that you cannot put interactive controls in Gallery view.
If I implement the onScroll() or onFling() methods then I will be fetching the next 10 images without knowing if the user has reached the end of the first 10 in the view.
Your advice would be much appreciated.
There's a couple of solutions I can see.
First of all, create an image at the first/last spot to change gallery view. onClick() is supported I believe, and you can see the gallery that was selected.
The second is to have the controls outside of the gallery, ie, right below the gallery view.
Hope this helps.

Categories

Resources