Stretchable ImageView - android

I beg you not to downvote my question, because it can duplicate other questions, but i didn't find anything.
I want to do Stretchable (or Resizable) ImageView. Attention to pictures:
1. For example we have this layout (screen)
2. My finger down to screen
3. My finger move to screen bottom. So ImageView zoom
4. My finger up to screen. ImageView size was returned with smooth animation
What name of this ImageView? Or how realize this? What do you think?

this view is something like fading action bar :
https://github.com/ManuelPeinado/FadingActionBar

whe you don't know which view is use than just use Hierarchy Viewer
Launch Your App in emulator
Launch the Hierarchy Viewer in eclipse
and debug your UI
Source

Related

Android: make the size of a custom view bigger than the size of screen

enter image description hereI have a custom view and the user can draw rectangles(I used canvas). I would make the size of custom view bigger than the size of the screen. So, the user can draw not only in the size of screen. I tried ScrollView and NestedScrollView but they are not helpful to solve my problem.
As far as I could understand from this question is you want to make a canvas where someone can draw some pictures. So you need a bigger canvas to that user can drag the positions to left-right, up and down. If I understood correctly, then I would say, you might think of a different work-around instead of looking for a view bigger than the screen size.
You can think of an simple ImageView which will be auto zoomed-in and if the user clicks twice it'll zoom-out. The user can drag the positions of the ImageView whenever he wants.
Here's an SO answer about how you can implement the zoom in and out in an ImageView. Hope this will help to solve your problem.

Animate image from off screen to center of screen

I would like to have an (drawable) image start off the screen and animate it to the middle of the screen.
I have searched around a bit and cannot find a great answer. Some even saying there are problems with starting an animation off the screen.
Is something like this possible?
Checkout this
img.setTranslationX(-screenWidth/2);
img.animate().translationX(0)
.setDuration(1000)
.setStartDelay(400);

Android slide ImageView from top to bottom

I'm trying to develop a game which has the track sliding down from the top to the bottom. When you start the track(which is a large image) is "out of screen" then it slides from the top and goes out at the bottom. The images might be very large, larger/taller than most screens.
I can animate the image with animations, but Android scales the image to the screen size on load, which I dont want. How can I keep the original size of the image?
I dont think using ScrollView would be good since I dont want the user to scroll the image.
This is what I would like to achieve:
As a quick fix you could try to wrap you ImageView with an AbsoluteLayout. Check an answer to the question How to create a view that is bigger than the screen?
Be aware it's deprecated and for the stable future use you have to get another solution.

ImageView animation like the Android 4.0+ contact editor

I would like to animate my ImageView like the contact editor (the read only mode) in Android 4.0+ does (I am not sure about the version).
But I don't know where to start. I tried to figure out what the source code does, but it is really complicated and I am not even sure, if I am looking at the right source code (PhotoSelectionActivity?).
So, here is what I would like to do:
I have an ImageView (400dp x 200dp, width x height) and a quadratic image resource. I would like to draw my image in that ImageView using the centerCrop scale type (done so far). But when the user clicks the ImageView, it should expand to its full size (if possible do not change the layout size, because it is not the only view in the linear layout), the background (if possible) should fade out.
Any ideas?
Here is an image of the start view:
and when the user clicks the image, an animation should start, ending with this view (keep in mind, that the contacts details are still there, they are just behind the image):
I hope it is clearer now.
To achieve this create two corresponding animations (scale and fade out) with Property Animations
Use NineOldAnroids for backwards compatability with Android 2.x.

how to keep an image on top of other image

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.

Categories

Resources