pull/1211/head
gedoor 3 years ago
parent e734ef7776
commit 765608a845
  1. 2
      app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt
  2. 1
      app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt

@ -20,7 +20,7 @@ class QrCodeActivity : BaseActivity<ActivityQrcodeCaptureBinding>(), OnScanResul
override val binding by viewBinding(ActivityQrcodeCaptureBinding::inflate)
private val selectQrImage = registerForActivityResult(ActivityResultContracts.GetContent()) {
it.readBytes(this)?.let { bytes ->
it?.readBytes(this)?.let { bytes ->
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
onScanResultCallback(QRCodeUtils.parseCodeResult(bitmap))
}

@ -43,6 +43,7 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
private var customWebViewCallback: WebChromeClient.CustomViewCallback? = null
private var webPic: String? = null
private val saveImage = registerForActivityResult(FilePicker()) {
it ?: return@registerForActivityResult
ACache.get(this).put(imagePathKey, it.toString())
viewModel.saveImage(webPic, it.toString())
}

Loading…
Cancel
Save