Skip to content
Back to skills

Jetpack Compose Knowledge Patch

ASecurity

Jetpack Compose

  • 25 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
developmentgokotlinnodetestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill jetpack-compose-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Jetpack Compose Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Jetpack Compose Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-jetpack-compose-knowledge-patch-nevaberry-plugins/badge)](https://www.skillsdirectory.com/skills/nevaberry-jetpack-compose-knowledge-patch-nevaberry-plugins)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: jetpack-compose-knowledge-patch
description: Jetpack Compose
version: null
license: MIT
metadata:
  author: Nevaberry
---


# Jetpack Compose

Load this skill when upgrading Compose, migrating deprecated APIs, or working on
runtime state, text input, layout, animation, Android hosting, Material components,
semantics, or UI tests. Use the topic references for detailed compatibility
guidance and historical migrations. Keep each entry's version and product scope
when applying its advice.

## Reference index

| Reference | Topics |
| --- | --- |
| [Build, runtime, and state](references/build-runtime-state.md) | Dependencies, compiler, snapshots, retention, saved state, composition, diagnostics |
| [Android hosts, windows, and insets](references/android-host-windows.md) | ComposeView, embedded Views, attachment, popups, dialogs, insets, rulers |
| [Input, focus, and scrolling](references/input-focus-scrolling.md) | Focus, pointer input, gestures, indications, overscroll, lazy caching, prefetch |
| [Layout, animation, and graphics](references/layout-animation-graphics.md) | Measurement, nodes, Grid, FlexBox, styles, visibility, transitions, drawing, blur |
| [Material 3 components](references/material3-components.md) | Themes, sheets, navigation, app bars, text fields, pickers, tooltips, sliders, carousels |
| [Semantics, accessibility, and testing](references/semantics-accessibility-testing.md) | Autofill, accessibility, test scheduling, input injection, previews, inspection |
| [Text and editing](references/text-editing.md) | Fonts, text layout, annotations, selection, editing, transformations, platform input |

## Upgrade requirements

Compose 1.10 raises the Android minimum SDK from 21 to 23. Use Kotlin Gradle
plugin 2.0.0 or later to consume artifacts built with Kotlin 2.0.
Starting with Compose 1.12.0, Android projects must use `compileSdk = 37`;
Compose 1.12 requires Android Gradle Plugin 9.2.0 or later.

For the stable 1.13 core modules, use Compose BOM `2026.11.01`. This upgrade
requires Kotlin 2.2 or newer and `compileSdk` 37.1.

```kotlin
dependencies {
    implementation(platform("androidx.compose:compose-bom:2026.11.01"))
}
```

If the root build script supplies the Compose Compiler Gradle plugin through
`buildscript`, add its plugin marker artifact to the classpath, using the same
version as the project's Kotlin plugin. See the build reference for the example.

## Breaking changes and deprecations

### Indications and removed flags

On recompilation with Foundation 1.9.0, the `clickable`, `combinedClickable`,
`selectable`, `toggleable`, and `triStateToggleable` overloads that read
`LocalIndication` crash with legacy `Indication` implementations. Migrate to
`IndicationNodeFactory`, pass the legacy instance to an overload with an explicit
`indication` parameter, or temporarily set
`ComposeFoundationFlags.isNonComposedClickableEnabled = false`.
The `isNonComposedClickableEnabled` flag is removed in 1.10.0.

In 1.11.0, `isDetectTapGesturesImmediateCoroutineDispatchEnabled` and
`DetectTapGesturesEnableNewDispatchingBehavior` are removed. The input reference
contains the full flag-removal guidance.

### Layout and lazy caching

`ContextualFlowRow` and `ContextualFlowColumn` are deprecated. Use `FlowRow` or
`FlowColumn` where ordinary wrapping suffices, with the overloads without
`overflow`, which clip overflow.

The November release deprecates the Compose `ConstraintLayout` and `MotionLayout`
APIs from `androidx.constraintlayout:constraintlayout-compose`.
Move `LazyLayoutCacheWindow` configuration from the scroll state holder, such as
`rememberLazyListState`, to the lazy layout composable for lazy lists and staggered
grids. The default ahead prefetch window is sized from the viewport; custom ahead
and behind windows control prefetching and offscreen retention.

### Material component migrations

In Material 3 1.5.0, stateless `Slider` and `RangeSlider` overloads are deprecated.
Use the stable state-backed overloads and pass the now-required `onValueChange`
by name because its position changed. Pass `onValueChangeFinished` to the
composable as well. Rename `RangeSliderState.activeRangeStart` and
`activeRangeEnd` to `startValue` and `endValue`.

```kotlin
val sliderState = remember { SliderState(value = 0.5f) }
Slider(state = sliderState, onValueChange = {})
```

Rename `isAtTop` arguments on `TopAppBarDefaults` scroll behaviors to `isAtStart`.
Move side effects that should run after dismissal from the deprecated
`SwipeToDismissBoxState.confirmValueChange` to `SwipeToDismissBox`'s `onDismissed`.
Rename `maxItemWidth` to `preferredItemWidth` in `HorizontalCenteredHeroCarousel`.

### Text, saveable state, and runtime

Replace removed `AutoSize` overloads with `TextAutoSize`. Use
`BasicText("Title", autoSize = TextAutoSize.StepBased(12.sp, 24.sp))` for a fitting
size from a range, or implement `TextAutoSize` for a custom sizing policy.
`BasicText` dropped its implicit graphics layer and the flag that restored it;
use `BasicText("Title", modifier = Modifier.graphicsLayer())` when drawing depends
on that layer.

Remove the deprecated custom `key` argument from `rememberSaveable` to use
positional scoping and avoid accidental reuse or loss of state, especially in
nested lazy layouts. In 1.11.0, update `RetainedValuesStore` implementations and
callers from `getExitedValueOrDefault` to `consumeExitedValueOrDefault`; migrate
callers of the removed experimental concurrent recomposition API to regular
recomposition.

### Visibility, windows, and paint

`Modifier.onFirstVisible()` is deprecated because an item can trigger it again
when it scrolls back into view. Use `Modifier.onVisibilityChanged()` and store
whether the item has already been visible for as long as your use case requires.
Replace the removed `ComposeUiFlags.areWindowInsetsRulersEnabled` flag with
`composeView.disableWindowInsetsRulers()` on each host where rulers should be
disabled.

Use `android.graphics.Paint` in Android code where you used the deprecated
`androidx.compose.ui.graphics.NativePaint` alias. Use `Paint.nativePaint` in place
of `Paint.asFrameworkPaint()`.

### Test entry points and semantics

Import `create*ComposeRule` from `androidx.compose.ui.test.junit4.v2` or
`run*ComposeUiTest` from `androidx.compose.ui.test.v2`. These entry points default
to `StandardTestDispatcher`; use the shared `TestCoroutineScheduler` to run queued
work before assertions that depend on it.

`background`, `border`, and `graphicsLayer` can add semantics nodes, so tests using
`onChild`, `onParent`, or `onSibling` can reach a different node. Locate the target
by its own `testTag` or use a matcher such as
`onNode(hasAnyAncestor(hasText("ancestor")) and hasText("target"))`.
Replace `interaction.semanticsId()` with `interaction.fetchSemanticsNode().id`.

## State and composition

Use `retain { … }` for in-memory objects that should survive a configuration
change on Android. The store retains both the value and its keys, so keep
short-lived references such as an Activity out of the keys and mark types that
should never be retained with `@DoNotRetain`.

Use `computedStateOf` for a cheap calculation over other state. Observers
invalidate when the calculated result changes, and each `value` read runs the
calculation again. Use `derivedStateOf` when repeated reads benefit from caching
or the result needs stable identity.

Use `PausableComposition` to build a subcomposition across multiple work intervals
and apply it once composition is complete. Pausing requires compiler support.

## Text editing and autofill

Each `TextFieldState.edit { ... }` creates a standalone undo entry. Call
`state.undoState.clearHistory()` after the edit if it should also reset the undo
stack. Call `TextFieldBuffer.addStyle` within an `OutputTransformation` to style
displayed text.

Use Compose UI and Foundation 1.8 or later together for text autofill. Replace
legacy autofill nodes with field semantics such as
`Modifier.semantics { contentType = ContentType.Username }`. Use
`LocalAutofillManager.current?.commit()` to prompt saving credentials at a chosen
point in the flow. For custom fields, use `fillableData` and `onFillData` in place
of the deprecated text-only `onAutofillText` action; `FillableData.createFrom(value)`
supports text, toggle values, list indices, and dates in milliseconds.

## Scrolling and transitions

Replace `LocalOverscrollConfiguration` with `LocalOverscrollFactory`. Disable
overscroll with `LocalOverscrollFactory provides null`. To render an effect
outside a scrollable, pass `effect.withoutVisualEffect()` as its `overscrollEffect`
and put `Modifier.overscroll(effect.withoutEventHandling())` on the drawing
container.

Use `Modifier.animateBounds` inside a `LookaheadScope` to animate changes in size
and position. In a `SharedTransitionScope`, `Modifier.skipToLookaheadPosition()`
places a layout at its target position during the animation. This modifier and
`Modifier.skipToLookaheadSize()` skip by default only while a shared transition
is active.

When upgrading to Animation 1.13.0, replace `EnterTransition.with` with
`togetherWith`, for example `transitionSpec = { fadeIn() togetherWith fadeOut() }`.
Remove experimental opt-ins used solely for `DeferredTransitionState`,
`rememberDeferredTransition`, `DeferredAnimatedContent`,
`DeferredAnimatedVisibility`, or `TransformScope`.

## Progressive blur

Pass a `BlurRadiusSpec` directly to `Modifier.blur`, or assign `blurRadiusSpec`
in the configuration block to replace the default `BlurRadiusSpec.uniform(0.dp)`.
`edgeTreatment` defaults to `BlurredEdgeTreatment.Rectangle`; `alpha` defaults to
`1f` and ranges from `0..1`. Use the layer's `size: DpSize` for gradient geometry
and the scope's `Density` methods for unit conversion.

```kotlin
val uniformBlur = Modifier.blur(BlurRadiusSpec.uniform(12.dp), alpha = 0.8f)

fun Modifier.blurWithSize(specForSize: (DpSize) -> BlurRadiusSpec): Modifier =
    blur {
        blurRadiusSpec = specForSize(size)
    }
```

Uniform specs require Android 12 (API 31); spatially varying specs require
Android 13 (API 33). The modifier has no effect below the applicable minimum.
Leave room inside the layer bounds for the blur radius to avoid clipping.
Read `WindowInfo.isCrossWindowBlurEnabled` to decide whether to use cross-window
blur or show a fallback.

## Material defaults and experimental features

`SecureTextField` and `OutlinedSecureTextField` default to
`TextObfuscationMode.System`, following the system password visibility setting.
Pass `textObfuscationMode = TextObfuscationMode.RevealLastTyped` to retain
unconditional last-character reveal.

Material 3 1.5.0 uses the revised checkbox box size and indicator alignment by
default. Set `ComposeMaterial3Flags.isCheckboxStylingFixEnabled = false` to retain
the previous styling during migration.
Experimental `MaterialShapes` exposes normalized `RoundedPolygon` presets;
use `toShape()` or `toPath()` to convert a preset or a `Morph` into a Compose shape
or path. Use the experimental `Modifier.carouselParallaxScrollEffect` with a
lazy grid for multi-aspect carousel layouts.

Files in this skill

  • SKILL.md11 KB
  • coverage.json1.3 KB
  • references/android-host-windows.md3.5 KB
  • references/build-runtime-state.md7.5 KB
  • references/input-focus-scrolling.md7.4 KB
  • references/layout-animation-graphics.md6.7 KB
  • references/material3-components.md6.1 KB
  • references/semantics-accessibility-testing.md5.5 KB
  • references/text-editing.md4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.