🌠Transform between two Views, Activities, and Fragments, or a View to a Fragment with container transform animations for Android.
Released version 1.0.3
.
Added TransformationCompat
, TransformationActivity
and TransformationAppCompatActivity
.
We can transform into an Activity easier using them.
Here is the same as before.
We should add onTransformationStartContainer()
to the Activity that has the floating action button.
override fun onCreate(savedInstanceState: Bundle?) {
onTransformationStartContainer() // should be called before super.onCreate().
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
Extends TransformationAppCompatActivity
or TransformationActivity
to your activity that will be transformed.
class DetailActivity : TransformationAppCompatActivity()
Here is the Java way.
public class DetailActivity extends TransformationAppCompatActivity
And start the DetailActivity
using the TransformationCompat.startActivity
method.
val intent = Intent(context, DetailActivity::class.java)
TransformationCompat.startActivity(transformationLayout, intent)
Here is the Java way.
Intent intent = new Intent(context, DetailActivity.class);
TransformationCompat.INSTANCE.startActivity(transformationLayout, intent);
Released version 1.0.2
.
startTransform()
, startTransformWithDelay(delay: Long)
, finishTransform()
, finishTransformWithDelay(delay: Long)
functionalites are added.
So we don't need to put container
parameter to startTransform()
and finishTransform
methods.
// start transformation when touching the fab.
fab.setOnClickListener {
transformationLayout.startTransform()
}
We can start transformation with delaying.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_detail)
// starts transformation automatically 200ms later.
transformationLayout.startTransformWithDelay(200)
}
Released the first version 1.0.0
.