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(
|
||||
factory = {
|
||||
ImageView(it).apply {
|
||||
this.setImageBitmap(
|
||||
QRCodeGenerator(
|
||||
key.key,
|
||||
400.dp.value.toInt(),
|
||||
400.dp.value.toInt()
|
||||
).qrCode
|
||||
)
|
||||
}
|
||||
ImageView(it)
|
||||
},
|
||||
update = { view ->
|
||||
view.setImageBitmap(
|
||||
QRCodeGenerator(
|
||||
key.key,
|
||||
400.dp.value.toInt(),
|
||||
400.dp.value.toInt()
|
||||
).qrCode
|
||||
)
|
||||
},
|
||||
modifier = Modifier.align(alignment = Alignment.Center)
|
||||
)
|
||||
|
@ -137,12 +137,17 @@ fun ImageMessageItem(message: MessageEntity, requestHolder: RequestHolder) {
|
||||
)
|
||||
}
|
||||
Card(modifier = Modifier.fillMaxWidth()) {
|
||||
AndroidView(factory = {
|
||||
ImageView(it).apply {
|
||||
scaleType = ImageView.ScaleType.FIT_CENTER
|
||||
load(message.text, requestHolder.coilImageLoader)
|
||||
}
|
||||
}, modifier = Modifier.fillMaxWidth())
|
||||
AndroidView(
|
||||
factory = {
|
||||
ImageView(it).apply {
|
||||
scaleType = ImageView.ScaleType.FIT_CENTER
|
||||
}
|
||||
},
|
||||
update = { view ->
|
||||
view.load(message.text, requestHolder.coilImageLoader)
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user