4
votes

I've just adapting my UI with Material Design Support Lib.

I want to recreate simple animation to open a form like mentionned in Official documentation:

http://www.google.com/design/spec/animation/meaningful-transitions.html#meaningful-transitions-visual-continuity

The animation I want to reproduce is the second one ( Beach, blue toolbar)

Thing is I don't know what kind of animation is it, and how should I implement it?

Is there a way to do it with support lib, another lib, or should I just code it myself?

Here I have the official doc to create animations, but it's not helping me a lot...

http://developer.android.com/training/material/animations.html

Any idea?

1

1 Answers

0
votes

Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices.

In your app build.gradle add

dependencies {
    compile 'com.kogitune:pre-lollipop-activity-transition:1.1.0'
}

In Your First and second activity.

Start Activity in first activity.

findViewById(R.id.imageView).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        final Intent intent = new Intent(MainActivity.this, SubActivity.class);
        ActivityTransitionLauncher.with(MainActivity.this).from(v).launch(intent);
    }
});

Receive intent in second activity.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sub);
    ActivityTransition.with(getIntent()).to(findViewById(R.id.sub_imageView)).start(savedInstanceState);
}