Skip to content

mirshahbazi/MorphTransitions

Repository files navigation

MorphTransitions

Morph transitions from FAB to dialog, and Button to dialog

Hero Image

Usage

See the sample app. Typical usage:

MorphTransform.addExtras(intent, color, dialogCornerRadius);
ActivityOptions options =
        ActivityOptions.makeSceneTransitionAnimation(MainActivity.this, button,
                getString(R.string.morph_transition));
startActivity(intent, options.toBundle());

in the first activity, then:

MorphTransform.setup(this, container, color, dialogCornerRadius));

in the next activity. Be sure that you override onBackPressed() and call ActivityCompat.finishAfterTransition(DialogActivity.this);

In addition, be sure that your activities themes have the attribute:

<item name="android:windowContentTransitions">true</item>

Using with gradle

  • Add the JitPack repository to your root build.gradle:
repositories {
    maven { url "https://jitpack.io" }
}
  • Add the dependency to your sub build.gradle:
	dependencies {
	     implementation 'com.github.mirshahbazi:MorphTransitions:d4edc0726f'
	}

License

Copyright MAM

About

Morph Transition Dialog

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages