Git Product home page Git Product logo

fornewid / material-motion-compose Goto Github PK

View Code? Open in Web Editor NEW
546.0 7.0 12.0 14.91 MB

Material Motion for Jetpack Compose and Compose Multiplatform

Home Page: https://fornewid.github.io/material-motion-compose/

License: Apache License 2.0

Kotlin 98.68% Shell 1.32%
android-library jetpack-compose material-motion compose-multiplatform kotlin-multiplatform compose-animation android material-design

material-motion-compose's People

Contributors

fornewid avatar goooler 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

material-motion-compose's Issues

java.lang.NoSuchMethodError: No static method mutableStateOf(F)

material motion compose = 1.0.2
compose version = 2023.05.01
compose compiler = 1.4.7

java.lang.NoSuchMethodError: No static method mutableStateOf(F)Landroidx/compose/runtime/MutableFloatState; in class Landroidx/compose/runtime/PrimitiveSnapshotStateKt; or its super classes (declaration of 'androidx.compose.runtime.PrimitiveSnapshotStateKt'
at soup.compose.material.motion.MaterialMotionKt.MaterialMotion(MaterialMotion.kt:79)
at soup.compose.material.motion.MaterialMotionKt.MaterialMotion(MaterialMotion.kt:53)
at soup.compose.material.motion.MaterialFadeThroughKt.MaterialFadeThrough(MaterialFadeThrough.kt:40)

How to combine two or more MotionSpec

On Accompanist Navigation Animation, it can be done like this:

composable(
    route = "home",
    enterTransition = { _, _ ->
        slideInVertically() + fadeIn()
    },
)

But when i tried in Material Motion Navigation:

composable(
    route = "home",
    enterMotionSpec = { _, _ ->
        translateYIn() + holdIn()
    },
)

It gives error Type mismatch: inferred type is Unit but EnterMotionSpec was expected

So basically i wanted to use translate/slide and fade transition at the same time.

Weird back stack motion behavior on nested graph

I have 4 navigation routes: first, second, third, fourth.

When i try to navigate first -> second -> third -> fourth, the transitions behave normally as it should.

However when i try to navigate back (back press) first <- second <- third <- fourth, the only transition that behave normally is the first pop backstack (in this case third <- fourth), other pop backstack just overlaps the current backstack.

I'm not sure how to explain it well but i have included a sample project for testing it here and a video here

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/animation/AnimatedContentScope;

Describe the bug

"After updating the 'compose bom' to version '2023.03.00', the app crashes with the following exception:
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/animation/AnimatedContentScope; at soup.compose.material.motion.MaterialMotionKt$MaterialMotion$3$1.invoke(MaterialMotion.kt:85) at androidx.compose.animation.AnimatedContentKt.AnimatedContent(AnimatedContent.kt:759) at soup.compose.material.motion.MaterialMotionKt.MaterialMotion(MaterialMotion.kt:83) at soup.compose.material.motion.MaterialMotionKt.MaterialMotion(MaterialMotion.kt:55) at soup.compose.material.motion.MaterialFadeThroughKt.MaterialFadeThrough(MaterialFadeThrough.kt:111)

To Reproduce

Steps to reproduce the behavior:

  1. Update Compose Bom to 2023.03.00

Environment

  • material-motion-compose version: 0.10.4

navigation.navigateUp() returns to first route instead the previous route

Describe the bug

On v0.7.4, the back press behavior issue is fixed but when using navigation.navigateUp() it still occured.

To Reproduce

I have 3 routes, for example: splash, main, search. When i'm navigating splash -> main -> search, i called navigation.navigateUp() on search. It returns to main then splash reappears again.

Expected behavior

The splash route should not reappears after calling navigation.navigateUp() on search.

Environment

  • Android OS version: Android 10
  • Device: Xiaomi Mi A2
  • material-motion-compose version: 0.7.4

Additional context

Add any other context about the problem here.

Navigation Usage sample does not work?

Describe the bug

The navigation sample usage does not actually work, as rememberSlideDistance() cannot be called from the lambda, it needs to be in a composable function

To Reproduce

Steps to reproduce the behavior:
Implement the usage sample

Expected behavior

It works

java.lang.IllegalStateException

Getting this error and app crashes when navigating frequently
java.lang.IllegalStateException: You cannot access the NavBackStackEntry's ViewModels after the NavBackStackEntry is destroyed.

Full log

java.lang.IllegalStateException: You cannot access the NavBackStackEntry's ViewModels after the NavBackStackEntry is destroyed.
at androidx.navigation.NavBackStackEntry.getViewModelStore(NavBackStackEntry.kt:213)
at androidx.lifecycle.viewmodel.compose.ViewModelKt.get(ViewModel.kt:206)
at androidx.lifecycle.viewmodel.compose.ViewModelKt.viewModel(ViewModel.kt:156)

.
.
.
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2443)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2734)
at com.marketpulse.sniper.vte.view.bottom_panel.BottomPanelKt.Container(BottomPanel.kt:77)
at com.marketpulse.sniper.vte.view.bottom_panel.BottomPanelKt.access$Container(BottomPanel.kt:1)
at com.marketpulse.sniper.vte.view.bottom_panel.BottomPanelKt$BottomPanel$1.invoke(BottomPanel.kt:38)
at com.marketpulse.sniper.vte.view.bottom_panel.BottomPanelKt$BottomPanel$1.invoke(BottomPanel.kt:37)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$2.invoke(ComposableLambda.jvm.kt:141)
at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$2.invoke(ComposableLambda.jvm.kt:141)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:162)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2443)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2711)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3342)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3320)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:341)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3320)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3285)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:772)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1047)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:124)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:541)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:510)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1035)
at android.view.Choreographer.doCallbacks(Choreographer.java:845)
at android.view.Choreographer.doFrame(Choreographer.java:775)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1022)
2023-03-30 16:38:05.722 20395-20395 AndroidRuntime com.marketpulse.sniper.vte E at android.os.Handler.handleCallback(Handler.java:978)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loopOnce(Looper.java:238)
at android.os.Looper.loop(Looper.java:357)
at android.app.ActivityThread.main(ActivityThread.java:8090)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1026)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@21a437e, androidx.compose.ui.platform.MotionDurationScaleImpl@73350df, StandaloneCoroutine{Cancelling}@ef7912c, AndroidUiDispatcher@1ac67f5]

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.