Skip to content

Commit

Permalink
chore: 🤖 updated to latest build from dotlottie-rs (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
afsalz authored Jun 6, 2024
1 parent 9e82af7 commit 110e45f
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dotlottie/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = "com.github.LottieFiles"
version = "0.3.0"
version = "0.3.1"

android {
namespace = "com.lottiefiles.dotlottie.core"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified dotlottie/src/main/jniLibs/x86_64/libuniffi_dotlottie_player.so
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,11 @@ internal interface UniffiLib : Library {
uniffi_out_err: UniffiRustCallStatus,
): Byte

fun uniffi_dotlottie_player_fn_method_dotlottieplayer_segment_duration(
`ptr`: Pointer,
uniffi_out_err: UniffiRustCallStatus,
): Float

fun uniffi_dotlottie_player_fn_method_dotlottieplayer_set_config(
`ptr`: Pointer,
`config`: RustBuffer.ByValue,
Expand All @@ -1051,6 +1056,15 @@ internal interface UniffiLib : Library {
uniffi_out_err: UniffiRustCallStatus,
): Byte

fun uniffi_dotlottie_player_fn_method_dotlottieplayer_set_viewport(
`ptr`: Pointer,
`x`: Int,
`y`: Int,
`w`: Int,
`h`: Int,
uniffi_out_err: UniffiRustCallStatus,
): Byte

fun uniffi_dotlottie_player_fn_method_dotlottieplayer_stop(
`ptr`: Pointer,
uniffi_out_err: UniffiRustCallStatus,
Expand Down Expand Up @@ -1415,10 +1429,14 @@ internal interface UniffiLib : Library {

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_seek(): Short

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_segment_duration(): Short

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_set_config(): Short

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_set_frame(): Short

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_set_viewport(): Short

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_stop(): Short

fun uniffi_dotlottie_player_checksum_method_dotlottieplayer_subscribe(): Short
Expand Down Expand Up @@ -1555,12 +1573,18 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_dotlottie_player_checksum_method_dotlottieplayer_seek() != 60656.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_dotlottie_player_checksum_method_dotlottieplayer_segment_duration() != 38024.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_dotlottie_player_checksum_method_dotlottieplayer_set_config() != 39472.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_dotlottie_player_checksum_method_dotlottieplayer_set_frame() != 44086.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_dotlottie_player_checksum_method_dotlottieplayer_set_viewport() != 29505.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_dotlottie_player_checksum_method_dotlottieplayer_stop() != 25240.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -1689,6 +1713,29 @@ public object FfiConverterUInt : FfiConverter<UInt, Int> {
}
}

public object FfiConverterInt : FfiConverter<Int, Int> {
override fun lift(value: Int): Int {
return value
}

override fun read(buf: ByteBuffer): Int {
return buf.getInt()
}

override fun lower(value: Int): Int {
return value
}

override fun allocationSize(value: Int) = 4UL

override fun write(
value: Int,
buf: ByteBuffer,
) {
buf.putInt(value)
}
}

public object FfiConverterULong : FfiConverter<ULong, Long> {
override fun lift(value: Long): ULong {
return value.toULong()
Expand Down Expand Up @@ -2078,10 +2125,19 @@ public interface DotLottiePlayerInterface {

fun `seek`(`no`: kotlin.Float): kotlin.Boolean

fun `segmentDuration`(): kotlin.Float

fun `setConfig`(`config`: Config)

fun `setFrame`(`no`: kotlin.Float): kotlin.Boolean

fun `setViewport`(
`x`: kotlin.Int,
`y`: kotlin.Int,
`w`: kotlin.Int,
`h`: kotlin.Int,
): kotlin.Boolean

fun `stop`(): kotlin.Boolean

fun `subscribe`(`observer`: Observer)
Expand Down Expand Up @@ -2592,6 +2648,19 @@ open class DotLottiePlayer : Disposable, AutoCloseable, DotLottiePlayerInterface
)
}

override fun `segmentDuration`(): kotlin.Float {
return FfiConverterFloat.lift(
callWithPointer {
uniffiRustCall { _status ->
UniffiLib.INSTANCE.uniffi_dotlottie_player_fn_method_dotlottieplayer_segment_duration(
it,
_status,
)
}
},
)
}

override fun `setConfig`(`config`: Config) =
callWithPointer {
uniffiRustCall { _status ->
Expand All @@ -2617,6 +2686,28 @@ open class DotLottiePlayer : Disposable, AutoCloseable, DotLottiePlayerInterface
)
}

override fun `setViewport`(
`x`: kotlin.Int,
`y`: kotlin.Int,
`w`: kotlin.Int,
`h`: kotlin.Int,
): kotlin.Boolean {
return FfiConverterBoolean.lift(
callWithPointer {
uniffiRustCall { _status ->
UniffiLib.INSTANCE.uniffi_dotlottie_player_fn_method_dotlottieplayer_set_viewport(
it,
FfiConverterInt.lower(`x`),
FfiConverterInt.lower(`y`),
FfiConverterInt.lower(`w`),
FfiConverterInt.lower(`h`),
_status,
)
}
},
)
}

override fun `stop`(): kotlin.Boolean {
return FfiConverterBoolean.lift(
callWithPointer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,13 @@ fun DefaultAnimationDemo() {
autoplay = true,
loop = true,
eventListeners = listOf(events),
// source = DotLottieSource.Url("https://lottiefiles-mobile-templates.s3.amazonaws.com/ar-stickers/swag_sticker_piggy.lottie"),
source = DotLottieSource.Url("https://lottie.host/5525262b-4e57-4f0a-8103-cfdaa7c8969e/VCYIkooYX8.json"),
source = DotLottieSource.Url("https://lottiefiles-mobile-templates.s3.amazonaws.com/ar-stickers/swag_sticker_piggy.lottie"),
// source = DotLottieSource.Url("https://lottie.host/5525262b-4e57-4f0a-8103-cfdaa7c8969e/VCYIkooYX8.json"),
// source = DotLottieSource.Url("https://lottie.host/294b684d-d6b4-4116-ab35-85ef566d4379/VkGHcqcMUI.lottie"),
// source = DotLottieSource.Asset("swinging.json"),
modifier = Modifier
.background(Color.LightGray)
.size(200.dp),
controller = dotLottieController
)
}
}
Expand Down

0 comments on commit 110e45f

Please sign in to comment.