Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Android-Webp profile

Purpose

Профиль предназначен для импорта WEBP ресурсов в качестве android drawable ресурса. Поддерживаются различные density (ldpi, mdpi, hdpi, xhdpi, etc) и светлые/темные варианты (night)

The asset import process consists of the following stages:

  1. Fetch Figma remote: REST API reference
  2. Locate the node ID by the specified name
  3. Request PNG export from Figma using the node ID: REST API reference
    • Batch request PNG exports for all densities
    • Includes dark theme variants when configured (night)
  4. Download all PNG assets
  5. Convert to WEBP format (using libwebp)
  6. Organize outputs in standard Android resource structure:
    • drawable-{density}/
    • drawable-night-{density}

Complete Configuration in .figtree.toml

[profiles.android-webp]
# ID from the [remotes] section. 
# Uses the default remote if unspecified, but can reference any configured remote
remote = "some_remote_id"
# Export scale for the image from Figma (default: 1.0)
scale = 1.0
# Root Android resources directory
# (parent of drawable-* folders)
android_res_dir = "src/main/res"
# Output quality for WEBP conversion (0-100)
# Defaults to 100 (lossless) - recommended value
quality = 100
# Density configurations
scales = ["mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"]
# Dark theme configuration 
# Naming pattern for dark theme variants
# {base} is replaced with base asset name
# Leave unspecified to disable dark theme support
night = "{base} / Dark"
# If true, the legacy resource loading method will be used.
# The new approach downloads the SVG source and renders the raster image locally.
# In most cases, this significantly speeds up the import process.
# This may not suit all use cases, so the feature can be disabled.
legacy_loader = false