GithubHelp home page GithubHelp logo

skydoves / transformationlayout Goto Github PK

View Code? Open in Web Editor NEW
2.3K 22.0 191.0 37.91 MB

🌠 Transform between two Views, Activities, and Fragments, or a View to a Fragment with container transform animations for Android.

License: Apache License 2.0

Kotlin 100.00%
android kotlin android-library android-ui transition motions material skydoves

transformationlayout's Introduction

TransformationLayout


🌠 Transform views, activity, and fragments into other components with container transform animations.


Google License API Build Status Profile

Download

Go to the Releases to download the demo APK.

Screenshots

Morphing Animation for Jetpack Compose

If you want to implement morphing animation in Jetpack Compose, check out Orbital.

Including in your project

Maven Central

Gradle

Add the dependency below to your module's build.gradle file:

dependencies {
    implementation("com.github.skydoves:transformationlayout:1.1.3")
}

Usage

Add the XML namespace below inside your XML layout file:

xmlns:app="http://schemas.android.com/apk/res-auto"

TransformationLayout

TransformationLayout is an essential concept to transform your Views, Activities, and Fragments into other components. You must wrap one or more Views that are supposed to be transformed using TransformationLayout like the example code below:

<com.skydoves.transformationlayout.TransformationLayout
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  app:transformation_targetView="@+id/my_cardView" // sets a target view.
  app:transformation_duration="450" // sets a duration of the transformation.
  app:transformation_direction="auto" // auto, entering, returning
  app:transformation_fadeMode="in" // in, out, cross, through
  app:transformation_fitMode="auto" // auto, height, width
  app:transformation_pathMode="arc" // arc, linear
>

   <!-- other complicated views -->

</com.skydoves.transformationlayout.TransformationLayout>

Transform into a view

For instance, you can transform a floating button into a CardView as you've seen in the example below:

<com.skydoves.transformationlayout.TransformationLayout
    android:id="@+id/transformationLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:transformation_duration="550"
    app:transformation_targetView="@+id/myCardView">

  <com.google.android.material.floatingactionbutton.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:backgroundTint="@color/colorPrimary"
      android:src="@drawable/ic_write"/>
</com.skydoves.transformationlayout.TransformationLayout>

<com.google.android.material.card.MaterialCardView
    android:id="@+id/myCardView"
    android:layout_width="240dp"
    android:layout_height="312dp"
    android:layout_marginLeft="30dp"
    android:layout_marginTop="30dp"
    app:cardBackgroundColor="@color/colorPrimary" />

Bind a TargetView

With the attribute below in your XML file, you can bind a targetView that should be transformed from the TransformationLayout. If you bind a targetView with a TransformationLayout, the targetView's visibility will be GONE by default.

app:transformation_targetView="@+id/myCardView"

You can also bind a targetView with a TransformationLayout using bindTargetView method like the code below:

transformationLayout.bindTargetView(myCardView)

Starting and finishing the transformation

After binding a targetView, we can start or finish transformation using the below methods.

// start transformation when touching the fab.
fab.setOnClickListener {
  transformationLayout.startTransform()
}

// finish transformation when touching the myCardView.
myCardView.setOnClickListener {
  transformationLayout.finishTransform()
}

Here are other functionalities to starting and finishing transformation.

// starts and finishes transformation 1000 milliseconds later.
// If we use this method on onCreate() method, it will starts transformation automatically 200ms later.
transformationLayout.startTransformWithDelay(200)
transformationLayout.finishTransformWithDelay(200)

// starts and finishes transformation with stopping a parent layout.
transformationLayout.startTransform(parent)
transformationLayout.finishTransform(parent)

OnTransformFinishListener

We can listen a TransformationLayout is transformed or not using OnTransformFinishListener.

transformationLayout.setOnTransformFinishListener {
  Toast.makeText(context, "is transformed: $it", Toast.LENGTH_SHORT).show()
}

Here is the Java way.

transformationLayout.onTransformFinishListener = new OnTransformFinishListener() {
  @Override public void onFinish(boolean isTransformed) {
    Toast.makeText(context, "is transformed:" + isTransformed, Toast.LENGTH_SHORT).show();
  }
};

Transform into an Activity

We can implement transformation between activities easily using TransformationActivity and TransformationCompat.

Here is an example of transforming a floating action button to Activity.
We don't need to bind a targetView.

<com.skydoves.transformationlayout.TransformationLayout
    android:id="@+id/transformationLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:transformation_duration="550">

  <com.google.android.material.floatingactionbutton.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:backgroundTint="@color/colorPrimary"
      android:src="@drawable/ic_write"/>
</com.skydoves.transformationlayout.TransformationLayout>

onTransformationStartContainer

We should add onTransformationStartContainer() to the Activity that has the floating action button. If your view is in the fragment, the code should be added to the fragment's Activity. It must be called before super.onCreate.

override fun onCreate(savedInstanceState: Bundle?) {
    onTransformationStartContainer() // should be called before super.onCreate().
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
}

Here is the Java way.

TransformationCompat.onTransformationStartContainer(this);

TransformationAppCompatActivity

Extends TransformationAppCompatActivity or TransformationActivity to your activity that will be transformed.

class DetailActivity : TransformationAppCompatActivity()

Here is the Java way.

public class DetailActivity extends TransformationAppCompatActivity 

TransformationCompat

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.startActivity(transformationLayout, intent);

Manually Transform into an Activity

Here is an example of transforming a floating action button to Activity.
We don't need to bind a targetView.

<com.skydoves.transformationlayout.TransformationLayout
    android:id="@+id/transformationLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:transformation_duration="550">

  <com.google.android.material.floatingactionbutton.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:backgroundTint="@color/colorPrimary"
      android:src="@drawable/ic_write"/>
</com.skydoves.transformationlayout.TransformationLayout>

onTransformationStartContainer

We should add onTransformationStartContainer() to the Activity that has the floating action button. If your view is in the fragment, the code should be added to the fragment's Activity. It must be called before super.onCreate.

override fun onCreate(savedInstanceState: Bundle?) {
    onTransformationStartContainer() // should be called before super.onCreate().
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
}

Here is the Java way.

TransformationCompat.onTransformationStartContainer(this);

startActivity

And we should call startActivity with bundle and intent data.
We should get a bundle using withActivity method. It needs a context and any name of transition.
The bundle must be used as startActivity's parameter.
We should put parcelable data to the intent using getParcelableParams() method.
The extra name of the parcelable data can be anything, and it will be reused later.

fab.setOnClickListener {
    val bundle = transformationLayout.withActivity(this, "myTransitionName")
    val intent = Intent(this, DetailActivity::class.java)
    intent.putExtra("TransformationParams", transformationLayout.getParcelableParams())
    startActivity(intent, bundle)
}

If we want to get bundle data in RecyclerView or other classes,
we can use withView and withContext instead of withActivty.

// usage in the RecyclerView.Adapter
override fun onBindViewHolder(holder: PosterViewHolder, position: Int) {
   val bundle = transformationLayout.withView(holder.itemView, "myTransitionName")
}

Here is the Java way.

Bundle bundle = transformationLayout.withActivity(this, "myTransitionName");
Intent intent = new Intent(this, DetailActivity.class);
intent.putExtra("TransformationParams", transformationLayout.getParcelableParams());
startActivity(intent, bundle);

onTransformationEndContainer

And finally, we should add onTransformationEndContainer() to the Activity that will be started.
It must be added before super.onCreate.

override fun onCreate(savedInstanceState: Bundle?) {
    onTransformationEndContainer(intent.getParcelableExtra("TransformationParams"))
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_detail)
}

Here is the Java way.

TransformationLayout.Params params = getIntent().getParcelableExtra("TransformationParams");
TransformationCompat.onTransformationEndContainer(this, params);

Transform into a Fragment

We can implement transformation between fragments for a single Activity application.
Here is an example of transforming a floating action button in Fragment A to Fragment B.

<com.skydoves.transformationlayout.TransformationLayout
    android:id="@+id/transformationLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:transformation_duration="550">

  <com.google.android.material.floatingactionbutton.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:backgroundTint="@color/colorPrimary"
      android:src="@drawable/ic_write"/>
</com.skydoves.transformationlayout.TransformationLayout>

onTransformationStartContainer

We should call onTransformationStartContainer() in the Fragment A that has the floating action button.

override fun onCreate(savedInstanceState: Bundle?) {
  super.onCreate(savedInstanceState)
  onTransformationStartContainer()
}

Here is the Java way.

TransformationCompat.onTransformationStartContainer(this);

getBundle and addTransformation

We should get a bundle from the TransformationLayout and put it into the argument.
And in the fragment manager's transaction, we should add the TransformationLayout using addTransformation method.

val fragment = MainSingleDetailFragment()
val bundle = transformationLayout.getBundle("TransformationParams")
bundle.putParcelable(MainSingleDetailFragment.posterKey, poster)
fragment.arguments = bundle

requireFragmentManager()
  .beginTransaction()
  .addTransformation(transformationLayout)
  .replace(R.id.main_container, fragment, MainSingleDetailFragment.TAG)
  .addToBackStack(MainSingleDetailFragment.TAG)
  .commit()
}

Here is the Java way

MainSingleDetailFragment fragment = new MainSingleDetailFragment();
Bundle bundle = transformationLayout.getBundle("TransformationParams", "transitionName");
fragment.setArguments(bundle);

FragmentTransaction fragmentTransaction = requireFragmentManager().beginTransaction();
TransformationCompat.addTransformation(
    fragmentTransaction, transformationLayout, "transitionName");
fragmentTransaction.replace(R.id.main_container, fragment, MainSingleDetailFragment.TAG)
    .addToBackStack(MainSingleDetailFragment.TAG)
    .commit();

Transition name in Fragment A

We must set a specific transition name to the TransformationLayout.
If you want to transform a recyclerView's item, set transiton name in onBindViewHolder.

transformationLayout.transitionName = "myTransitionName"

Here is the Java way.

transformationLayout.setTransitionName("myTransitionName");

onTransformationEndContainer in Fragment B

We should get a TransformationLayout.Params from the arguments, and call onTransformationEndContainer method.
It must be called in onCreate method.

override fun onCreate(savedInstanceState: Bundle?) {
  super.onCreate(savedInstanceState)

  val params = arguments?.getParcelable<TransformationLayout.Params>("TransformationParams")
  onTransformationEndContainer(params)
}

Here is the Java way.

TransformationLayout.Params params = getArguments().getParcelable("TransformationParams");
TransformationCompat.onTransformationEndContainer(this, params);

Transition name in Fragment B

And finally set the specific transition name (same as the transformationLayot in Fragment A)
to the target view in Fragment B in onViewCreated.

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
  super.onViewCreated(view, savedInstanceState)
   
  detail_container.transitionName = "myTransitionName"
}

TransformationLayout Attributes

Attributes Type Default Description
targetView resource id none Bind a targetView that will be transformed.
duration Long 350L Duration of the transformation.
pathMotion Motion.ARC, Motion.LINEAR default layout Indicates that this transition should be drawn as the which path.
containerColor Color Color.TRANSPARENT Set the container color to be used as the background of the morphing container.
allContainerColor Color Color.TRANSPARENT The all container colors (start and end) to be used as the background of the morphing container.
scrimColor Color Color.TRANSPARENT Set the color to be drawn under the morphing container.
direction Direction.AUTO, Direction.ENTER, Direction.RETURN Direction.AUTO Set the direction to be used by this transform.
fadeMode FadeMode.IN, FadeMode.OUT, FadeMode.CROSS, FadeMode.THROUGH FadeMode.IN Set the FadeMode to be used to swap the content of the start View with that of the end View.
fitMode FitMode.AUTO, FitMode.WIDTH, FitMode.HEIGHT FitMode.AUTO Set the fitMode to be used when scaling the incoming content of the end View.
startElevation Float ELEVATION_NOT_SET The elevation that will be used to render a shadow around the container at the start of the transition.
endElevation Float ELEVATION_NOT_SET The elevation that will be used to render a shadow around the container at the end of the transition.
elevationShadowEnabled Boolean true if (version > Pie) Whether shadows should be drawn around the container to approximate native elevation shadows on the start and end views.
holdAtEndEnabled Boolean false Whether to hold the last frame at the end of the animation.

Additional 🎈

You can reference the usage of the TransformationLayout in another repository MarvelHeroes.
A demo application based on modern Android application tech-stacks and MVVM architecture.

screenshot

Find this library useful? ❤️

Support it by joining stargazers for this repository. ⭐
And follow me for my next creations! 🤩

License

Copyright 2020 skydoves (Jaewoong Eum)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

transformationlayout's People

Contributors

lcsphantom avatar skydoves avatar vitusortner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transformationlayout's Issues

RecyclerView item disappears after Transformation

  • Library Version 1.04
  • Affected Device(s) [Huawei 4C, android 6.0.0]

when i Transform into DetailsActivity from a RecyclerView and then come back to RecyclerView, the item that i Clicked on will disappear

MovieDetialsActivity:

class MovieDetailsActivity : TransformationAppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_movie_details)

        intent.getParcelableExtra<Movie>(MOVIE_DETAILS_KEY)?.let {
            movieDetailsPoster.loadFromUrl(it.poster)
            movieDetailsTitle.text = it.title
        }
    }

    companion object {

        private const val MOVIE_DETAILS_KEY = "key:movie-details"

        fun startActivity(
            context: Context,
            transformationLayout: TransformationLayout,
            movie: Movie
        ) {
            val intent = Intent(context, MovieDetailsActivity::class.java)
            intent.putExtra(MOVIE_DETAILS_KEY, movie)
            TransformationCompat.startActivity(transformationLayout, intent)
        }
    }

}

calling Transform to MovieDetailsActivity from RecyclerViewCallback:

private fun showMovieDetails(movie: Movie, transformationLayout: TransformationLayout,  position: Int) {
   context?.let { MovieDetailsActivity.startActivity(it, transformationLayout, movie) }
}

RecyclerView item layout:

<?xml version="1.0" encoding="utf-8"?>
<com.skydoves.transformationlayout.TransformationLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/searchMoviesItem"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:transformation_duration="500"
    app:transformation_pathMode="arc">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="240dp"
        android:layout_margin="2dp">

        <ImageView
            android:id="@+id/searchMoviesItemPoster"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

    </FrameLayout>

</com.skydoves.transformationlayout.TransformationLayout>

Duplicate Value

Hi, i'm interesting with this library, but i got some error duplicate.
I'm already using google material 1.3.0-alpha01 and this library version is 1.0.5, so when i build my app some error came up.

image

Could you tell me what is wrong with this? Thank you

It not working with navigation component

Please complete the following information:

  • Library Version [e.g. v1.0.7]
  • Affected Device(s) [e.g. Android 10.0]

Describe the Bug:
I using navigation component call Home fragment => Home Detail Fragment, it not working with navigation component.
Can you please give me more instructions

====>RecyclerView Adapter

 holder.binding.transformationLayout.transitionName = data[position].id.toString()
        holder.binding.layoutRoot.setOnClickListener {
            onItemClickListener?.let {
                onItemClickListener?.onItemClick(
                    holder.binding.transformationLayout,
                    holder.binding.transformationLayout,
                    data[position]
                )
            }
        }

====>Home Fragment

  override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        onTransformationStartContainer()
    }


  val bundle = itemView.getBundle(Constants.PARAMS_LAYOUT_KEY)
        bundle.putParcelable("detail_feature_key", item)
        val extras = FragmentNavigatorExtras(view to Constants.PARAMS_LAYOUT_KEY)
        findNavController().navigate(
            R.id.action_global_homeFeatureDetailFragment,
            bundle,
            null,
            extras
        )

=====>Home Detail Fragment

override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        sharedElementEnterTransition = TransitionInflater.from(context).inflateTransition(android.R.transition.move)
        arguments?.let {
            paramsLayout = it.getParcelable(PARAMS_LAYOUT_KEY)
            if(paramsLayout != null) {
                onTransformationEndContainer(paramsLayout)
            }
        }
    }

The dialog goes away when another activity or fragment comes to the foreground.

Please complete the following information:

  • Library Version [v1.0.9]
  • Affected Device(s) [e.g. Samsung Galaxy s9 with Android 9.0]

Describe the Bug:

When a another activity or fragment comes to the foreground and you navigate back, the dialog's visibility is gone.

Expected Behavior:

I expexted the dialog to persist even after the lifecycle event occur.

java.lang.NoClassDefFoundError:

I have direct fetch the code and run without build error, then app crash either vm or my phone. I can't found the issues.
here is the output, I know it come from other app but it seem like the real problem coming from this libaray.
the orignal project in HERE

2021-05-06 14:11:38.439 5267-5267/com.skydoves.marvelheroes E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.skydoves.marvelheroes, PID: 5267
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/material/transition/MaterialContainerTransformSharedElementCallback;
at com.skydoves.transformationlayout.TransitionExtensionKt.onTransformationStartContainer(TransitionExtension.kt:31)
at com.skydoves.marvelheroes.view.ui.main.MainActivity.onCreate(MainActivity.kt:30)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.material.transition.MaterialContainerTransformSharedElementCallback" on path: DexPathList[[zip file "/data/app/com.skydoves.marvelheroes-2/base.apk"],nativeLibraryDirectories=[/data/app/com.skydoves.marvelheroes-2/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.skydoves.transformationlayout.TransitionExtensionKt.onTransformationStartContainer(TransitionExtension.kt:31) 
at com.skydoves.marvelheroes.view.ui.main.MainActivity.onCreate(MainActivity.kt:30) 
at android.app.Activity.performCreate(Activity.java:6662) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6077) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756) 

e: java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type: ErrorScope{Error scope for class <ERROR CLASS> with arguments: org.jetbrains.kotlin.types.IndexedParametersSubstitution@1d5f0d39}

When i add the dependency implementation("com.github.skydoves:transformationlayout:1.1.2") and try to build or run the app i got this error

e: java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type: ErrorScope{Error scope for class with arguments: org.jetbrains.kotlin.types.IndexedParametersSubstitution@1d5f0d39}
[ERROR : ArrayList]
at org.jetbrains.kotlin.types.SimpleTypeImpl.(KotlinTypeFactory.kt:225)
at org.jetbrains.kotlin.types.KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(KotlinTypeFactory.kt:155)
at org.jetbrains.kotlin.types.KotlinTypeFactory.simpleType(KotlinTypeFactory.kt:82)
at org.jetbrains.kotlin.types.KotlinTypeFactory.simpleType$default(KotlinTypeFactory.kt:71)
at org.jetbrains.kotlin.types.TypeSubstitutionKt.replace(TypeSubstitution.kt:167)
at org.jetbrains.kotlin.types.TypeSubstitutionKt.replace(TypeSubstitution.kt:152)
at org.jetbrains.kotlin.types.TypeSubstitutionKt.replace$default(TypeSubstitution.kt:140)
at org.jetbrains.kotlin.kapt3.util.TypeUtilsKt.replaceAnonymousTypeWithSuperType(typeUtils.kt:53)
at org.jetbrains.kotlin.kapt3.KaptAnonymousTypeTransformer.transformAnonymousType(KaptAnonymousTypeTransformer.kt:27)
at org.jetbrains.kotlin.resolve.DescriptorResolver.transformAnonymousTypeIfNeeded(DescriptorResolver.java:1064)
at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver$resolveTypeNullable$1.invoke(VariableTypeAndInitializerResolver.kt:95)
at org.jetbrains.kotlin.resolve.VariableTypeAndInitializerResolver$resolveTypeNullable$1.invoke(VariableTypeAndInitializerResolver.kt:85)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:527)
at org.jetbrains.kotlin.types.DeferredType.getDelegate(DeferredType.java:106)
at org.jetbrains.kotlin.types.WrappedType.getAnnotations(KotlinType.kt:126)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:109)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.doForceResolveAllContents(ForceResolveUtil.java:96)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:42)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:52)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:47)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.doForceResolveAllContents(LazyClassDescriptor.java:669)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.lambda$new$4(LazyClassDescriptor.java:220)
at org.jetbrains.kotlin.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:408)
at org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor.forceResolveAllContents(LazyClassDescriptor.java:657)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.doForceResolveAllContents(ForceResolveUtil.java:78)
at org.jetbrains.kotlin.resolve.lazy.ForceResolveUtil.forceResolveAllContents(ForceResolveUtil.java:42)
at org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension$doAnalysis$1.invoke(PartialAnalysisHandlerExtension.kt:72)
at org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension$doAnalysis$1.invoke(PartialAnalysisHandlerExtension.kt:67)
at org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension.doForEachDeclaration(PartialAnalysisHandlerExtension.kt:123)
at org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension.doForEachDeclaration(PartialAnalysisHandlerExtension.kt:138)
at org.jetbrains.kotlin.resolve.jvm.extensions.PartialAnalysisHandlerExtension.doAnalysis(PartialAnalysisHandlerExtension.kt:67)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.doAnalysis(Kapt3Extension.kt:152)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:123)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:99)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:301)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:55)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:113)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:292)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:102)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:60)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:172)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:54)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:91)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:93)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:471)
at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:123)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally(IncrementalCompilerRunner.kt:367)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileIncrementally$default(IncrementalCompilerRunner.kt:309)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl$rebuild(IncrementalCompilerRunner.kt:115)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:167)
at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:77)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:623)
at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:101)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1718)
at jdk.internal.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

e: /Users/samishorman/.gradle/caches/transforms-3/4c051a7372b52c1b2e572a58940509cc/transformed/jetified-kotlin-stdlib-1.8.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/samishorman/.gradle/caches/transforms-3/4c051a7372b52c1b2e572a58940509cc/transformed/jetified-kotlin-stdlib-1.8.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/samishorman/.gradle/caches/transforms-3/4c051a7372b52c1b2e572a58940509cc/transformed/jetified-kotlin-stdlib-1.8.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/samishorman/.gradle/caches/transforms-3/a8892c69e7b94b3f9dbaa72c91d1d001/transformed/jetified-kotlin-android-extensions-runtime-1.8.10.jar!/META-INF/kotlin-android-extensions-runtime.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/samishorman/.gradle/caches/transforms-3/c1fcb1bee1c5b01935ec0d852e3b3456/transformed/jetified-transformationlayout-1.1.2-api.jar!/META-INF/transformationlayout_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
e: /Users/samishorman/.gradle/caches/transforms-3/cb485a664d46a2e2cc9f3ed7d8aa9c24/transformed/jetified-kotlin-stdlib-common-1.8.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.

Animation Glitch when back button is pressed

Please complete the following information:

  • Library Version : 1.0.7 and Material : 1.3.0

  • Affected Device(s) : Pixel 3a XL with Android 10 and Pixel 4a with Android 11

Describe the Bug:

I have a button which start an activity, when I click on it the transition is smooth and works perfectly but when I press the back Button, the animation is glitching for a fraction of a second.

2021.03.07-20.36.online-video-cutter.com.mp4

Material design dependency

Please complete the following information:

  • Library Version [e.g. v1.0.0]
  • Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0]

Describe the Bug:

Add a clear description about the problem.

Expected Behavior:

A clear description of what you expected to happen.

Library version 1.0.4

The Google material dependency for this library is stated 1.2.0 alpha 6 which is breaking the login /signup activity of my app, which is made with version 1.0.0.

How do i solve this?

Material latest version is not supported

I am currently using the implementation 'com.google.android.material: material: 1.3.0-alpha01' but there is something wrong with it, I had difficulty applying it to my project. I downgraded to determine which version started after the problem and found that this library is running in the latest implementation 'com.google.android.material: material: 1.2.0-alpha06'. Please can you update the library according to the latest versions of addictions?

Activity A to Activity B

1583029997038mza
it has a little shake

Thanks for your library , could you please help me ,this is my code

ActivityA:
`public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {

    TransitionExtensionKt.onTransformationStartContainer(this);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);


    TextView tv = findViewById(R.id.tv);
    final TransformationLayout tLayout = findViewById(R.id.tLayout);

    tv.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Bundle bundle = tLayout.withActivity(MainActivity.this, "myTransitionName");
            Intent intent = new Intent(MainActivity.this, Main2Activity.class);
            intent.putExtra("TransformationParams", tLayout.getParcelableParams());
            startActivity(intent, bundle);
        }
    });


}

}`

ActivityB:
`public class Main2Activity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {

    TransformationLayout.Params params = getIntent().getParcelableExtra("TransformationParams");
    TransitionExtensionKt.onTransformationEndContainer(this, params);

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main2);

}

}`

minSdkVersion 21
targetSdkVersion 29

What's the problem

Nested transitions

Say you have 3 activities: A, B and C

  1. In activity A the user clicks to start activity B.
  2. In activity B the user clicks to start Activity C.
  3. Now the user presses back twice.

How can you preserve the first transition?

Layout completely gone on quick back press

Library version: 1.1.3
Affected device: Samsung Galaxy Note 10 lite with Android 13

Bug:
I use the fragment to fragment transformation and the layout of my fragments be completely invisible if I quickly press the back button right after (or while) the transformation happens.

Transition noo work when return to Fragment with RecyclerView

I have a grid recyclerview in fragment, which hosted in viewpager. Transition normally works when i open DetailFragment, but no transition effect when press back button...What i'm missing?
I use ListAdapter.

//frag with recyclerview
override fun onCreate(savedInstanceState: Bundle?) {
onTransformationStartContainer()
super.onCreate(savedInstanceState)
}

// put bundle
fun newInstance(artist_id: Int, transformationLayout:TransformationLayout): ArtistInfo {
val fragment = ArtistInfo()
fragment.transition_name=transformationLayout.transitionName
val bundle = transformationLayout?.getBundle("TransformationParams")
bundle.putInt("artist_id", artist_id)
fragment.arguments = bundle
return fragment
}
// detailfrag
override fun onCreate(savedInstanceState: Bundle?) {
val params = arguments?.getParcelable<TransformationLayout.Params>("TransformationParams")
onTransformationEndContainer(params)
super.onCreate(savedInstanceState)

// loading new fragment
val transaction = supportFragmentManager.beginTransaction()
.addTransformation(transformationLayout)
.replace(R.id.albumFragcontainer, fragment, tag)
.addToBackStack(tag)
.commit()

How to start transformationActivity without previous Activity or Fragment has TrasformationLayout

I want to start TransformationActivity(in my project, DetailActivity about movie) through Notification's pending intent.
So do I, this exception occurs

Caused by: java.lang.IllegalArgumentException: TransformationLayout.Params must not be a null. check your intent key value is correct.
at com.skydoves.transformationlayout.TransitionExtensionKt.onTransformationEndContainer(TransitionExtension.kt:38)
at com.skydoves.transformationlayout.TransformationAppCompatActivity.onCreate(TransformationAppCompatActivity.kt:27)

Do you have any solution, if you have please let me know. Thank you!

The card will offset after back to HomeFragment

  • Library Version [v1.1.0]
  • Affected Device(s) [LG G with Android 5.0.2, also found on some low-end devices]

The card will offset after back to HomeFragment while using demo project. See below:

text.mp4

It‘s really strange, any idea?

Thanks!

Animation flashes when background is white

  • Library Version v1.0.6
  • Multiple devices, and emulators

I'm using the animation from a button to an Activity, I tried both examples (with and without a bundle) as described in the readme, and when the background of the destination activity is dark (as all the examples are), it works fine, but when I leave the destinations activity background blank (white) it flashes for a moment.

kotlin to Java?

Is your feature request related to a problem?

A clear and concise description of what the problem is.

Describe the solution you'd like:

A clear and concise description of what you want to happen.

Describe alternatives you've considered:

A clear description of any alternative solutions you've considered.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.