Android image fipper/curl with zoom - android

I'm looking for an image viewer which has zoom functionality (pinch-zoom) and page-flip functionality.
I've found a lot of fancy image viewers and page-flippers out there but I can't find one that has best of both. Is there anything out there what can do this? Or even better, how can I combine an image viewer with a page curl library?
Here is a list of views that I've already tried:
Android Page Curl
Page Turner
An SO Article here about flipping pages
If this is really to hard/impossible to do, it's alright if it's just a swipe animation where the pages get's pushed into the screen.

Related

Change images automatically and count appeared image

I have a list of image URLs and have to show them and change them automatically in ImageView and need to count how many times every image appears to the user.
What could be the best approach to do this? can we avoid handlers here?
Android provides views which can be used to display images from various sources and provide transitions between them. Some of these views are the ImageView and the ImageSwitcher. These views provide a high level of functionality to display images in a user interface so that we can concentrate on the images we want to display rather than taking care of rendering.
You can get complete guide setup in links description.
In description there is a complete explaination for changing image using ImageSwitcher
by pressing a button, But by updating the code to change after certain can be done easily.
Link to tutorial:
https://www.sitepoint.com/handling-displaying-images-android/
A github link for application used with image switching button:## Heading ##
https://github.com/Adarshgkp04/Android_Image_transitions.git
Feel free to ask queries.

how do i add page curl effect in ImageView and also that ImageView should be zoom able and should be scroll able when its zoomed

I need page curl effect for android.
I checked the following links
Both are working fine with limited images if I add more images its crash application.
And for Zoom I checked following link
but TouchImageView and pagecurl both not working together.
Is there any solution for use page curl and TouchImageview together for 90+ images resources in efficient way?
or any other libs which provide curl with zoom functionality together in Android?
You can use this PageCurlWithZoom
solution for use TouchImageview in layout with 90+ images resources in efficient way and Page Curl Effect with bitmap memory management.

Trying to get a handle on displaying an image with zoom and pan

I've read a ton of posts, and tried a few of the suggested solutions, but not having much luck.
I have a ViewPager which is happily displaying text views.
I now want to enhance it to also support ImageViews. The images may be in a wide variety of shapes and sizes, so I need to give the user the ability to zoom and pan in order to focus on any area.
NB. I do not necessarily want pinch zoom, as the pinch-zoom libraries I've tried (eg. https://github.com/jasonpolites/gesture-imageview/blob/master/main/src/com/polites/android/GestureImageView.java and http://blog.sephiroth.it/2011/04/04/imageview-zoom-and-scroll/) seem to work intermittently, and crash with out-of-memory. So rather than complicate the solution with gesture detection, I'm happy to put a slider control above the view to achieve the zoom UI.
I'm struggling to get a handle on what is an appropriate view hierarchy to achieve this (eg. do I need a ScrollView or is panning a feature within the ImageView), and should I be scaling the bitmap, or resizing the view?
Any suggestions on what view components I need to use would be much appreciated.
Should I even be using ImageView? I've seen some answers suggesting that a WebView is a better starting point.
My instinct is that what I'm trying to do should be pretty basic, and require no more than the right view hierarchy and view config settings. It seems too simple to require a custom ImageView class, but of course I might be wrong.
Should I even be using ImageView? I've seen some answers suggesting that a WebView is a better starting point.
This is the way I solved it in the end. I simply wrapped the image filename in some HTML and gave it to a webview.
This gave me the following specific benefits:-
The detailed user behaviour (eg. zoom rate, pinch sensitivity, availability of an on screen control) were consistent with the browser, and so familiar to the user's muscle memory
I don't need to depend on any third party code
Since it's core Android, it's probably better tested against edge cases (eg. one library I considered didn't support landscape)
I don't need to worry about out of memory situations with Bitmap processing
In the future, I might want to provide "web page" as one of the items in my ViewPager anyway, so one stone, two birds.
Here is the code I ended up with.
File imgFile = new File(FILESDIR,FILENAME);
if(imgFile.exists()){
WebView wv = (WebView) rootView.findViewById(R.id.imageView1);
wv.getSettings().setBuiltInZoomControls(true);
wv.getSettings().setDisplayZoomControls(true);
String html = ("<html><img src='"+imgFile.getName()+"'></html>" );
wv.loadDataWithBaseURL("file://"+imgFile.getAbsolutePath(),
html,
"text/html",
"utf-8",
"");
}
You need to use GestureDetectors. Google has excellent sample interactiveChart for this, see https://android.googlesource.com/platform/development/+/master/samples/training/InteractiveChart and http://developer.android.com/training/gestures/scroll.html

Image Circulation in android

I have created a app to find the hotels, I am using a slider to show all images related to the hotel's. But I want to get the first image after the last slide in circular fashion.
Get idea through below Picture, Because I want to achieve it in same way.
Sliding SlidingSlidingSliding
All image must be in circular fashion with no end point for image in gallery while sliding.
Please have a look at the below library called InfiniteScrollView.
I think this will do exactly what you are looking for.
https://github.com/satansly/InfiniteScrollView

Android drag two images on canvas

My end goal here is to be able to add two (or more) images to a view/canvas, then turn that canvas into a single bitmap. I've seen many similar SO posts about dragging images around on a view, however, none of them cover dragging multiple images.
I am currently using the matrix commands to rotate and zoom, which work fine but only for one image. The code I am using is similar to this post. The issue here is that using fill_parent on the image will only allow for one image to be dragged because it is on top of the other image. Using wrap_content will only allow the image to be dragged within the confines of how big the image currently is, producing a cropped looking image.
So, is there anyway to edit this code (or use fresh code) to allow multiple images to be dragged and/or zoomed? As I've mentioned, there are many other SO posts about this but none have any solid answers.
Check out the demo app from the project Android Multitouch Controller, pretty much everything is done for you already. It lets you drag, rotate, and scale many images on a custom View. I've used this in the past for a custom image cropper, and it worked out great.
As for turning the resulting Canvas into a Bitmap, I've got a modified version of the Android Multitouch Controller project to do exactly that. You can see that project on GitHub.

Categories

Resources