Skip to content

pantoken / platforms/android/src / toAndroid

Feidhm: toAndroid()

toAndroid(tokens, options): Promise<string[]>

Turgnamhach

Giniú XML acmhainní Android do token IR shonrach.

Paraiméadair

tokens

neamh-inathraitheach Token[]

options

GenerateAndroidOptions

Tuairisceáin

Promise<string[]>

Na cosáin chuig na comhaid colors.xml agus dimens.xml a scríobhadh.

Samplaí

Giniú IR téama sonrach

ts
import { toAndroid } from "@pantoken/android";
import { byTheme } from "@pantoken/tokens";

const [colors, dimens] = await toAndroid(byTheme("canvas"), { outDir: "./app/src/main" });
// writes ./app/src/main/res/values/colors.xml and dimens.xml

Mód dorcha le siombailí VectorDrawables

ts
import { toAndroid } from "@pantoken/android";
import { byTheme } from "@pantoken/tokens";

await toAndroid(byTheme("rebrand"), {
  outDir: "./app/src/main",
  mode: "dark",
  icons: ["add", "check"], // also emits res/drawable/ic_add.xml, ic_check.xml
});