1 parent 2740b28 commit 6cf8f03Copy full SHA for 6cf8f03
1 file changed
android/app/src/main/java/com/httpsms/LoginActivity.kt
@@ -38,8 +38,22 @@ class LoginActivity : AppCompatActivity() {
38
setPhoneNumber()
39
disableSim2()
40
setServerURL()
41
+ setupApiKeyInput()
42
+ }
43
+
44
+ private fun setupApiKeyInput() {
45
val apiKeyInputLayout = findViewById<TextInputLayout>(R.id.loginApiKeyTextInputLayout)
46
+ val apiKeyInput = findViewById<TextInputEditText>(R.id.loginApiKeyTextInput)
47
48
+ // 设置点击监听器启动扫描
49
+ apiKeyInput.setOnClickListener {
50
+ startQrCodeScan() // 触发 QR Code 扫描
51
52
53
+ // 设置 endIcon 的点击事件监听器
54
apiKeyInputLayout.setEndIconOnClickListener {
55
+ Toast.makeText(this, "End icon clicked", Toast.LENGTH_SHORT).show()
56
+ // 在这里处理 endIcon 的点击事件,例如启动相机扫描
57
startQrCodeScan()
58
}
59
0 commit comments