pull/32/head
gedoor 6 years ago
parent 9957b29426
commit 1d7410e22f
  1. 3
      app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt
  2. 1
      app/src/main/res/layout/activity_qrcode_capture.xml

@ -5,6 +5,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.View
import androidx.lifecycle.AndroidViewModel
import cn.bingoogolapple.qrcode.core.QRCodeView
import io.legado.app.R
@ -66,7 +67,7 @@ class QrCodeActivity : BaseActivity<AndroidViewModel>(), QRCodeView.Delegate {
.addPermissions(*Permissions.Group.CAMERA)
.rationale(R.string.qr_per)
.onGranted {
zxingview.startCamera() // 打开后置摄像头开始预览,但是并未开始识别
zxingview.visibility = View.VISIBLE
zxingview.startSpotAndShowRect() // 显示扫描框,并开始识别
}.request()
}

@ -8,6 +8,7 @@
android:id="@+id/zxingview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
app:qrcv_animTime="1000"
app:qrcv_barCodeTipText="将条码放入框内,即可自动扫描"
app:qrcv_barcodeRectHeight="120dp"

Loading…
Cancel
Save