Skip to content
CrossFly is 100% open sourceFollow us on GitHub
CrossFlyCrossFly
Get started

This documentation is currently available in Portuguese. English and other languages are on the way.

Cookbook

Cookbook

Short, to-the-point recipes by task — "how to do X" in CrossFly, with minimal code and links to go deeper.

Quick interface patterns — dialogs, dropdowns, hints and selection, each recipe with code ready to copy.

How-to🟢
How to open an actions menu (ActionSheet)

Show an iOS-style action sheet at the bottom of the screen, with buttons and a Cancel.

How-to🟡
How to place a badge on the corner of an avatar

Position a badge/counter overlaid on the corner of another component with RelativeLayout.

How-to🟡
How to create tabs (TabBar)

Build a tab bar with per-tab content and react to tab changes.

How-to🟢
How to create a clickable card

Build a Component with a rounded background, laid-out content and touch response.

How-to🟢
How to show a spinner and a progress bar (Progress)

Use Progress in its three modes — spinning icon, determinate bar and indeterminate.

How-to🟢
How to show a Hint (toast)

Show ephemeral, non-modal feedback that appears and disappears on its own.

How-to🟢
How to ask for confirmation with Alert

Open a modal confirmation dialog with Cancel/OK buttons and react to the choice.

How-to🟢
How to use checkbox and radio (Option and Group)

A lone Option becomes a checkbox; several in a Group become a radio (exclusive selection).

How-to🟢
How to use a selection Dropdown

Open a drop-down list, react to the choice, and get the selected item.

Currency masks, field validation, password fields and responsive forms across the four platforms.

How-to🟢
How to open a numeric keyboard

Choose between the native numeric keyboard, the built-in Keypad, or the calculator.

How-to🟡
How to apply a CPF, ZIP code, or date mask

Automatically format CPF, ZIP codes, and dates with a mask and read back the clean digits.

How-to🟡
How to create a date or time field with a picker

A field that opens the DatePicker or TimePicker when tapped and formats by the locale.

How-to🟡
How to create a currency field

A field with automatic monetary formatting, decimal places, and reading of the numeric value.

How-to🟢
How to create a password field with show/hide

A masked password field with a visibility toggle button.

How-to🟡
How to build a responsive label:field form

Align labels and fields in proportional columns with GridLayout.

How-to🟡
How to validate a text field

Restrict characters, limit length, and read the clean value before submitting.

Long lists without stutter: pagination, load-more on demand and control over scrolling and overscroll.

How-to🟢
How to show a modal selection popup

Open a list as a centered modal window with custom rows via ItemFactory.

How-to🔴
How to display a virtual list with thousands of items

Render huge lists with VirtualListView + DataAdapter recycling views (RecyclerView style).

How-to🟢
How to make a simple selectable list

Display a list of texts and capture the selection with ListView (SINGLE or MULTIPLE).

How-to🟡
How to implement load-more (infinite scroll)

Automatically append more items when the user reaches near the end of the virtual list.

How-to🔴
How to paginate server data in a virtual list

Load pages on demand with PagedDataAdapter (LRU cache) over VirtualListView.

How-to🟡
How to make a Component scrollable and adjust the overscroll

Enable scrolling on any Component with setScrollable and configure the elastic edge effect.

Camera, GPS, biometrics, Bluetooth, vibration and clipboard — the device hardware from the same Java code.

How-to🟡
How to authenticate with biometrics (fingerprint / Face ID)

Check availability and authenticate the user with fingerprint, Face ID, or Windows Hello.

How-to🔴
How to let the user pick a location on the map

Open a map with a draggable pin and GPS for the user to confirm a coordinate (LatLon) via LocationPicker.

How-to🔴
How to scan and connect to a Bluetooth device (BLE)

Discover Bluetooth devices, connect, and read/receive notifications from GATT characteristics.

How-to🟡
How to record a video with audio and a time limit

Record video (with or without audio), set quality and duration limit, and get the MP4 path.

How-to🟡
How to read a QR Code or barcode

Scan a QR/barcode with the camera using BarcodePicker, or decode an Image with CameraBarcode.

How-to🟡
How to get the GPS position (latitude/longitude)

Read the device GPS coordinates with Location + retrieveGPSData(), or track continuously with GPSThread.

How-to🟡
How to take a photo and get the file path

Capture a photo with the device camera and receive the path of the saved JPEG.

How-to🟡
How to use Text-to-Speech (TTS) and Speech-to-Text (STT)

Speak a text aloud and transcribe the user's speech into text, with locale/speed configuration.

How-to🟢
How to vibrate, emit a beep and use the clipboard

Quick device feedback — vibration, beep sound and copy/paste from the clipboard.

SQLite in practice: opening the database, CRUD with parameters, transactions and heavy work off the paint thread.