ActionListener Extension
Hello there, today I’m introducing the ActionListener extension, designed to enhance your Android apps with virtual keyboard event detection and handling. This extension allows you to capture various keyboard actions such as pressing the “Enter/ Done”, “Search” and “Go” keys within a text field. It even lets you define custom actions for additional virtual keys. With the latest update, we’ve added the ability to detect multi-touch events, providing you with information about the number of touches and whether a touch event occurred. This extension is invaluable when you want to add specific keyboard functionalities and multi-touch capabilities to your Android apps created in Kodular.
Features
With the ActionListener extension, you can:
- Register a text listener on a TextBox to detect and handle virtual keyboard events, including actions like pressing the “Enter,” “Search,” and “Go” keys.
- Easily clear the text in a TextBox, providing a clean slate for user input.
- Receive events triggered when supported keyboard actions are performed, giving you control over your app’s behavior.
- Detect multi-touch events and receive information about the number of touches and whether touch events occurred, enabling you to create more interactive and responsive apps.
Blocks
Use the “RegisterTextBox” block to set up a text listener on a TextBox.
The “ClearText” block allows you to clear the text in a TextBox.
Register the screen
Register the component
Component to capture multi-touch. Use the MultiTouch event!
Component to record the number of touches on the screen
Event to catch screen touches. Need to activate with ScreenTouched
Event to catch touches on a component. Need to activate with ComponentTouched
The “TextChanged” block triggers an event when a supported keyboard action is performed. Does not work with multi lines!
Example
Note: You cannot call the RegisterScreenTouched, RegisterTextBox, RegisterMultiTouch and RegisterComponentTouched methods at the same time, but only
Extension Details
- Extension Size: 12.6 KB
- Package: io.kodular.actionlistener
Download
You can download the extension AIX file:
io.actionlistener.aix (12.5 KB)
If you find this extension helpful and wish to support its development, you can make a donation here. Every contribution, starting from $2, goes a long way in sustaining further development.
Example Project
If you’d like to explore how the ActionListener extension works in practice, you can download the example AIA file (134.4 KB):
ActionListener.aia (131.3 KB)
Source [java]:
Permission to use the provided .java file is granted to anyone under the condition that the original author’s attribution is retained. Feel free to use and modify the file for your own projects, but please acknowledge the original author in your work.
Author: Francisco Iago Lira Passos.
Version 2
ActionListener.java (8.5 KB)
Your support is crucial for our ongoing mission. By donating, you can help us continue delivering budget-friendly solutions to our community.
Support
If you have questions or need assistance, you can reach us on Telegram.
Thank you for supporting us on this exciting journey!