File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
android/app/src/main/java/com/httpsms Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments