diff --git a/app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt b/app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt index 6ea1d85bd..a5f6170fa 100644 --- a/app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt +++ b/app/src/main/java/io/legado/app/ui/qrcode/QrCodeActivity.kt @@ -64,17 +64,20 @@ class QrCodeActivity : BaseActivity(R.layout.activity_qrcode_capture), QRCodeVie .rationale(R.string.qr_per) .onGranted { zxingview.visibility = View.VISIBLE - zxingview.startSpotAndShowRect() // 显示扫描框,并开始识别 + //TODO 显示扫描框,并开始识别 + zxingview.startSpotAndShowRect() }.request() } override fun onStop() { - zxingview.stopCamera() // 关闭摄像头预览,并且隐藏扫描框 + //TODO 关闭摄像头预览,并且隐藏扫描框 + zxingview.stopCamera() super.onStop() } override fun onDestroy() { - zxingview.onDestroy() // 销毁二维码扫描控件 + //TODO 销毁二维码扫描控件 + zxingview.onDestroy() super.onDestroy() } @@ -96,7 +99,8 @@ class QrCodeActivity : BaseActivity(R.layout.activity_qrcode_capture), QRCodeVie override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) data?.data?.let { - zxingview.startSpotAndShowRect() // 显示扫描框,并开始识别 + //TODO 显示扫描框,并开始识别 + zxingview.startSpotAndShowRect() if (resultCode == Activity.RESULT_OK && requestCode == requestQrImage) { // 本来就用到 QRCodeView 时可直接调 QRCodeView 的方法,走通用的回调 diff --git a/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt b/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt index ee07a9244..4faaa8f35 100644 --- a/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replace/edit/ReplaceEditActivity.kt @@ -117,11 +117,13 @@ class ReplaceEditActivity : if (view is EditText) { val start = view.selectionStart val end = view.selectionEnd - val edit = view.editableText//获取EditText的文字 + //TODO 获取EditText的文字 + val edit = view.editableText if (start < 0 || start >= edit.length) { edit.append(text) } else { - edit.replace(start, end, text)//光标所在位置插入文字 + //TODO 光标所在位置插入文字 + edit.replace(start, end, text) } } }