Closed Click2cloud-Eros closed 3 years ago
try registering Component.DoubleClickedListener and you will be able to detect Double Tap in Custom Component, sample Usage
customComponent.setDoubleClickedListener(new Component.DoubleClickedListener() {
@Override
public void onDoubleClick(Component component) {
LogUtil.info(TAG, "double click detected");
}
});
Hi @GowthamRayar , Actually, I also want TouchEvent instance for getting pointer position to perfom my task. Sorry for wrong question. can I update my question OR create new issue with new question?
Describe the query
I am creating a custom component in HarmonyOS using Java SDK, Where I have to perform some task on double-tap. But I am not able to detect double-tap event.
In Android, with the help of GestureDetector class we can detect double-tap event as follow:
In HMOS, I have tried to detect double-tap using Component.TouchEventListener as follow:
but, It has not detected double-tap. On double-tap also it has printed single click detected.
Stackoverflow link here:
**** https://stackoverflow.com/questions/69086228/how-to-detect-double-tap-in-custom-component-in-harmonyos
Additional information
Developer Platform: Windows DevEco Studio version: 2.1 Beta 4 SDK API version: 5