Skip to content

Commit 6cf8f03

Browse files
committed
feat: package setupApiKeyInput function
1 parent 2740b28 commit 6cf8f03

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

android/app/src/main/java/com/httpsms/LoginActivity.kt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,22 @@ class LoginActivity : AppCompatActivity() {
3838
setPhoneNumber()
3939
disableSim2()
4040
setServerURL()
41+
setupApiKeyInput()
42+
}
43+
44+
private fun setupApiKeyInput() {
4145
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 的点击事件监听器
4254
apiKeyInputLayout.setEndIconOnClickListener {
55+
Toast.makeText(this, "End icon clicked", Toast.LENGTH_SHORT).show()
56+
// 在这里处理 endIcon 的点击事件,例如启动相机扫描
4357
startQrCodeScan()
4458
}
4559
}

0 commit comments

Comments
 (0)