Transition animation between two widget with Scale effect in flutter - android

How can I overlay two widgets to each other(like Stack) with scale effect in Flutter?
I want to put two container on each other and when user scroll on top widget (or by an event) these widgets,
Replace to each other with scale transition effect and result should be like this picture:

Related

Create a transparent expanding circle transition animation from one layout to another on swipe

When the user holds down on the screen, it should become transparent by their finger so that they can see the other layout beneath. When they continue holding down their finger and swipe, I'd like to create a transition where the transparency spreads outward from their initial holding location until the upper layout is gone and only the layout underneath is left.
Here are examples of the effect I'm looking to create:
I'm not concerned about the fancy movement of the purple / red squares; I'm just looking to find out how to create the swipe transition between the two layouts.
It seems like using android.R.anim.fade_in and android.R.anim.fade_out would get close to the desired effect but it would be missing the expanding circle centered on the user's finger and the transition would happen all at once instead of the intended effect of giving a peak when just held down and performing the transition only after a swipe.
you can use this npm
react-native-expanding-circle-transition
https://github.com/alexbrillant/react-native-expanding-circle-transition

transition animation between two activity android

I need animation like this image
I want to create transition animation as per below requirement:
1) old screen move right to left.
2) New screen need to be appear as it is without any animation.
So while activity transist that time only old screen move but new screen need to appear without any alpha effect.
Currenly I have created similar animation but when activity transist it has alpha effect. but I dont want alpha animation.

Pinterest long click on image and display button

I dont know how to achieve this effect on long click. Long click on image in pinterest android app. Three buttons sliding from red ring to left.
Edit: like this https://github.com/GnosisHub/GHContextMenu
Put 3 invisible ImageViews in the layout (these are the buttons). Set an onLongCLickListener on the larger ImageView. When the long click occurs, make the three buttons visible and animate them into position with ObjectAnimator or ViewPropertyAnimator. When you want to dismiss the buttons, animate them back to where they started and make them invisible again.
You will have to do some math and figure out how far to translate (move) the buttons in the X and Y directions, and it will be different for each button. I suggest placing the buttons where you want them to be when they are visible. When you want to animate them, calculate the difference between their current position and the center of the larger image (or from the touch location). Then you set translation X and translation Y to those values and animate them back to 0.

ImageButton animation

I am implementing a animated book in Android and the animations are defined by an XML (not an Android XML). The images are positioned in fixed positions and when user touches in a element on the screen, the app plays a sound and animate the imagebutton, changing the image src and positions (X and Y).
I want to know how can I do that. As images dot not have the same size, I think the sprites solution is not a good way to solve it.
Its like the image 2:
Thank you
There are two types of animations:
View Animation and Proprety Animation.
The view animation can only animate View objects. It also lack a variety of animations, since it can do only stuff as scale, rotate, move... It cannot change background color, for example. Also, the dissadvantage of the View Animation is that it only change the position of where the View object is DRAWN. Phisically, it still stays in the same position. That's why the button is unclickable, after the View Animation is finished upon it.
Property Animation, in the other hand, can animate both View and non-View objects and it doesn't have constraints as the View Animation. When objects are moved, for example, with the property animation, they are not just drawn on some other position on the screen, but they are actually MOVED there.
Now, Property Animation is a lot more complex to write than the View Animation, so if you don't really need all the advantages of the Property Animation, it is suggested to use View Animation.
Source: Property vs ViewAnimation
Tutorial and SupportLybrary up to API 1: Nine Old Androids

Android: Animating View position

I'm trying to do something which seems simple. I want to have a map view, with a menu that slides up from the bottom of the screen where settings (for overlay) can be adjusted. However when I use a TranslateAnimation to affect the y position of the LinearLayout (which holds the menu), the buttons in the LinearLayout move, but there "hit area" stays in the same position as they were before the animation.
TranslateAnimation slide = new TranslateAnimation(0,0,0,0);
slide.setDuration(300);
slide.setFillAfter(true);
pullupMenu.startAnimation(slide);
mapContainer.startAnimation(slide);
I've also looked into tweening the view's marginTop value, but haven't even been able to determine how that would be done.
Any help on either of these directions would be much appreciated.
The animation in general is animating the pixels of the widget. My suspicion, based on what you wrote, is that setFillAfter() merely arranges for the pixels to stay in the destination location, not the widget itself.
If you want the animation to actually wind up moving the widget, you need to:
Register a listener to find out when the animation ends, and
Arrange at that point to modify the layout rules such that the widget actually exists in the new location
You can see a sliding pane that employs this technique here.

Categories

Resources