How to handle a touch gesture to hold by pressing-shift slides between two buttons

I am trying to create a menu that will behave just like the Android on-screen keyboard, where when I press a key with accented characters like "i" a pop-up menu for accented characters is displayed. Then moving the finger to the button of any accented character in the pop-up menu selects / selects the button and, finally, releases the finger, enters the accented character into the target text field. I saw this behavior in Android v2.3, but not in older versions. Not sure if this is a new feature?

I would like to know how to handle the touch gesture in such a way that the main button (for example, ā€œiā€) responds to pressing and holding touch events, and then, after the pop-up window appears, the ā€œĆÆā€ button will respond to point and release touch events ? The user will not need to push his finger, so the movement will be a push-hold-shift slide between the two buttons.

I tried to find the code used on the Android keyboard, but was not successful, since I only got a focus on CharacterPickerDialog, which does not show clicking on the slide release between the two buttons, as it requires the user to release before choosing a button in the pop-up menu .

Hope someone can provide some information and understand this. Thanks in advance!

+3
source share

Source: https://habr.com/ru/post/1784878/


All Articles