Index of every page on this site: llms.txt
All skills
android avatar

/display-glasses-with-jetpack-compose-glimmer

@7f7b217
by androidandroid/skills11k stars
703
Run it yourself

Provides guidelines for developing projected Android XR apps for display glasses using the Jetpack Compose Glimmer UI toolkit. Covers Glimmer design principles, workflows, and interaction models for the glasses form factor. Use this skill to build an Android XR Augmented Experience app with Jetpack Compose Glimmer. Don't use for audio-only AI glasses without a display, non-glasses Android XR headsets (spatial panels or 3D volumes with Jetpack Compose for XR), or phone and tablet Material 3 UIs.

Use this Skill: https://skilld.dev/gh/android/skills/display-glasses-with-jetpack-compose-glimmer

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesbutton-samples-source.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

When creating a Glimmer Button component, refer to the following implementation samples in ButtonSamples.kt:

/*
 * Copyright 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package androidx.xr.glimmer.samples

import androidx.annotation.Sampled
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.xr.glimmer.Button
import androidx.xr.glimmer.ButtonDefaults
import androidx.xr.glimmer.ButtonSize
import androidx.xr.glimmer.GlimmerTheme
import androidx.xr.glimmer.Icon
import androidx.xr.glimmer.Text
import androidx.xr.glimmer.list.GlimmerLazyColumn

@Composable
fun ButtonSampleUsage() {
    GlimmerLazyColumn(
        horizontalAlignment = Alignment.CenterHorizontally,
        modifier = Modifier.fillMaxSize().wrapContentSize(Alignment.Center),
    ) {
        item { ButtonSample() }
        item { ButtonWithLeadingIconSample() }
        item { ButtonWithTrailingIconSample() }
        item { ButtonWithLeadingAndTrailingIconSample() }
        item { LargeButtonSample() }
        item { LargeButtonWithLeadingIconSample() }
        item { LargeButtonWithTrailingIconSample() }
        item { LargeButtonWithLeadingAndTrailingIconSample() }
        item { CustomFocusedColorButtonSample() }
    }
}

@Sampled
@Composable
fun ButtonSample() {
    Button(onClick = {}) { Text("Send") }
}

@Sampled
@Composable
fun ButtonWithLeadingIconSample() {
    Button(onClick = {}, leadingIcon = { Icon(FavoriteIcon, "Localized description") }) {
        Text("Send")
    }
}

@Composable
private fun ButtonWithTrailingIconSample() {
    Button(onClick = {}, trailingIcon = { Icon(FavoriteIcon, "Localized description") }) {
        Text("Send")
    }
}

@Composable
private fun ButtonWithLeadingAndTrailingIconSample() {
    Button(
        onClick = {},
        leadingIcon = { Icon(FavoriteIcon, "Localized description") },
        trailingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Send")
    }
}

@Sampled
@Composable
fun LargeButtonSample() {
    Button(onClick = {}, buttonSize = ButtonSize.Large) { Text("Send") }
}

@Composable
private fun LargeButtonWithLeadingIconSample() {
    Button(
        onClick = {},
        buttonSize = ButtonSize.Large,
        leadingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Send")
    }
}

@Composable
private fun LargeButtonWithTrailingIconSample() {
    Button(
        onClick = {},
        buttonSize = ButtonSize.Large,
        trailingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Send")
    }
}

@Composable
private fun LargeButtonWithLeadingAndTrailingIconSample() {
    Button(
        onClick = {},
        buttonSize = ButtonSize.Large,
        leadingIcon = { Icon(FavoriteIcon, "Localized description") },
        trailingIcon = { Icon(FavoriteIcon, "Localized description") },
    ) {
        Text("Send")
    }
}

@Sampled
@Composable
fun CustomFocusedColorButtonSample() {
    Button(
        onClick = {},
        focusedColor = ButtonDefaults.calculateFocusedColor(Color(0xFF34E0A1)),
    ) {
        Text("Button with custom colors")
    }
}

@Preview
@Composable
private fun ButtonPreview() {
    GlimmerTheme { ButtonSample() }
}

@Preview
@Composable
private fun ButtonWithLeadingIconPreview() {
    GlimmerTheme { ButtonWithLeadingIconSample() }
}

@Preview
@Composable
private fun ButtonWithTrailingIconPreview() {
    GlimmerTheme { ButtonWithTrailingIconSample() }
}

@Preview
@Composable
private fun ButtonWithLeadingAndTrailingIconPreview() {
    GlimmerTheme { ButtonWithLeadingAndTrailingIconSample() }
}

@Preview
@Composable
private fun LargeButtonPreview() {
    GlimmerTheme { LargeButtonSample() }
}

@Preview
@Composable
private fun LargeButtonWithLeadingIconPreview() {
    GlimmerTheme { LargeButtonWithLeadingIconSample() }
}

@Preview
@Composable
private fun LargeButtonWithTrailingIconPreview() {
    GlimmerTheme { LargeButtonWithTrailingIconSample() }
}

@Preview
@Composable
private fun LargeButtonWithLeadingAndTrailingIconPreview() {
    GlimmerTheme { LargeButtonWithLeadingAndTrailingIconSample() }
}

@Preview
@Composable
private fun CustomFocusedColorButtonPreview() {
    GlimmerTheme { CustomFocusedColorButtonSample() }
}
<br />

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts6d3 checks · Risk SAFE
  • Gen Agent Trust Hub7d

    The skill provides comprehensive guidelines and code samples for developing Android XR applications using the Jetpack Compose Glimmer UI toolkit. It follows standard Android development patterns and relies on official Android/XR libraries. No security risks were identified.

  • Socket6d

    No alerts

  • Snyk7d

    Risk: LOW · No issues

Signed by skilld at 7f7b217. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 31 minutes ago.

Activeupdated last week
Other metadata
metadata
{
  "author": "Google LLC",
  "last-updated": "2026-11-13",
  "keywords": [
    "Jetpack Compose Glimmer",
    "display glasses",
    "Projected Activity",
    "GlimmerTheme",
    "Additive Display",
    "Android XR - Augmented Experiences"
  ]
}

README badge

README badge for android/skills/display-glasses-with-jetpack-compose-glimmer