1

I am testing a mobile app I have built and noticed that when I manually clear a ToastBar message through the touch interface, if there is a Component beneath it, such as a Button, it is clicked as well.

I know that in Android native development, it is possible to mark a Component in a way that does not allow this to happen. Does anyone know if there is such a method or "attribute" in Codename One too?

Spyros
  • 339
  • 1
  • 7
  • You can use setEnabled(false) but that's probably not a good idea. Do you mean when you touch the toastbar or when you invoke `clear()` in code? I see a potential problem in our code. We'll push an improvement this Friday that might resolve this. – Shai Almog Jul 13 '21 at 01:51
  • Dear @ShaiAlmog, I edited the question to better reflect the circumstances. I provide more context here. A ToastBar message pops for whatever reason. I "touch" on it, trying to clear it manually. Beneath it, there is e.g., an exit `Button`. The message is cleared, and the app exits too... In Android, there is a way to set any `Component` as non "transparent", not allowing other `Components` beneath it to activate potential `ActionListener`s, which by the way is a security risk as well. Imagine someone purposely placing a rogue `Component` under a legit one. – Spyros Jul 13 '21 at 05:39
  • We have several ways of blocking an input to a component (including setEnabled). I think the fix I made might solve this issue though. Please try a build after this Friday to see if the issue was resolved. – Shai Almog Jul 14 '21 at 02:29
  • @ShaiAlmog I assume you disable a `Component` when overlapped by another? I have taken measures to address the issue differently. I will take the chance at a later time to test the new feature. Thank you very much for the quick correspondence. – Spyros Jul 14 '21 at 10:08
  • No. I consume the event – Shai Almog Jul 15 '21 at 02:15
  • @ShaiAlmog Ok, I assume you `consume` the event of the `Component` beneath or `consume` it in general so as not to trigger other than the intended action? – Spyros Jul 15 '21 at 05:22
  • We're open source, you can just look at the commit history and see ;-) https://github.com/codenameone/CodenameOne/commit/f43442e28e320ffc9b6cf9e41f0ffef7691df208#diff-d9fe70fd6c2b62298dab4ab9911aebba47cca5f76811eefb2e95548b536ca23f – Shai Almog Jul 16 '21 at 05:40
  • Forgot that @ShaiAlmog. Thank you for reminding it to me. – Spyros Jul 16 '21 at 09:44

0 Answers0