Agent skill

Navigation Event

by rosuH in rosuH/EasyWatermark

Intercept back gestures and run Predictive Back animations using the NavigationEvent (androidx.navigationevent) library in Compose Android.

MITAuto-check passedMobile

Install Navigation Event

skills CLI
$ npx skills add rosuH/EasyWatermark --skill navigation-event -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rosuH/EasyWatermark navigation-event --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rosuH/EasyWatermark.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/navigation-event .claude/skills/navigation-event && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
navigation-event
GitHub stars
1.9k
Used in
1 other repo
Token cost
~3.3k tokens
SKILL.md length
1,033 words
Files
5 (incl. references)
Skills in repo
28
Repo updated
First seen
Licence
MIT

At a glance

Intercept back gestures and run Predictive Back animations using the NavigationEvent (androidx.navigationevent) library in Compose Android.

  • Works in 5 steps: Plan → Set up dependencies → Configure dispatcher and inputs → …
  • Mobile work in your project
  • SKILL.md covers Common guidelines, Step 1: Plan, Step 2: Set up dependencies and Step 3: Configure dispatcher…, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Navigation Event is an agent skill from rosuH/EasyWatermark. Intercept back gestures and run Predictive Back animations using the NavigationEvent (androidx.navigationevent) library in Compose Android. Handles Activity setup, parent-child dispatcher scoping in ViewPagers or tabs, Compose NavigationBackHandler, and migration from legacy BackHandler on SDK 36+.

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/android/guide/navigation/navigation-event/dispatcher.md`, `references/android/guide/navigation/navigation-event/handle-back.md` and `references/android/guide/navigation/navigation-event/index.md`).

It sits in Mobile. It works with Android. The repository describes itself as: 🔒 🖼 Securely, easily add a watermark to your sensitive photos. 安全、简单地为你的敏感照片添加水印,防止被人泄露、利用. The licence is MIT.

When your agent uses it

  • Mobile work in your project

Example prompts

  • “/navigation-event”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Plan
  2. Set up dependencies
  3. Configure dispatcher and inputs
  4. Handle back navigation and UI transitions
  5. Clean up resources

What it can do on your machine

Read from SKILL.md and the folder at commit 61223db. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are kotlin).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Navigation Event loads about 3.3k tokens when it runs, and up to ~7.5k if it reads all its reference files. Until then it costs about 81 tokens; SKILL.md has 1,033 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~81
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rosuH/EasyWatermark at commit 61223db, republished under its MIT licence (© rosuH). 1,033 words, ~3,276 tokens.

Download SKILL.mdSave it as .claude/skills/navigation-event/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
navigation-event
description
Intercept back gestures and run Predictive Back animations using the NavigationEvent (androidx.navigationevent) library in Compose Android. Handles Activity setup, parent-child dispatcher scoping in `ViewPagers` or tabs, Compose `NavigationBackHandler`, and migration from legacy `BackHandler` on SDK 36+.
license
Complete terms in LICENSE.txt
metadata.author
Google LLC
metadata.last-updated
2026-09-01
metadata.keywords
Android, Navigation Event, Jetpack Compose, Back Navigation, Dispatcher, Guidelines, Troubleshooting, ComponentActivity, Dialog, ViewPager

Common guidelines

  • For architecture concepts : To understand the foundational architecture, continuous gesture event lifecycles, or class definitions of the Navigation Event library, read Navigation Event overview.
  • For Android target : If compile SDK is lower than 36, set it to 36 or higher in build.gradle.kts.
  • For Compose Android target: The project must use Jetpack Compose for Compose-specific APIs. This skill is scoped exclusively to Compose Android (Android Views and non-Compose implementations are excluded).
  • For activity dispatchers : ComponentActivity automatically implements NavigationEventDispatcherOwner out-of-the-box. You must use the built-in navigationEventDispatcher without creating anonymous delegate owners or overriding member properties.
  • For dialog scoping : Floating windows (Compose Dialog, ModalBottomSheet, ComponentDialog) automatically provide a NavigationEventDispatcherOwner. You don't need manual CompositionLocalProvider propagation for dialogs.
  • For parent-child dispatcher hierarchies : When scoping navigation handling to ViewPagers, tabbed interfaces, or nested navigation containers in Compose, use rememberNavigationEventDispatcherOwner() to create a child owner linked to the parent. Disabling the owner (enabled = false) automatically cascades to disable all child handlers.
  • For Compose handlers : A one-to-one relationship between NavigationEventState and handlers is strictly enforced. Never bind the same NavigationEventState to multiple active NavigationBackHandler instances (IllegalArgumentException).

Step 1: Plan

To complete this step, you MUST ensure the following:

  1. Identify the target platform : Verify the app is targeting Compose Android. If compileSdk is lower than 36, set it to 36 or higher in build.gradle.kts.
  2. Navigation check: Check if Navigation 3 is in use. If it is in use, use Navigation 3's built-in back navigation support rather than manually implementing low-level dispatchers from this skill.
  3. Hierarchy check : Identify host Activities, ViewPagers, tabbed interfaces, or nested navigation hosts that require back gesture interception or parent-child dispatcher linking.
  4. Migration check : Check if the project is migrating from back handling (OnBackPressedCallback, BackHandler, onBackPresser) to NavigationEvent and NavigationBackHandler.
  5. Input interception : Detect where the app is intercepting navigation events from gestures or hardware button presses requiring translation to NavigationEvent.

Step 2: Set up dependencies

To complete this step, you MUST ensure the following:

  • For setting up compile SDKs, declaring catalog versions, and adding dependencies, follow setup guide.

Step 3: Configure dispatcher and inputs

To complete this step, you MUST ensure the following:

  • To configure your dispatcher, leverage automatic ComponentActivity or ComponentDialog owner resolution.
  • Link parent-child dispatchers in Compose following dispatcher guide.

Step 4: Handle back navigation and UI transitions

To complete this step, you MUST ensure the following:

  • To create navigation event handlers, integrate back gesture interception in Compose, animate UI components during swipes, and migrate from legacy back handlers, follow handle back guide.

Step 5: Clean up resources

[!WARNING] Warning: Compose APIs perform teardown automatically. When using Compose APIs such as NavigationBackHandler and rememberNavigationEventDispatcherOwner(), handler removal and dispatcher disposal occur automatically when the composable leaves the composition.

You MUST perform explicit manual cleanup only when managing custom dispatchers or non-Compose handlers:

  • Call remove() on active handlers during teardown.
  • Call isEnabled = false to temporarily disable navigation subtrees.
  • Call dispose() on dispatcher instances when hosting components are destroyed. Disposing a parent dispatcher automatically cascades to all child dispatchers.

Core troubleshooting guidelines

1. Activity dispatcher setup (StackOverflowError recursion)

ComponentActivity implements NavigationEventDispatcherOwner automatically out-of-the-box. Don't override navigationEventDispatcher or wrap it in an anonymous delegate owner.

RIGHT

Why this is RIGHT : Compose apps use ComponentActivity as the host. LocalNavigationEventDispatcherOwner.current automatically resolves the Activity's built-in dispatcher.

kotlin
// RIGHT
class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            MyApplicationContent()
        }
    }
}
<br />
WRONG

Why this is WRONG : Implementing NavigationEventDispatcherOwner directly on MainActivity and overriding navigationEventDispatcher with a new instance shadows the library's extension property, causing a recursive infinite loop crash on launch (StackOverflowError). Creating redundant anonymous delegate owners (object : NavigationEventDispatcherOwner) is unnecessary.

kotlin
// WRONG
class MainActivity : ComponentActivity(), NavigationEventDispatcherOwner {
    override val navigationEventDispatcher = NavigationEventDispatcher() // Shadow loop crash
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            MyApplicationContent()
        }
    }
}
<br />
2. Floating window and dialog scoping (automatic ComponentDialog owner)

Floating windows (Compose Dialog, ModalBottomSheet, and any window backed by ComponentDialog) automatically provide a NavigationEventDispatcherOwner. Don't manually re-provide LocalNavigationEventDispatcherOwner using CompositionLocalProvider inside dialogs.

Show full SKILL.md (415 more words)Show less
RIGHT

Why this is RIGHT : ComponentDialog handles navigation dispatchers automatically. Compose Dialog components resolve their dispatcher owner out-of-the-box without manual propagation.

kotlin
// RIGHT
@Composable
fun MyDialog(onDismiss: () -> Unit) {
    Dialog(onDismissRequest = onDismiss) {
        val navigationState = rememberNavigationEventState(currentInfo = NavigationEventInfo.None)
        NavigationBackHandler(
            state = navigationState,
            onBackCompleted = onDismiss
        )
    }
}
<br />
WRONG

Why this is WRONG : Wrapping dialog content in a manual CompositionLocalProvider creates redundant boilerplate and obscures the automatic dispatcher resolution provided by ComponentDialog.

kotlin
// WRONG
@Composable
fun MyDialog(onDismiss: () -> Unit) {
    val dispatcherOwner = LocalNavigationEventDispatcherOwner.current!!
    Dialog(onDismissRequest = onDismiss) {
        // Redundant: ComponentDialog provides NavigationEventDispatcherOwner automatically
        CompositionLocalProvider( LocalNavigationEventDispatcherOwner provides dispatcherOwner) {
            val navigationState = rememberNavigationEventState(currentInfo = NavigationEventInfo.None)
            NavigationBackHandler(
                state = navigationState,
                onBackCompleted = onDismiss
            )
        }
    }
}
<br />
3. Parent-child dispatcher hierarchy (ViewPagers and nested navigation)

When managing nested UI hierarchies such as ViewPagers, tabbed interfaces, or custom navigation containers in Compose, use rememberNavigationEventDispatcherOwner() to create a child owner linked to the composition hierarchy. Setting enabled = false on the child owner automatically disables its dispatcher and all registered child handlers.

RIGHT

Why this is RIGHT : Using rememberNavigationEventDispatcherOwner(enabled = isSelected) creates a scoped child dispatcher linked to the parent from LocalNavigationEventDispatcherOwner.current. Providing it using CompositionLocalProvider ensures non-visible tabs or pages automatically stop intercepting back gestures without leaking handlers.

kotlin
// RIGHT: Scoping child navigation in a ViewPager or Tab interface
@Composable
fun TabPage(isSelected: Boolean) {
    val childOwner = rememberNavigationEventDispatcherOwner(enabled = isSelected)
    CompositionLocalProvider(LocalNavigationEventDispatcherOwner provides childOwner) {
        val navigationState = rememberNavigationEventState(currentInfo = NavigationEventInfo.None)
        NavigationBackHandler(
            state = navigationState,
            onBackCompleted = { /* Handle page back navigation */ }
        )
        // Page content
    }
}
<br />
WRONG

Why this is WRONG : Creating unlinked standalone dispatchers, instantiating raw dispatchers without remembering them across recompositions, or attempting to use non-existent methods like .addChild() breaks hierarchy routing and leaves child handlers active even when the page is inactive.

kotlin
// WRONG
@Composable
fun TabPage(isSelected: Boolean) {
    val parentDispatcher = LocalNavigationEventDispatcherOwner.current?.navigationEventDispatcher
    val childDispatcher = NavigationEventDispatcher() // Unlinked and not remembered across recompositions
    // WRONG: Method does not exist
    parentDispatcher?.addChild(childDispatcher)
}
<br />
4. Compose multi-handler registration (IllegalArgumentException)

You must not bind the same NavigationEventState to multiple active NavigationBackHandler instances, as this throws an IllegalArgumentException at runtime. To handle conditional workflows (such as checking for unsaved changes versus navigating back immediately), you must register a single unified handler and branch logic inside onBackCompleted.

RIGHT

Why this is RIGHT : Using a single NavigationBackHandler with internal branching logic inside onBackCompleted maintains a strict 1:1 mapping between NavigationEventState and the handler, preventing state collisions.

kotlin
// RIGHT
val navigationState = rememberNavigationEventState(currentInfo = NavigationEventInfo.None)
NavigationBackHandler(
    state = navigationState,
    isBackEnabled = true,
    onBackCompleted = {
        if (hasUnsavedChanges) {
            showDiscardDialog()
        } else {
            onNavigateUp()
        }
    }
)
<br />
WRONG

Why this is WRONG : Attaching multiple NavigationBackHandler composables to the same navigationState instance attempts to bind duplicate handlers to a single state object, which throws an IllegalArgumentException at runtime.

kotlin
// WRONG
val navigationState = rememberNavigationEventState(currentInfo = NavigationEventInfo.None)
NavigationBackHandler(
    state = navigationState,
    isBackEnabled = hasUnsavedChanges,
    onBackCompleted = { /* Discard changes */ }
)
NavigationBackHandler(
    state = navigationState,
    isBackEnabled = !hasUnsavedChanges,
    onBackCompleted = { /* Navigate up */ }
)
<br />

Checklist

For Compose Android targets:

  • [ ] Is compile SDK set to 36 or higher? (If compile SDK is lower than 36, set it to 36 or higher in build.gradle.kts).
  • [ ] Is android:enableOnBackInvokedCallback NOT explicitly set to "false" in AndroidManifest.xml? (On API 36+, it defaults to "true"; on API 33--35, ensure it is set to "true").
  • [ ] Does the Activity rely on the built-in ComponentActivity dispatcher owner without redundant anonymous delegate wrapping?
  • [ ] Do dialogs or sheets rely on automatic ComponentDialog dispatcher resolution without redundant CompositionLocalProvider wrapping?
  • [ ] Are parent-child dispatcher relationships in Compose scoped using rememberNavigationEventDispatcherOwner() when managing nested hierarchies?
  • [ ] Is conditional back logic handled within a single unified NavigationBackHandler to avoid duplicate registration (IllegalArgumentException)?
  • [ ] Are legacy BackHandler usages migrated to NavigationBackHandler with predictive progress support?
  • [ ] Does the project build and pass tests successfully?

© rosuH, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/navigation-event of rosuH/EasyWatermark.

  • SKILL.md
  • references/android/guide/navigation/navigation-event/dispatcher.md
  • references/android/guide/navigation/navigation-event/handle-back.md
  • references/android/guide/navigation/navigation-event/index.md
  • references/android/guide/navigation/navigation-event/setup.md

Open the folder on GitHubat commit 61223db

Used in 1 other repository

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in rosuH/EasyWatermark, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Navigation Event next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Navigation Event compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Navigation Event this skillrosuH/EasyWatermark1.9k1 repos~3.3kAutomated safety check: PassMIT
Compose Multiplatform Patternsmonta-app/ocpp-emulator1805 repos~2kAutomated safety check: PassApache-2.0
Phone HarnessShawnPana/phone-harness3.2k—~4.3kAutomated safety check: PassMIT
Stylesarindamxd/camerax-android1324 repos~2.3kAutomated safety check: PassApache-2.0
Verified Emailarindamxd/camerax-android1324 repos~4.7kAutomated safety check: PassApache-2.0
Argent Metro Debuggerbbplayer-app/BBPlayer1.1k—~3.4kAutomated safety check: PassMIT

Similar skills

  • Compose Multiplatform Patterns

    monta-app/ocpp-emulator

    Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.

    180 GitHub starsUsed in 5 repos~2k tokens
    MobileAuto-check passed
  • Phone Harness

    ShawnPana/phone-harness

    Control the user's phone — an iPhone through the Mac's iPhone Mirroring window, an Android over adb, or a rented cloud Android: open apps, tap, type, swipe, read the screen.

    3.2k GitHub stars~4.3k tokensUpdated 10 days ago
    MobileAuto-check passed
  • Styles

    arindamxd/camerax-android

    A skill your agent uses to integrate the Jetpack Compose Styles API into an Android project.

    132 GitHub starsUsed in 4 repos~2.3k tokens
    MobileAuto-check passed
  • Verified Email

    arindamxd/camerax-android

    Provides a complete workflow for implementing verified email retrieval on Android Credential Manager API.

    132 GitHub starsUsed in 4 repos~4.7k tokens
    MobileAuto-check passed
  • Argent Metro Debugger

    bbplayer-app/BBPlayer

    Debug a JS runtime via CDP using argent debugger tools. An agent skill from bbplayer-app/BBPlayer.

    1.1k GitHub stars~3.4k tokensUpdated today
    MobileAuto-check passed
  • 统一 Android XML 资源命名:layout、drawable、mipmap、color、values、id 的前缀与 snakecase 规则;把颜色/圆角/描边/状态编码进文件名(bg、border、textcolor…selector)。

    1.6k GitHub stars~1.3k tokensUpdated 1 mo ago
    MobileAuto-check passed

More from rosuH/EasyWatermark

All 28 skills in this repo
  • Deferring State Reads

    rosuH/EasyWatermark

    A skill your agent uses to push frequently-changing Jetpack Compose state reads (scroll position, animation values, drag offsets) out of the Composition phase and down into Layout or Draw using…

    1.9k GitHub starsUsed in 1 repo~3.8k tokens
    Auto-check passed
  • Diagnosing Compose Stability

    rosuH/EasyWatermark

    A skill your agent uses to diagnose Jetpack Compose stability problems by enabling and reading the Compose Compiler Reports (classes.txt, composables.txt, composables.csv, module.json).

    1.9k GitHub starsUsed in 1 repo~3.3k tokens
    Auto-check passed
  • Generating Baseline Profiles

    rosuH/EasyWatermark

    A skill your agent uses to generate and measure Jetpack Compose Baseline Profiles end-to-end with the AGP 8.2+ Baseline Profile Generator module and the Macrobenchmark harness.

    1.9k GitHub starsUsed in 1 repo~5k tokens
    Auto-check passed
  • Migrating To Modifier Node

    rosuH/EasyWatermark

    A skill your agent uses to author new custom Jetpack Compose modifiers and migrate legacy ones from Modifier.composed { } to Modifier.Node + ModifierNodeElement<T.

    1.9k GitHub starsUsed in 1 repo~5k tokens
    Auto-check passed
  • ML Kit Genai Prompt API

    rosuH/EasyWatermark

    Analyzes Android codebases to implement ML Kit GenAI Prompt API.

    1.9k GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Stabilizing Compose Types

    rosuH/EasyWatermark

    A skill your agent uses to fix unstable Jetpack Compose types once a stability diagnosis has identified them.

    1.9k GitHub starsUsed in 1 repo~4.4k tokens
    Auto-check passed

Works with

Categories

Questions about Navigation Event

What does Navigation Event do?

Intercept back gestures and run Predictive Back animations using the NavigationEvent (androidx.navigationevent) library in Compose Android. Navigation Event is an agent skill from rosuH/EasyWatermark.navigationevent) library in Compose Android.

When should I use Navigation Event?

Navigation Event fits situations like: mobile work in your project.

How do I install Navigation Event in Claude Code?

Run `npx skills add rosuH/EasyWatermark --skill navigation-event -a claude-code`. Or copy the skill folder (skills/navigation-event in rosuH/EasyWatermark) into .claude/skills/navigation-event in your project. Claude Code loads it when a task matches its description.

How do I install Navigation Event in Codex?

Run `npx skills add rosuH/EasyWatermark --skill navigation-event -a codex`. Or copy the skill folder (skills/navigation-event in rosuH/EasyWatermark) into .agents/skills/navigation-event in your project. Codex loads it when a task matches its description.

Can I use Navigation Event in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rosuH/EasyWatermark --skill navigation-event -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/navigation-event, .gemini/skills/navigation-event, .github/skills/navigation-event and .opencode/skills/navigation-event in your project.

What does Navigation Event need to run?

SKILL.md names no scripts, command-line tools or credentials: Navigation Event is instructions for the agent only.

Does Navigation Event access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Navigation Event safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Navigation Event use?

Navigation Event is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Navigation Event use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.2k tokens, read only when the agent opens those files.

What are the alternatives to Navigation Event?

Skills that share tags, products or a category with Navigation Event: Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Phone Harness (ShawnPana/phone-harness, 3.2k stars), Styles (arindamxd/camerax-android, 132 stars) and Verified Email (arindamxd/camerax-android, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Navigation Event?

rosuH (a GitHub user) maintains it in rosuH/EasyWatermark, which has 1,894 GitHub stars. The repository holds 28 skills in this directory. The repository was last updated on October 6, 2026.

Source: rosuH/EasyWatermark on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.