๐ Transform between two Views, Activities, and Fragments, or a View to a Fragment with container transform animations for Android.
APACHE-2.0 License
Bot releases are hidden (Show)
Full Changelog: https://github.com/skydoves/TransformationLayout/compare/1.1.3...1.1.4
Published by skydoves about 1 year ago
Full Changelog: https://github.com/skydoves/TransformationLayout/compare/1.1.2...1.1.3
Published by skydoves over 1 year ago
Full Changelog: https://github.com/skydoves/TransformationLayout/compare/1.1.1...1.1.2
Published by skydoves almost 3 years ago
๐ Released a new stable 1.1.1
! ๐
1.5.0-alpha05
.buildConfig
option on the transformationlayout
module.Published by skydoves over 3 years ago
๐ Released a new version 1.1.0
! ๐
1.4.0
stable.Published by skydoves over 3 years ago
๐ Released a new version 1.0.9
! ๐
1.4.0-beta01
.Published by skydoves over 3 years ago
๐ Released a new version 1.0.8
!
1.4.0-alpha
.Published by skydoves almost 4 years ago
๐ Released a new version 1.0.7
! ๐
material
version to 1.3.0-beta01
.kotlin-parcelize
plugin internally.kotlin
version to 1.4.20
internally.Published by skydoves about 4 years ago
๐ Released a new version 1.0.6
! ๐
TransformationCompat
for supporting Java.TransformationCompat.startActivity(transformationLayout, intent)
TransformationCompat.startActivityForResult(transformationLayout, intent)
TransformationCompat.onTransformationStartContainer(activity)
TransformationCompat.onTransformationEndContainer(activity, transformationParams)
TransformationCompat.onTransformationStartContainer(fragment)
TransformationCompat.onTransformationEndContainer(fragment, transformationParams)
TransformationCompat.addTransformation(fragmentTransaction, transformationLayout, transitionName)
onTransformationEndContainerApplyParams
functionality in TransformationCompat
.startActivity
or startActivityForResult
in TransformationCompat
, apply the TransformationLayout.Params
on an Activity.TransformationCompat.startActivity(transformationLayout, intent)
TransformationCompat,onTransformationEndContainerApplyParams(activity)
onTransformationEndContainerApplyParams() // kotlin extension
JvmSynthetic
for hiding kotlin lambda functions in Java for using without adding a kotlin dependency.Published by skydoves about 4 years ago
๐ Released a new version 1.0.5
! ๐
1.3.0-alpha02
.allContainerColors
, startElevation
, endElevation
, elevationShadowEnabled
, holdAtEndEnabled
to the params, and attributes.Published by skydoves over 4 years ago
Released version 1.0.4
.
We can transform a view or fragment into a fragment.
Here is some example of transformation RecyclerView item in Fragment A into Fragment B.
FragmentA
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// [Step1]: apply onTransformationStartContainer.
onTransformationStartContainer()
}
/** This function will be called from the [PosterSingleAdapter.PosterDelegate]'s onBindViewHolder. */
override fun onItemClick(poster: Poster, itemView: TransformationLayout) {
val fragment = MainSingleDetailFragment()
// [Step2]: getBundle from the TransformationLayout.
val bundle = itemView.getBundle(MainSingleDetailFragment.paramsKey)
bundle.putParcelable(MainSingleDetailFragment.posterKey, poster)
fragment.arguments = bundle
requireFragmentManager()
.beginTransaction()
// [Step3]: addTransformation using the TransformationLayout.
.addTransformation(itemView)
.replace(R.id.main_container, fragment, MainSingleDetailFragment.TAG)
.addToBackStack(MainSingleDetailFragment.TAG)
.commit()
}
RecyclerView.Adapter
transformationLayout.transitionName = item.name
If you want to transform view (not a recyclerView's item), set transiton name in on onViewCreated
.
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
transformationLayout.transitionName = item.name
}
FragmentB
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// [Step1]: apply onTransformationEndContainer using TransformationLayout.Params.
val params = arguments?.getParcelable<TransformationLayout.Params>(paramsKey)
onTransformationEndContainer(params)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
// [Step2]: sets a transition name to the target view.
detail_container.transitionName = poster.name
}
Published by skydoves over 4 years ago
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);
Published by skydoves over 4 years ago
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)
}
Published by skydoves over 4 years ago
Released version 1.0.1
.
withView
, withContext
functionalities are added.We can use it instead of withActivity
in non-activity class like what RecyclerView.Adapter
.
Published by skydoves over 4 years ago
Released the first version 1.0.0
.