Coder Social home page Coder Social logo

alexzhirkevich / compottie Goto Github PK

View Code? Open in Web Editor NEW
130.0 2.0 2.0 2.45 MB

Compose Multiplatform Adobe After Effects Bodymovin (Lottie) animations rendering engine

License: MIT License

Kotlin 99.44% HTML 0.56%
aimation compose compose-multiplatform lottie lottie-animation lottie-compose

compottie's People

Contributors

alexzhirkevich 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

Forkers

ramybittar

compottie's Issues

Jvm desktop not draw

Android: lottie animation drawing is success.

Jvm : not work. Empty screen( no animation, no image


Composable
actual fun LoadingCardGeneralView(
    modifier: Modifier,
    bottomElement: @Composable (() -> Unit)?
) {
    val animationBites = remember {
        mutableStateOf(ByteArray(0))
    }

    LaunchedEffect(Unit) {
        withContext(Dispatchers.IO) {
            animationBites.value = Res.readBytes("files/loading.json")
        }
    }

    val jsonString = remember(animationBites.value) {
        mutableStateOf(animationBites.value.decodeToString())
    }

    val composition by rememberLottieComposition(
        LottieCompositionSpec.JsonString(jsonString.value)
    )

    val progress = animateLottieCompositionAsState(
        composition = composition,
        iterations = LottieConstants.IterateForever
    )

    val painter = rememberLottiePainter(composition, progress.value)


    Column(modifier = modifier) {
        Box(
            modifier = Modifier
                .fillMaxWidth()
                .ignoreHorizontalParentPadding(44.dp)
                .offset(y = (-63).dp)
                .wrapContentHeight(),
            contentAlignment = Alignment.TopCenter
        ) {
            Image(painter, contentDescription = null)
            //LottieAnimation(composition, progress = { progress.value })
        }
        if (bottomElement != null) {
            Column(modifier = Modifier.fillMaxWidth().offset(y = (-118).dp)) {
                bottomElement()
            }
        }
    }


}


supporting dot lottie

hi dear and thank alot for your useful library.

please add supporting dot lottie to your library as well

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.