How to create a transition like this one? - android

http://1.bp.blogspot.com/-Vv4SxVSI2DY/VEqQxAf3PWI/AAAAAAAAA7c/mfq7XBrIGgo/s400/activity_transitions%2B%281%29.gif
This is a material animation I want to implement, but I can't achieve a similar effect. First of all, the shared element transition moves the image into the second activity. This is quite simple, but then the root layout of the activity starts expanding and during the animation the user can see the first activity until the second activity's view doesn't hide it totally.

Related

Can you measure the height of a view on an activity that's not been loaded yet?

I want to make an animation on click that a button slides down to the position of another button and at the same time I'm loading another activity. This other button is on the new activity. Picture it as if a button from one activity is replacing a button on another activity, so it has to slide down to where the new button is.
Can I measure this new button's position before the activity is loaded? So I can get the animation right for all screen sizes.
Activities are designed to be used as full-screen components, meaning that you understand that the other activity that pops in is going to take the full screen. If that is your goal, you can use shared element transitions with the activities to get the desired effect: https://developer.android.com/training/transitions/start-activity#start-transition
On the other hand, if you need both activities to stay on the screen, than you should rather to use fragments, as activities are not suited for that. For more info on that approach, see here: https://developer.android.com/guide/navigation/navigation-animate-transitions

Android: Activity sliding over another one with swipe gesture

I have two activities one with some data and the second one, semitrasparent with some buttons on it.
I want the second activity slide over the first one after the swipe gesture.
I've already read about ViewPager and it's not what I am looking for. I want the first activity still being visible over the semitrasparent second one.
I am looking for any suggestions how to do this.
Literally not possible.
The entire point of an Activity is that it fills the ENTIRE screen, and there are never 2 of them shown at the same time, ever.
So you can't swipe to "semi" open one with a slide animation.
To do that, you'll have to use 1 Activity, and multiple Fragments.

Delay enter transition animation until shared element placement

I have an activity with a shared element that transitions into another activity. This works fine but the problem is the second activity has some dividers that get drawn on top of the previous activity which looks weird. I saw this video which shows that the enter transition can be delayed until the shared element is placed:
https://www.youtube.com/watch?v=RhiPJByIMrM&index=8&list=WL
Does anyone know how to achieve this?
Thanks.

RelativeLayout required to display fragment on top of each activity?

I want to make it possible to display a fragment on top of every activity (if the right action is called). It should look like a window on top of everything. This works fine so far, but I am a bit confused about how to get the layout integration working.
When I wanted to display something like a fragment on top of everything, I had to use a RelativeLayout as the root element, then nesting maybe LinearLayout (containing the activity's layout) and fragment.
Is that the only way to achieve this? Do I have to refactor now every activity layout to use RelativeLayout as the base? Or is there a more straightforward way?
I cannot comment, so will write here. Please provide some code to express what you mean, much easier to understand it than. If i understood you correct, u want to have a window on top of another window?
Cannot see why this would be voted down, and not even a comment for the reason :/.
You might achieve what you want with an overlapping fragment. I have had this side effect when making my app, i.e. that a fragment view is transparent on top of another fragment. To achieve this, just skip if(savedInstanceState != null){return;} in your onCreate() in your activity. And instead of replacing a fragment (transaction.replace) use (transaction.add)

How can i only apply animation for activity but not for toolbar?

I have several activities which have the same toolbar at bottom of each activity. The problem that i'm encountering is when i apply animation slide in/out for all activities, the whole of activity will be applied this animation. But i don't want toolbar do this animation. I mean that when i move from an activity to another activity ,all other views of activity will be move but the toolbar don't move.
How can i achieve this?
Thanks you a lot.
/****Edit********/
I intend to use TabWidget with activity tabs, but i don't know how to use overridePendingTransition() to make a transition animation between them when i change tabs. I also tried to put overridePendingTransition() in pause event of TabActivity and Activities for tabs, but not work.
Please help me.
if activities are not to complex you can do animation on layouts with change content view (or change view to invisible). Another option it to create tabwidget and just change tabs with animation between them. Third option is to turn off animation between activities changing, that create illusion that toolbar is staying. Just add animation to main layouts.

Categories

Resources