feat(server): 完善远程 UI 页面内容并优化文档解析日志
This commit is contained in:
@@ -79,17 +79,18 @@ private fun RemoteDocumentView(
|
||||
key(contentKey) {
|
||||
AndroidView(
|
||||
factory = { ctx ->
|
||||
Log.d("RemoteUIScreen", "Creating RemoteComposePlayer")
|
||||
// 仅创建播放器实例
|
||||
RemoteComposePlayer(ctx)
|
||||
},
|
||||
update = { view ->
|
||||
try {
|
||||
// 显式解析 ByteArray 为 RemoteDocument 对象
|
||||
// 1. 将二进制显式解析为 RemoteDocument 对象
|
||||
val document = RemoteDocument(bytes)
|
||||
// 2. 使用 RemoteDocument 重载版本设置文档,确保解析与生命周期同步
|
||||
view.setDocument(document)
|
||||
Log.d("RemoteUIScreen", "RemoteDocument set successfully")
|
||||
Log.d("RemoteUIScreen", "文档解析并加载成功: ${bytes.size} 字节")
|
||||
} catch (e: Exception) {
|
||||
Log.e("RemoteUIScreen", "Failed to set RemoteDocument", e)
|
||||
Log.e("RemoteUIScreen", "文档解析失败", e)
|
||||
}
|
||||
},
|
||||
modifier = modifier
|
||||
|
||||
Reference in New Issue
Block a user