λ°μμ
10/25/2024, 11:22 AMBox(
modifier = Modifier
.fillMaxSize()
.background(DmsTheme.colors.background),
contentAlignment = Alignment.Center,
) {
DmsLottieAnimation(
modifier = Modifier
.fillMaxSize()
.horizontalPadding(100.dp)
.background(DmsTheme.colors.background),
animationFileName = animationName
)
}
@Composable
actual fun DmsLottieAnimation(
modifier: Modifier,
animationFileName: String,
) {
UIKitViewController(
factory = {
LottieControllerProvider.lottieAnimationController(animationFileName)
},
modifier = modifier,
)
}
fun mainViewController(
lottieUIViewController: (String) -> UIViewController
) = ComposeUIViewController(
configure = { LottieControllerProvider.lottieAnimationController = lottieUIViewController }
) {
DmsApp()
}
*func* makeUIViewController(context: Context) -> UIViewController {
MainViewControllerKt.mainViewController(
lottieUIViewController: { animationName *in*
*return* UIHostingController(rootView: DmsLottieView(animationName: animationName))
}
)
}
*struct* DmsLottieView: UIViewRepresentable {
*var* animationName: String
*func* makeUIView(context: Context) -> LottieAnimationView {
*let* animationView = LottieAnimationView(name: animationName)
animationView.translatesAutoresizingMaskIntoConstraints = false
animationView.contentMode = .scaleAspectFit
animationView.backgroundColor = UIColor.clear
animationView.isOpaque = *false*
animationView.play()
*return* animationView
}
func updateUIView(_ uiView: LottieAnimationView, context: Context) {
uiView.backgroundColor = UIColor.clear
NSLayoutConstraint.activate([
uiView.widthAnchor.constraint(equalTo: uiView.widthAnchor),
uiView.heightAnchor.constraint(equalTo: uiView.heightAnchor)
])
}
}Zach Klippenstein (he/him) [MOD]
10/25/2024, 4:35 PMVaibhav Jaiswal
10/28/2024, 5:39 AMλ°μμ
10/28/2024, 7:39 AMVaibhav Jaiswal
10/28/2024, 7:43 AMλ°μμ
10/28/2024, 7:47 AMorg.jetbrains.kotlinx:kotlinx-serialization-json
Vaibhav Jaiswal
10/28/2024, 7:48 AMλ°μμ
10/28/2024, 7:49 AMλ°μμ
10/28/2024, 9:52 AMCompilation failed: IrTypeAliasSymbolImpl is already bound. Signature: <http://io.ktor.utils.io|io.ktor.utils.io>.core/ByteReadPacket|null[0]. Owner: TYPEALIAS name:ByteReadPacket visibility:public expandedType:kotlinx.io.Source
jamshedalamqaderi
10/28/2024, 11:28 AMλ°μμ
10/28/2024, 11:31 AM