What kind of animation would one use - android

I am attempting a rather complicated animation in android. I want to be able to have a background image and have a sliding drawer come in from the left, BUT I don't want the drawer to come on over top of the the background image. Instead, I would like to squeeze the background so that you can see the drawer on the screen and the entire background image (though squeezed) at the same time.
I have looked into several animation but I can't come up with a combination that will do this.
Ideas?

Scale the background image with an anchor at the right side. Then translate the drawer from left (invisible area) to the right(visible area)

Related

Android DrawerLayout blur background

I would like to blur the background of the content pane when the DrawerLayout is open. I noticed that there is the ability to change the dim color by setting setScrimColor but I would like to blur the background. Is there a way to achieve this?
The process involves the following stages:
Get a snapshot of the whole drawer layout.
Crop it to the exact size of your menu.
Downscale it quite a bit (a factor of 8 is pretty good).
Blur that image.
Have a custom view that displays part of an image right behind of
where your menu will appear.
As you slide the drawer show a larger part of that image.
Please refer this answer
Blur background of Navigation Drawer
Or you can use one of these libraries
EtsyBlur
BlurNavigationDrawer
BlurEffectForAndroidDesign
Check out this library: Blurry. it takes a View or a Bitmap, blurs it and casts it to a ViewGroup or an ImageView. So just run Blurry.with(context).capture(parentView).into(parentView); whenever the drawer is opened.
Where parentView is the container that holds everything.

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.

android book page scrolling with transparent background

I want to make a book page scrolling effect like the picture below.
This is a Standby screen in Acer Liquid.
It shows a transparent layout slidable with many views on it, and the left-bottom corner shows a book page rolling-up effect. The corner rolled is draggable and transparent.
If I slide the views, the corner rolled shows the views' moving with transparent.
That is what I don't know how to do.
I did the corner rolled with a screenshot bitmap. Take a screenshot and roll it up... That's what I did. And that means the corner rolled will be no change if I slide the views.. because it is a picture!
Does anybody know how to do that?
There is an open source library you can use. https://github.com/harism/android_page_curl

Android: how to use the 9patch creator?

I am trying to create a stretchable scroll handle for my app.
The first image is the scrollhandle.9.png that I include in my app's resources.
The second image shows what this 9patch image looks like when used in my app.
Any advice on how to accomplish a stretchable scroll handle?
Edit: With help from posters, I was able to get an image that works. I added it below to help those who may find this in the future.
The area covered by the top and the left black line(dots) will be used while scaling your image. This area will be highlighted to you when you click the "show patch" option. You can see how the image scales by using the "Patch scale" option given in the draw9patch tool.
The area covered by the right and bottom lines(dots) will hold the content for the background.
Eg: You can define boundaries for the text inside 9 patch image for editor background. For your case you don't need right and bottom lines.
So for your case place two dots at the top corner and two dots at the left corner. Make sure patches doesn't fall in the arrow image of the scroll(if they do fall your arrow image will also get stretched) . Try putting the dots only in the left and top lines till you get the desired preview with "Patch scale" option.
If you use only one dot (instead of four) at the top and bottom left, and one at image top center, it should stretch the way you want it to.

Android slide animation problem

I have a 3 horizontal views - an image on the left which is a thin vertical handle-type bar and an image to its right followed by a textview. What I'm trying to achieve is a sliding animation, activated with a click on the handle, so that the center image slides in and out to the left (and so disappearing when fully left) with the textview following this animation smoothly. The effect will be the handle remains in place (hence I can't use the SlidingDrawer), the image comes and goes and the textview is always present but slides into the space where the image went. Its just collapsing the image really.
The problem is if I apply android.R.anim.slide_in_left/android.R.anim.slide_out_left to the image and the textview simultaneously I see they slide completely to the left edge of the screen, temporarily overwriting the handle. Is there a way to still animate but not go all the way to the screen edge?

Categories

Resources