I'm looking for a way to overlay each images of the gallery to 50%.
I have successfully do that with the setSpacing method
gallery.setSpacing((int)(- this.imageWidth / 2));
The problem is that now, we don't see the image at the right of the selected item in gallery, because the selected item is fully displayed. I want to keep this comportement (image selected fully displayed), but also see the image at the right (50%, like each other).
Moreover, and it's an other problem, i'm looking for a way to display my images differently at the left of the selected element than at the right of the selected element. It's a little difficult to explain, so I have drawn the result that I want have :
http://www.hostingpics.net/viewer.php?id=678746customgallery.png
As you can see, the image at the left (yellow) of the selected one (purple) and the image at the right (pink) of the selected one (purple) are side by side because of the difference of disposition between left and right.
I'm french and it's a problem very difficult to explain for me, if you don't have well understand, please ask me for more precision.
Thanks per advance for your help.
Sébastien
EDIT : Thanks to Ramon's answer, I have found this to solve my problem : rudolphmutter.com/?p=31. However, this give me a new problem now, the same as this guy : stackoverflow.com/questions/8598863/. Even I accept the answer, that fit to my question, I'm still waiting for a solution to do what I want in the other stackoverflow's subject.
maybe you can use setChildrenDrawingOrderEnabled(true), then, your selected image will be displayed at the top of the gallery.
Related
The screen should show the current image in the center and the next and previous images to its left and right in a smaller image size. You can see the image here On swipe, the images should change and select as new item. It would be helpful if someone could point me to existing code similar to this. I have tried Fancycoverflow. it gives this kind of effect, but it skips items when I try to set particular item in center. I am not able to scroll and set the image in center easily.
Here you can see something similar but not exactly. You can add round transformation, and bigger size that icon, which was clicked.
I tried to create a library for similar to your issue. You can custimize it for better suit. Here you can find the source code and a video that shows how it looks like.
See you.
I am working on an application in which I need to implement Hot Spot kind of thing. Hot Spot is actually an image having different sections in it, when user clicks on different portions of that image it will reflect in different results accordingly, so my problem is that how can I get the click of these different portions which are present in the single Image, also if I get the X-Coordinates and Y-Coordinates of the same Image then how should I maintain it in different screen resolution. I am displaying a demo image with my question
Here its a single image, now I just want to get click of the four section displayed here, for e.g. if I click on section no.4 I can show another image etc.
Please help me to sort this out, any help would be appreciable.
Thank you.
Finally I found a library for this, though it does lot more than what I want to achieve but its good to use this one.
https://github.com/chrisbanes/PhotoView
User can select some images to the screen, and be able to select/drag/move/zoom/rotate each image. When an image is selected, it will have a blue border. And user can also bring an image to the front or background.
Here is sample picture in the following: there are two images(girls) on a star-background. The top one has been selected(it has a blue border).
I don't know have to implement it. For several days of learning, I can now drag/move/zoom/rotate a single image(inside an imageview, and scaled by matrix). But I don't know how to handle multi-images.
I want to know:
Is it still a good idea to use ImageView(for each image), or what classes should I use?
How to implement the orders? (so I can bring them to front or background)
How to determine which image has been selected
How to find and draw the border of selected image?
For now, I just know how to use ImageView, but I'm not sure if I can use it to implement this task. Please give me some advices, thanks !
Drawing everything directly onto a Canvas is one way of doing it. There is an article that covers the basics of using a Canvas. You can read it HERE
There is one major downside in doing this - you have to handle all the input events by yourself. The API won't tell you which image has been clicked, or dragged. You'll have to implement that by yourself.
can anyone let me know how to keep an image on top of other image. If we select a portion of the top image it should display the below image portion.
Please share the samp
Thanks in advance.
-pavan
I'm not sure if this would completely answer your question... but firstly, images shouldn't really ever overlap in a LinearLayout. If you're using a RelativeLayout, they definitely can overlap, and the image on top will be whatever was loaded last in the XML.
If I understand what you're attempting to do - kind of transparency (so to speak) of the top image so that portions of the bottom image are displayed along with portions of the top image ... I do things like that all the time by overriding the onDraw() method on my View to handle the image painting myself. There's allot of examples on the net for this - simple stuff.
I am displaying an image gallery consisting of 15 images with image displayed on the screen (full-screen) at a time. When the user swipes across, the image changes. I am looking at a small polka-dots style indicator at the center-bottom of the screen to show the image count and where the user currently is.
eg: If my gallery held 5 images and the user was currently on the 3rd image, then there would be 5 polka dots with 3rd dot highlighted/filled with color and the rest polka-dots be hollow.
I know the description might sound a little vague but in short, I am looking at an image count indicator! :)
Thanks!
You might check out this Android Count Indicator project: https://github.com/rupertbates/android-count-indicator
I know exactly what you want, you are looking for the PageControl that is used on iPhones with the Scroll Views. I have never seen anything like that for Android. You would have to build a custom view. It's explained here:
Building Custom Android Components
I finally found it in the Launcher code!