mirror of
https://github.com/easychen/pushdeer.git
synced 2024-11-01 08:09:19 +08:00
android: Fix list updating for image and QR code
This commit is contained in:
parent
c6caf87a0a
commit
4673418d95
@ -136,15 +136,16 @@ fun KeyItem(key: PushKey, requestHolder: RequestHolder) {
|
|||||||
) {
|
) {
|
||||||
AndroidView(
|
AndroidView(
|
||||||
factory = {
|
factory = {
|
||||||
ImageView(it).apply {
|
ImageView(it)
|
||||||
this.setImageBitmap(
|
},
|
||||||
|
update = { view ->
|
||||||
|
view.setImageBitmap(
|
||||||
QRCodeGenerator(
|
QRCodeGenerator(
|
||||||
key.key,
|
key.key,
|
||||||
400.dp.value.toInt(),
|
400.dp.value.toInt(),
|
||||||
400.dp.value.toInt()
|
400.dp.value.toInt()
|
||||||
).qrCode
|
).qrCode
|
||||||
)
|
)
|
||||||
}
|
|
||||||
},
|
},
|
||||||
modifier = Modifier.align(alignment = Alignment.Center)
|
modifier = Modifier.align(alignment = Alignment.Center)
|
||||||
)
|
)
|
||||||
|
@ -137,12 +137,17 @@ fun ImageMessageItem(message: MessageEntity, requestHolder: RequestHolder) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Card(modifier = Modifier.fillMaxWidth()) {
|
Card(modifier = Modifier.fillMaxWidth()) {
|
||||||
AndroidView(factory = {
|
AndroidView(
|
||||||
|
factory = {
|
||||||
ImageView(it).apply {
|
ImageView(it).apply {
|
||||||
scaleType = ImageView.ScaleType.FIT_CENTER
|
scaleType = ImageView.ScaleType.FIT_CENTER
|
||||||
load(message.text, requestHolder.coilImageLoader)
|
|
||||||
}
|
}
|
||||||
}, modifier = Modifier.fillMaxWidth())
|
},
|
||||||
|
update = { view ->
|
||||||
|
view.load(message.text, requestHolder.coilImageLoader)
|
||||||
|
},
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user