screens.guide
Measured screen sizes, safe areas, corner radii and system bars of iOS and Android devices.
使うべきか
品質と安全性
ツール定義とプロトコルへの準拠に関する自動分析に基づいています。
コンテキストコスト
これは、サーバーのツールがモデルのコンテキストに読み込まれるたびに消費されるおおよそのトークン数です。数が多いほど、ほかのタスクに使える注意が減ります。
インストール
ワンクリックインストール
これを `claude_desktop_config.json` ファイルに追加してください:
{
"mcpServers": {
"screens-guide": {
"url": "https://screens.guide/mcp"
}
}
}リモートエンドポイント
https://screens.guide/mcpstreamable-httpできること
ツール一覧
ツール(5)
🟢list_devices(platform, kind)
Lists every device screens.guide measured: iPhones, iPads and Android phones, tablets and foldables. Each row gives the id the other tools take, the unit (pt or dp), each screen with its portrait window size, the runtime builds read, and the current one. Filter by platform or kind.
入力スキーマ
{
"type": "object",
"properties": {
"platform": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"kind": {
"type": "string",
"enum": [
"phone",
"tablet",
"foldable"
]
}
},
"additionalProperties": false
}出力スキーマ
{
"type": "object",
"properties": {
"dataset": {
"type": "object",
"required": [
"version",
"updated"
],
"properties": {
"version": {
"type": "string"
},
"updated": {
"type": "string"
}
}
},
"devices": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"platform",
"kind",
"unit",
"screens",
"runtimes",
"current"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"platform": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"kind": {
"type": "string",
"enum": [
"phone",
"tablet",
"foldable"
]
},
"unit": {
"type": "string",
"enum": [
"pt",
"dp"
]
},
"screens": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"window"
],
"properties": {
"id": {
"type": "string",
"enum": [
"main",
"closed",
"open",
"half-open",
"tent"
],
"description": "A foldable's pose: closed, open, half-open or tent; every other device has main only."
},
"window": {
"$ref": "#/$defs/size"
}
}
}
},
"runtimes": {
"type": "array",
"items": {
"$ref": "#/$defs/runtime"
}
},
"current": {
"type": "object",
"required": [
"version",
"build"
],
"properties": {
"version": {
"type": "string"
},
"build": {
"type": "string"
}
}
}
}
}
}
},
"required": [
"dataset",
"devices"
],
"$defs": {
"runtime": {
"type": "object",
"required": [
"os",
"version",
"build",
"prerelease"
],
"additionalProperties": false,
"properties": {
"os": {
"enum": [
"iOS",
"Android"
]
},
"version": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
"api": {
"description": "Android's API level.",
"type": "integer"
},
"build": {
"type": "string",
"minLength": 1
},
"prerelease": {
"description": "A pre-release build; never a device's `current`.",
"type": "boolean"
}
}
},
"size": {
"type": "object",
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"type": "number",
"exclusiveMinimum": 0
},
"height": {
"type": "number",
"exclusiveMinimum": 0
}
}
}
}
}🟢get_device(device, screen, orientation, rotation, runtime)
Returns a device's measured readings: window, pixels, safe-area insets, corner radii, size classes, the status bar, the app's top bar (navigationBar: UINavigationBar, or Material 3's TopAppBar), the bottom tab bar (tabBar: UITabBar, or Material 3's NavigationBar), content margin, reserved regions and fold, one reading per screen and rotation. Gives the current runtime's readings unless a runtime is named; narrow them by screen, orientation or rotation, which must agree when both are given (rotation 90 on a phone is landscape). A null value has its reason in the reading's `missing`, keyed by the field's dotted path, such as cornerRadii.measured.
入力スキーマ
{
"type": "object",
"properties": {
"device": {
"type": "string",
"minLength": 1,
"description": "A device id from list_devices, such as iphone-17 or pixel-8."
},
"screen": {
"type": "string",
"enum": [
"main",
"closed",
"open",
"half-open",
"tent"
],
"description": "A foldable's pose: closed, open, half-open or tent; every other device has main only."
},
"orientation": {
"type": "string",
"enum": [
"portrait",
"landscape"
]
},
"rotation": {
"type": "integer",
"enum": [
0,
90,
180,
270
],
"description": "The device's rotation; 90 puts its top edge on the window's left."
},
"runtime": {
"type": "string",
"minLength": 1,
"description": "A runtime build such as 24A434, or a version such as 27.2 or 16, written exactly as list_devices gives it (27.0, not 27). A version names the device's current build when it is the current version, else that version's newest release build. The device's current build when omitted."
}
},
"required": [
"device"
],
"additionalProperties": false
}出力スキーマ
{
"type": "object",
"properties": {
"dataset": {
"type": "object",
"required": [
"version",
"updated"
],
"properties": {
"version": {
"type": "string"
},
"updated": {
"type": "string"
}
}
},
"device": {
"type": "object",
"required": [
"id",
"name",
"platform",
"kind",
"unit",
"displays",
"current"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"platform": {
"type": "string",
"enum": [
"ios",
"android"
]
},
"kind": {
"type": "string",
"enum": [
"phone",
"tablet",
"foldable"
]
},
"unit": {
"type": "string"
},
"displays": {
"type": "object",
"additionalProperties": {
"$ref": "#/$defs/display"
}
},
"screens": {
"type": "array"
},
"current": {
"type": "object"
}
}
},
"runtime": {
"$ref": "#/$defs/runtime"
},
"readings": {
"type": "array",
"items": {
"$ref": "#/$defs/reading"
}
}
},
"required": [
"dataset",
"device",
"runtime",
"readings"
],
"$defs": {
"bar": {
"description": "A bar's top edge and height in window coordinates.",
"type": [
"object",
"null"
],
"required": [
"top",
"height"
],
"additionalProperties": false,
"properties": {
"top": {
"type": "number"
},
"height": {
"$ref": "#/$defs/length"
}
}
},
"corners": {
"description": "Corner radii for the reading's orientation, with where they come from.",
"type": "object",
"required": [
"topLeft",
"topRight",
"bottomRight",
"bottomLeft",
"source"
],
"additionalProperties": false,
"properties": {
"topLeft": {
"$ref": "#/$defs/length"
},
"topRight": {
"$ref": "#/$defs/length"
},
"bottomRight": {
"$ref": "#/$defs/length"
},
"bottomLeft": {
"$ref": "#/$defs/length"
},
"source": {
"type": "string",
"minLength": 1
}
}
},
"date": {
"type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}$"
},
"display": {
"type": "object",
"required": [
"width",
"height",
"pixels",
"cutout"
],
"additionalProperties": false,
"properties": {
"width": {
"description": "In the device's unit, in the display's natural orientation.",
"type": "number",
"exclusiveMinimum": 0
},
"height": {
"type": "number",
"exclusiveMinimum": 0
},
"pixels": {
"$ref": "#/$defs/pixels"
},
"scale": {
"description": "iOS: pixels per point.",
"type": "number",
"exclusiveMinimum": 0
},
"density": {
"description": "Android: dots per inch; dp = px × 160 ÷ density.",
"type": "integer",
"minimum": 1
},
"cutout": {
"description": "The cutout's kind, where a run recorded it: none, notch, island (Dynamic Island), strip (the iPhone Duo's camera strip), hole (a hole punch).",
"enum": [
"none",
"notch",
"island",
"strip",
"hole",
null
]
}
}
},
"insets": {
"type": "object",
"required": [
"top",
"bottom",
"left",
"right"
],
"additionalProperties": false,
"properties": {
"top": {
"$ref": "#/$defs/length"
},
"bottom": {
"$ref": "#/$defs/length"
},
"left": {
"$ref": "#/$defs/length"
},
"right": {
"$ref": "#/$defs/length"
}
}
},
"length": {
"type": "number",
"minimum": 0
},
"pixels": {
"type": "object",
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"type": "integer",
"minimum": 1
},
"height": {
"type": "integer",
"minimum": 1
}
}
},
"reading": {
"type": "object",
"required": [
"runtime",
"measured",
"screen",
"orientation",
"rotation",
"window",
"pixels",
"safeAreaInsets",
"cornerRadii",
"sizeClass",
"statusBar",
"navigationBar",
"tabBar",
"contentMargin",
"regions",
"fold",
"missing"
],
"additionalProperties": false,
"properties": {
"runtime": {
"$ref": "#/$defs/runtime"
},
"measured": {
"type": "object",
"required": [
"on",
"date",
"runs"
],
"additionalProperties": false,
"properties": {
"on": {
"enum": [
"simulator",
"emulator"
]
},
"date": {
"description": "The newest date of the runs the reading's values come from.",
"$ref": "#/$defs/date"
},
"runs": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string"
}
}
}
},
"screen": {
"description": "`main`, or a foldable's pose: closed, open, half-open, tent.",
"enum": [
"main",
"closed",
"open",
"half-open",
"tent"
]
},
"orientation": {
"description": "The window's shape.",
"enum": [
"portrait",
"landscape"
]
},
"rotation": {
"description": "Degrees from the display's natural orientation (iOS: UIKit's portrait). At 90 the device's top edge is on the window's left: UIKit's landscapeRight, Android's ROTATION_90.",
"enum": [
0,
90,
180,
270
]
},
"window": {
"$ref": "#/$defs/size"
},
"pixels": {
"$ref": "#/$defs/pixels"
},
"safeAreaInsets": {
"description": "iOS: the window's safeAreaInsets. Android: WindowInsets.safeDrawing, the larger of the system bars and the display cutout per side.",
"oneOf": [
{
"$ref": "#/$defs/insets"
},
{
"type": "null"
}
]
},
"systemBarInsets": {
"description": "Android: WindowInsets.systemBars.",
"oneOf": [
{
"$ref": "#/$defs/insets"
},
{
"type": "null"
}
]
},
"cutoutInsets": {
"description": "Android: WindowInsets.displayCutout.",
"oneOf": [
{
"$ref": "#/$defs/insets"
},
{
"type": "null"
}
]
},
"cornerRadii": {
"type": "object",
"required": [
"profile",
"measured"
],
"additionalProperties": false,
"properties": {
"profile": {
"description": "The display's corners from the simulator's device profile (iOS) or the emulator's display configuration (Android).",
"oneOf": [
{
"$ref": "#/$defs/corners"
},
{
"type": "null"
}
]
},
"measured": {
"description": "SwiftUI's concentricCornerRadii for a view that fills the window; on iOS 18.6, the corners of the view behind a full-screen sheet.",
"oneOf": [
{
"$ref": "#/$defs/corners"
},
{
"type": "null"
}
]
}
}
},
"sizeClass": {
"$ref": "#/$defs/sizeClass"
},
"sizeClassV2": {
"$ref": "#/$defs/sizeClass"
},
"statusBar": {
"type": [
"object",
"null"
],
"required": [
"placement",
"frame"
],
"additionalProperties": false,
"properties": {
"placement": {
"description": "top; hidden; left or right (a column in a side inset); navigation-bar (the time in the navigation bar's row).",
"enum": [
"top",
"hidden",
"left",
"right",
"navigation-bar"
]
},
"frame": {
"oneOf": [
{
"$ref": "#/$defs/rect"
},
{
"type": "null"
}
]
}
}
},
"navigationBar": {
"description": "iOS: UINavigationBar with an inline title and with a large title. Android: Material 3's TopAppBar inside the safe area as `inline`.",
"type": "object",
"required": [
"inline",
"large"
],
"additionalProperties": false,
"properties": {
"inline": {
"$ref": "#/$defs/bar"
},
"large": {
"$ref": "#/$defs/bar"
}
}
},
"tabBar": {
"type": [
"object",
"null"
],
"required": [
"style",
"frame",
"bottom",
"height",
"sideGap"
],
"additionalProperties": false,
"properties": {
"style": {
"description": "capsule (iOS 26 and later), bar (iOS 18, Android's NavigationBar), column (the iPhone Duo, in a side inset).",
"enum": [
"capsule",
"bar",
"column"
]
},
"frame": {
"description": "With three tabs.",
"$ref": "#/$defs/rect"
},
"bottom": {
"description": "The gap from the frame's bottom to the window's bottom edge.",
"type": "number"
},
"height": {
"$ref": "#/$defs/length"
},
"sideGap": {
"description": "The smallest gap to a side edge with five tabs with long titles (iOS); the frame's gap on Android.",
"type": [
"number",
"null"
]
}
}
},
"contentMargin": {
"description": "SwiftUI's contentMargins(for: .container) on the sides of a view that spans the window.",
"type": [
"number",
"null"
],
"minimum": 0
},
"regions": {
"description": "Occlusion regions UIKit reports, and Android's display cutout.",
"type": [
"array",
"null"
],
"items": {
"type": "object",
"required": [
"kind",
"frame",
"active"
],
"additionalProperties": false,
"properties": {
"kind": {
"enum": [
"occlusion",
"cutout"
]
},
"frame": {
"$ref": "#/$defs/rect"
},
"active": {
"type": "boolean"
}
}
}
},
"fold": {
"description": "The hinge across the screen: its axis, its frame (a band on iOS, a line on Android), the margins either side (iOS) and whether it separates the window.",
"type": [
"object",
"null"
],
"required": [
"axis",
"frame",
"margin",
"separates"
],
"additionalProperties": false,
"properties": {
"axis": {
"enum": [
"vertical",
"horizontal"
]
},
"frame": {
"$ref": "#/$defs/rect"
},
"margin": {
"type": [
"number",
"null"
],
"minimum": 0
},
"separates": {
"type": "boolean"
}
}
},
"missing": {
"description": "The reason per field path that is null: not read on this device, runtime, pose or orientation, or why the platform has no such value.",
"type": "object",
"propertyNames": {
"pattern": "^[a-zA-Z][a-zA-Z0-9]*(\\.[a-zA-Z][a-zA-Z0-9]*)?$"
},
"additionalProperties": {
"type": "string",
"minLength": 1
}
}
}
},
"rect": {
"description": "A frame in the reading's window coordinates: origin at the window's top left, in the device's unit.",
"type": "object",
"required": [
"x",
"y",
"width",
"height"
],
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"width": {
"$ref": "#/$defs/length"
},
"height": {
"$ref": "#/$defs/length"
}
}
},
"runtime": {
"type": "object",
"required": [
"os",
"version",
"build",
"prerelease"
],
"additionalProperties": false,
"properties": {
"os": {
"enum": [
"iOS",
"Android"
]
},
"version": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
"api": {
"description": "Android's API level.",
"type": "integer"
},
"build": {
"type": "string",
"minLength": 1
},
"prerelease": {
"description": "A pre-release build; never a device's `current`.",
"type": "boolean"
}
}
},
"size": {
"type": "object",
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"type": "number",
"exclusiveMinimum": 0
},
"height": {
"type": "number",
"exclusiveMinimum": 0
}
}
},
"sizeClass": {
"description": "UIKit's size classes on iOS; on Android the window size classes, V1 in `sizeClass` and V2 in `sizeClassV2`.",
"type": [
"object",
"null"
],
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"enum": [
"compact",
"regular",
"medium",
"expanded",
"large",
"extra-large"
]
},
"height": {
"enum": [
"compact",
"regular",
"medium",
"expanded"
]
}
}
}
}
}🟢compare_devices(devices, orientation, runtime)
Compares 2 to 8 different devices side by side, one row per device and screen: window size, pixels, pixels per unit, safe-area insets, the safe area's rectangle and corner radii. Uses each device's current runtime and its reading at rotation 0 unless an orientation or runtime is named. At rotation 0 a foldable's open screen can be landscape, as the Pixel Fold's open and half-open screens are; name an orientation to compare like with like.
入力スキーマ
{
"type": "object",
"properties": {
"devices": {
"type": "array",
"minItems": 2,
"maxItems": 8,
"uniqueItems": true,
"items": {
"type": "string",
"minLength": 1,
"description": "A device id from list_devices, such as iphone-17 or pixel-8."
}
},
"orientation": {
"type": "string",
"enum": [
"portrait",
"landscape"
]
},
"runtime": {
"type": "string",
"minLength": 1,
"description": "A runtime build such as 24A434, or a version such as 27.2 or 16, written exactly as list_devices gives it (27.0, not 27). A version names the device's current build when it is the current version, else that version's newest release build. The device's current build when omitted."
}
},
"required": [
"devices"
],
"additionalProperties": false
}出力スキーマ
{
"type": "object",
"properties": {
"dataset": {
"type": "object",
"required": [
"version",
"updated"
],
"properties": {
"version": {
"type": "string"
},
"updated": {
"type": "string"
}
}
},
"rows": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"unit",
"screen",
"orientation",
"rotation",
"runtime",
"window",
"pixels",
"pixelsPerUnit",
"safeAreaInsets",
"safeArea",
"cornerRadii"
],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"unit": {
"type": "string"
},
"screen": {
"type": "string",
"enum": [
"main",
"closed",
"open",
"half-open",
"tent"
],
"description": "A foldable's pose: closed, open, half-open or tent; every other device has main only."
},
"orientation": {
"type": "string",
"enum": [
"portrait",
"landscape"
]
},
"rotation": {
"type": "integer"
},
"runtime": {
"$ref": "#/$defs/runtime"
},
"window": {
"$ref": "#/$defs/size"
},
"pixels": {
"$ref": "#/$defs/pixels"
},
"pixelsPerUnit": {
"type": "number",
"description": "Physical pixels per pt or dp: the scale on iOS, the density divided by 160 on Android, unrounded."
},
"safeAreaInsets": {
"anyOf": [
{
"$ref": "#/$defs/insets"
},
{
"type": "null"
}
]
},
"safeArea": {
"anyOf": [
{
"$ref": "#/$defs/rect"
},
{
"type": "null"
}
]
},
"cornerRadii": {
"type": "object",
"properties": {
"profile": {
"anyOf": [
{
"$ref": "#/$defs/corners"
},
{
"type": "null"
}
]
},
"measured": {
"anyOf": [
{
"$ref": "#/$defs/corners"
},
{
"type": "null"
}
]
}
}
}
}
}
},
"missing": {
"type": "array",
"description": "Devices or screens with no reading for the runtime or orientation asked, and why.",
"items": {
"type": "object",
"required": [
"id",
"reason"
],
"properties": {
"id": {
"type": "string"
},
"reason": {
"type": "string"
}
}
}
}
},
"required": [
"dataset",
"rows",
"missing"
],
"$defs": {
"corners": {
"description": "Corner radii for the reading's orientation, with where they come from.",
"type": "object",
"required": [
"topLeft",
"topRight",
"bottomRight",
"bottomLeft",
"source"
],
"additionalProperties": false,
"properties": {
"topLeft": {
"$ref": "#/$defs/length"
},
"topRight": {
"$ref": "#/$defs/length"
},
"bottomRight": {
"$ref": "#/$defs/length"
},
"bottomLeft": {
"$ref": "#/$defs/length"
},
"source": {
"type": "string",
"minLength": 1
}
}
},
"insets": {
"type": "object",
"required": [
"top",
"bottom",
"left",
"right"
],
"additionalProperties": false,
"properties": {
"top": {
"$ref": "#/$defs/length"
},
"bottom": {
"$ref": "#/$defs/length"
},
"left": {
"$ref": "#/$defs/length"
},
"right": {
"$ref": "#/$defs/length"
}
}
},
"length": {
"type": "number",
"minimum": 0
},
"pixels": {
"type": "object",
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"type": "integer",
"minimum": 1
},
"height": {
"type": "integer",
"minimum": 1
}
}
},
"rect": {
"description": "A frame in the reading's window coordinates: origin at the window's top left, in the device's unit.",
"type": "object",
"required": [
"x",
"y",
"width",
"height"
],
"additionalProperties": false,
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"width": {
"$ref": "#/$defs/length"
},
"height": {
"$ref": "#/$defs/length"
}
}
},
"runtime": {
"type": "object",
"required": [
"os",
"version",
"build",
"prerelease"
],
"additionalProperties": false,
"properties": {
"os": {
"enum": [
"iOS",
"Android"
]
},
"version": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
"api": {
"description": "Android's API level.",
"type": "integer"
},
"build": {
"type": "string",
"minLength": 1
},
"prerelease": {
"description": "A pre-release build; never a device's `current`.",
"type": "boolean"
}
}
},
"size": {
"type": "object",
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"type": "number",
"exclusiveMinimum": 0
},
"height": {
"type": "number",
"exclusiveMinimum": 0
}
}
}
}
}🟢check_layout(device, screen, runtime, orientation, rotation, ...)
Checks up to 200 frames of a screen's layout against a device's measured window: whether each frame reaches outside the window, into a safe-area inset, past the display's rounded corner, under the status bar or the app's top or bottom bar, across a foldable's fold, or into a reserved region such as a camera. Each finding gives its numbers; a frame near a rounded corner gets the concentric radius. Frames are in the device's unit, in window coordinates from the top left. Without screen, a foldable is checked on its first screen, closed (the cover display). Orientation and rotation must agree when both are given. The request body is at most 64 KiB, so keep frame names short.
入力スキーマ
{
"type": "object",
"properties": {
"device": {
"type": "string",
"minLength": 1,
"description": "A device id from list_devices, such as iphone-17 or pixel-8."
},
"screen": {
"type": "string",
"enum": [
"main",
"closed",
"open",
"half-open",
"tent"
],
"description": "A foldable's pose: closed, open, half-open or tent; every other device has main only. A foldable's first screen, closed, when omitted."
},
"runtime": {
"type": "string",
"minLength": 1,
"description": "A runtime build such as 24A434, or a version such as 27.2 or 16, written exactly as list_devices gives it (27.0, not 27). A version names the device's current build when it is the current version, else that version's newest release build. The device's current build when omitted."
},
"orientation": {
"type": "string",
"enum": [
"portrait",
"landscape"
],
"description": "The window shape; the reading at rotation 0 when neither this nor rotation is given."
},
"rotation": {
"type": "integer",
"enum": [
0,
90,
180,
270
],
"description": "The device's rotation; 90 puts its top edge on the window's left."
},
"frames": {
"type": "array",
"minItems": 1,
"maxItems": 200,
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"x",
"y",
"width",
"height"
],
"properties": {
"name": {
"type": "string",
"maxLength": 200
},
"x": {
"type": "number",
"minimum": -1000000,
"maximum": 1000000
},
"y": {
"type": "number",
"minimum": -1000000,
"maximum": 1000000
},
"width": {
"type": "number",
"minimum": 0,
"maximum": 1000000
},
"height": {
"type": "number",
"minimum": 0,
"maximum": 1000000
},
"cornerRadius": {
"type": "number",
"minimum": 0,
"maximum": 1000000
}
}
}
}
},
"required": [
"device",
"frames"
],
"additionalProperties": false
}出力スキーマ
{
"type": "object",
"properties": {
"dataset": {
"type": "object",
"required": [
"version",
"updated"
],
"properties": {
"version": {
"type": "string"
},
"updated": {
"type": "string"
}
}
},
"device": {
"type": "string"
},
"screen": {
"type": "string",
"enum": [
"main",
"closed",
"open",
"half-open",
"tent"
],
"description": "A foldable's pose: closed, open, half-open or tent; every other device has main only."
},
"orientation": {
"type": "string",
"enum": [
"portrait",
"landscape"
]
},
"rotation": {
"type": "integer"
},
"runtime": {
"$ref": "#/$defs/runtime"
},
"window": {
"$ref": "#/$defs/size"
},
"safeAreaInsets": {
"anyOf": [
{
"$ref": "#/$defs/insets"
},
{
"type": "null"
}
]
},
"cornerRadii": {
"anyOf": [
{
"$ref": "#/$defs/corners"
},
{
"type": "null"
}
]
},
"frames": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"findings"
],
"properties": {
"name": {
"type": "string"
},
"findings": {
"type": "array",
"items": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"outside-window",
"in-inset",
"cut-by-corner",
"near-corner",
"under-bar",
"crosses-fold",
"in-occlusion-region"
]
},
"overhang": {
"type": "object",
"properties": {
"top": {
"type": "number"
},
"bottom": {
"type": "number"
},
"left": {
"type": "number"
},
"right": {
"type": "number"
}
}
},
"edge": {
"type": "string",
"enum": [
"top",
"bottom",
"left",
"right"
]
},
"corner": {
"type": "string",
"enum": [
"topLeft",
"topRight",
"bottomRight",
"bottomLeft"
]
},
"depth": {
"type": "number",
"description": "How far the frame reaches into the inset, past the curve, or under the bar."
},
"gap": {
"type": "number",
"description": "The frame corner's distance inside the display's curve."
},
"concentricRadius": {
"type": "number",
"description": "The corner radius that keeps an even gap to the display's corner: its radius minus the frame's larger distance from the two edges, at most half the frame's shorter side."
},
"bar": {
"type": "string",
"enum": [
"status",
"top",
"bottom"
],
"description": "status: the system status bar. top: the app's top bar, UINavigationBar with an inline title or Material 3's TopAppBar, get_device's navigationBar. bottom: the app's bottom bar, UITabBar or Material 3's NavigationBar, get_device's tabBar."
},
"axis": {
"type": "string",
"enum": [
"vertical",
"horizontal"
]
},
"separates": {
"type": "boolean"
},
"kind": {
"type": "string"
},
"active": {
"type": "boolean"
},
"overlap": {
"type": "object",
"properties": {
"width": {
"type": "number"
},
"height": {
"type": "number"
}
}
}
}
}
}
}
}
}
},
"required": [
"dataset",
"device",
"screen",
"orientation",
"rotation",
"runtime",
"window",
"safeAreaInsets",
"frames"
],
"$defs": {
"corners": {
"description": "Corner radii for the reading's orientation, with where they come from.",
"type": "object",
"required": [
"topLeft",
"topRight",
"bottomRight",
"bottomLeft",
"source"
],
"additionalProperties": false,
"properties": {
"topLeft": {
"$ref": "#/$defs/length"
},
"topRight": {
"$ref": "#/$defs/length"
},
"bottomRight": {
"$ref": "#/$defs/length"
},
"bottomLeft": {
"$ref": "#/$defs/length"
},
"source": {
"type": "string",
"minLength": 1
}
}
},
"insets": {
"type": "object",
"required": [
"top",
"bottom",
"left",
"right"
],
"additionalProperties": false,
"properties": {
"top": {
"$ref": "#/$defs/length"
},
"bottom": {
"$ref": "#/$defs/length"
},
"left": {
"$ref": "#/$defs/length"
},
"right": {
"$ref": "#/$defs/length"
}
}
},
"length": {
"type": "number",
"minimum": 0
},
"runtime": {
"type": "object",
"required": [
"os",
"version",
"build",
"prerelease"
],
"additionalProperties": false,
"properties": {
"os": {
"enum": [
"iOS",
"Android"
]
},
"version": {
"type": "string",
"pattern": "^\\d+(\\.\\d+)*$"
},
"api": {
"description": "Android's API level.",
"type": "integer"
},
"build": {
"type": "string",
"minLength": 1
},
"prerelease": {
"description": "A pre-release build; never a device's `current`.",
"type": "boolean"
}
}
},
"size": {
"type": "object",
"required": [
"width",
"height"
],
"additionalProperties": false,
"properties": {
"width": {
"type": "number",
"exclusiveMinimum": 0
},
"height": {
"type": "number",
"exclusiveMinimum": 0
}
}
}
}
}🟢convert_units(device, values, from, to)
Converts lengths on one device between its layout unit (pt on iOS, dp on Android) and physical pixels (px), at the device's measured scale or density. For dp to px on Android it also gives the whole pixel Compose's Dp.roundToPx() returns. Each value is between -1,000,000 and 1,000,000.
入力スキーマ
{
"type": "object",
"properties": {
"device": {
"type": "string",
"minLength": 1,
"description": "A device id from list_devices, such as iphone-17 or pixel-8."
},
"values": {
"type": "array",
"minItems": 1,
"maxItems": 1000,
"items": {
"type": "number",
"minimum": -1000000,
"maximum": 1000000
}
},
"from": {
"type": "string",
"enum": [
"pt",
"dp",
"px"
]
},
"to": {
"type": "string",
"enum": [
"pt",
"dp",
"px"
]
}
},
"required": [
"device",
"values",
"from",
"to"
],
"additionalProperties": false
}出力スキーマ
{
"type": "object",
"properties": {
"dataset": {
"type": "object",
"required": [
"version",
"updated"
],
"properties": {
"version": {
"type": "string"
},
"updated": {
"type": "string"
}
}
},
"device": {
"type": "string"
},
"unit": {
"type": "string"
},
"pixelsPerUnit": {
"type": "number",
"description": "Physical pixels per pt or dp: the scale on iOS, the density divided by 160 on Android, unrounded."
},
"values": {
"type": "array",
"items": {
"type": "object",
"required": [
"value",
"result"
],
"properties": {
"value": {
"type": "number"
},
"result": {
"type": "number"
},
"roundToPx": {
"type": "integer"
}
}
}
}
},
"required": [
"dataset",
"device",
"unit",
"pixelsPerUnit",
"values"
]
}コミュニティ
エビデンス