Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn How To Use Long Tap Gestures In Delphi With FMX.TapAndHold Sample

FMX.TapAndHold Sample uses TGestureManager.

Location

You can find the TapAndHold sample project at:

Description

The TapAndHold sample demonstrates how to use long tap gestures on an iOS or Android device. The sample demonstrates how to detect and act with long tap gestures.

How to Use the Sample

  1. Navigate to one of the locations given above and open:
    • Delphi: TapAndHold.dproj.
    • C++: TapAndHold.cbproj.
  2. Select the target platform, iOS and Android supported.
  3. Press F9 or choose Run > Run.
  4. Press the screen with a finger. Hold pressed to see a message with the tap location and the date-time information.

Files

File in DelphiFile in C++Contains
TapAndHold.dprojTapAndHold.cbprojThe project itself.
TapHoldForm.fmxTapHoldForm.fmxThe main form where the components are located.
TapHoldForm.pasTapAndHoldPCH.hTapAndHold.cppUsed to define and implement the sample.
Information.txtInformation.txtFurther information about the sample.

Implementation

The sample shows a picture. When the user holds press a finger on the picture, the TGestureEventInfo detects a long tap gesture and the screen shows a message with the location and date-time information of the long tap. The sample uses the field Location of the TGestureEventInfo to show the screen tap location and the FormatDateTime to show the date-time value of the long tap.

The link below will redirect you to the original post of the sample:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FMX.TapAndHold_Sample

Exit mobile version