fix touch bug

master
wlt233 2 years ago
parent 51dd062bfa
commit d00df49087

@ -99,10 +99,6 @@ class MainActivity : AppCompatActivity() {
if (nfcPendingIntent != null) { if (nfcPendingIntent != null) {
nfcAdapter?.enableForegroundDispatch(this, nfcPendingIntent, null, null) nfcAdapter?.enableForegroundDispatch(this, nfcPendingIntent, null, null)
} }
// val orgSys = nfcFCardEmulation?.getSystemCodeForService(nfcFComponentName)
// if (orgSys != null) {
// setSys(orgSys)
// }
nfcFCardEmulation?.enableService(this, nfcFComponentName) nfcFCardEmulation?.enableService(this, nfcFComponentName)
} }
@ -177,11 +173,11 @@ class MainActivity : AppCompatActivity() {
saveCards() saveCards()
} }
} }
cardView.setOnTouchListener { v, _ -> // cardView.setOnTouchListener { v, _ ->
editText.clearFocus() // editText.clearFocus()
v.performClick() // v.performClick()
true // true
} // }
true true
} }
R.id.card_menu_delete -> { R.id.card_menu_delete -> {
@ -249,6 +245,8 @@ class MainActivity : AppCompatActivity() {
showCardMenu(it, cardView) showCardMenu(it, cardView)
} }
cardView.setOnTouchListener { v, _ -> cardView.setOnTouchListener { v, _ ->
val editText = v.findViewById<EditText>(R.id.card_name_edit)
editText.clearFocus()
emuCard(v) emuCard(v)
v.performClick() v.performClick()
true true

Loading…
Cancel
Save