I built a gallery. The centered image is scaled up. I did this by extending from gallery and overwriting getChildStaticTransformation. There I modified the camera. It zooms in when the image is close to the center point.
Problem: the centering item (from getSelectedItem()) changes a bit too late. sometimes the side elements that are smaller than the next coming get re-centered.
Is there any way to tell the gallery when it has tochanng to its neighbor?
Thank you so far.
I figured out this actually depends on the spacings set by setSpacing. If this paramter is 0 the gallery centers correctly as I want.
Problem: the Images spacing are to big then.
Is there a way to minimize the spacings without setSpacing in an artificial way?
Thanks
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 would like to create an image picker as shown in the picture below. What is the best way to go about it?
The screen should show the current image on the center and the next and previous on its side which is a smaller image size. On swipe, the images should change. It will be helpful if someone can point to an existing code similar to this.
Thanks
I want to create an image auto scrolling for an outer-space type of game. To make it more exact, I want to load 2 background image that uses a single image occupying the whole screen and auto-scroll it alternatively to create an animation that the background image is moving. Don't get confused with auto scrolling and and shifting to another image automatically. I really meant auto scrolling like moving background using 1 image.
I did some research but what I saw are segments of java codes that made me confused. If possible can anyone provide me an example? From loading the image from xml (should I use an imageview with this? or just set the background image of the layout?) and how I should process it in java code to make an image autoscrolling.
Any ideas guys? Thanks! Sorry for asking too much.
Is there a way to prevent gallery images from overlapping without using setSpacing?
My gallery uses auto rotation made with g.onKeyDown(KeyEvent.KEYCODE_DPAD_RIGHT, null); which is apparently is the best way to accurately scroll it programmatically, but unfortunately setting spacing prevents onKeyDown from working, for some reason.
Or maybe there is a way to remove spacing (not setting to 0)? Idea is to remove it right before scroll and set back after scroll.
Would be glad to hear any advices.
If your problem is to remove image overlapping in a gallery, then there is already a solution.
How to controll overlapping of gallery images?
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.