coil-kt/coil

rememberAsyncImagePainter renders nothing when using dragAndDropSource

Open

#2,150 创建于 2024年2月29日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)Kotlin (757 fork)batch import
help wanted

仓库指标

Star
 (11,779 star)
PR 合并指标
 (平均合并 20小时 14分钟) (30 天内合并 28 个 PR)

描述

Describe the bug The image is simply rendering nothing. There is nothing in the logs. When I remove the dragAndDropSource it works fine.

To Reproduce

                Box(
                    modifier = Modifier
                        .aspectRatio(1f)
                        .dragAndDropSource {
                            detectTapGestures (
                                onLongPress = {
                                    startTransfer(
                                        DragAndDropTransferData(
                                            clipData = ClipData.newPlainText("text/","${photo.id}"),
                                            flags = View.DRAG_FLAG_GLOBAL,
                                        )
                                    )
                                }
                            )
                        }
                ) {
                    Image(
                        painter = rememberAsyncImagePainter(photo.url),
                        contentDescription = photo.description,
                        contentScale = ContentScale.Crop,
                        modifier = Modifier.fillMaxSize()
                    )
                    Text(text = "${photo.id}")
                }

Logs/Screenshots Screenshot_20240229-013851 Screenshot_20240229-013928

Version I am using a google pixel 6, android 14. coil-compose = "2.6.0" activity-compose = "1.7.0"

贡献者指南