Gesture customization gesture-customization

CAUTION
AEM 6.4 has reached the end of extended support and this documentation is no longer updated. For further details, see our technical support periods. Find the supported versions here.

You can customize the gestures of AEM Forms app to provide a distinct method of interacting with the app. For example, you can add new gestures to open or close a task or Startpoint.

To customize gestures in AEM Forms app to-customize-gestures-in-aem-forms-app

In the AEM Forms app, the left swipe opens up a new task or Startpoint while right swipe does nothing. The following example provides steps to open up a new task or Startpoint on performing the right-swipe gestures in the AEM Forms app.

  1. Open your project.

    • For iOS, open Capture.xcodeproj in Xcode
    • For Android, open the Android project in Eclipse.
    • For Windows, open MWSWindows.sln in Visual Studio.
  2. Navigate to the views folder and open the task.js file for editing.

    • In Xcode, navigate to the Capture > www > wsmobile > js > runtime > views folder.
    • In Eclipse, navigate to the assets > www > wsmobile > js > runtime > views folder.
    • In Visual Studio, navigate to the MWSWindows > www > wsmobile > js > runtime > views folder.
    note note
    NOTE
    The task.js file contains the backbone view associated with each task or Startpoint listed in the task or Startpoint lists.
  3. In the task.js file, search for the events property of the view.

    The events property is a map with each entry in the format:

    "EventName Selector": "Function"

    When you trigger a Javascript event named EventNameon an HTML element specified by Selector, the Functionis called.

  4. Find

    • “tap .taskContentArea” : “onTaskClick”,

      “tap .taskOpenArea” : “onTaskClick”,

      “tap .task-content” : “onTaskClick”,

      “tap .last_empty_div” : “onTaskClick”,

    and replace with

    • “swipe .taskContentArea” : “onTaskClick”,

      “swipe .taskOpenArea” : “onTaskClick”,

      “swipe .task-content” : “onTaskClick”,

      “swipe .last_empty_div” : “onTaskClick”,

  5. Save and close the task.js file.

  6. Build and run the AEM Forms app. Now you can open a using with left-swipe and right-swipe.

Similarly, you can make changes in other views for various combinations of gestures, HTML elements, and functions.

recommendation-more-help
a6ebf046-2b8b-4543-bd46-42a0d77792da