GithubHelp home page GithubHelp logo

skydoves / transformationlayout Goto Github PK

View Code? Open in Web Editor NEW
2.3K 23.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 Issues

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

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!

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()

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

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 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!

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.

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.

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?

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.

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) 

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

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.

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.

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>

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.