Langsung ke konten
Skillpedia
Aplikasi mobile10k Β· #11920

ink-custom-brush-builder

Fungsinya

Skill ini memandu pembuatan gaya kuas khusus untuk aplikasi gambar Android dengan Jetpack Ink. Skill mencakup bentuk kuas, respons terhadap input, tekstur, dan penghalusan. Skill ditujukan bagi pengembang Android yang menginginkan kuas di luar kuas standar.

Kapan dipakai

  • βœ“Saat Anda ingin kuas yang ketebalannya berubah mengikuti tekanan stylus.
  • βœ“Ketika Anda membutuhkan kuas bertekstur atau berlapis untuk aplikasi gambar.
  • βœ“Ketika Anda ingin menyimpan kuas khusus agar aplikasi bisa memuatnya kembali nanti.

Link skill

https://github.com/android/skills/blob/main/jetpack-compose/ink/ink-custom-brush-builder/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/android/skills/blob/main/jetpack-compose/ink/ink-custom-brush-builder/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuat kuas bertekstur khusus untuk aplikasi gambar Android saya yang merespons tekanan dan kemiringan.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill membangun keluarga kuas dari bentuknya, respons terhadap input, dan tekstur catnya. Lalu ia mengubah kuas itu menjadi kuas yang bisa dipakai aplikasi untuk menggambar.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Custom brushes in the Android Ink API are built around the BrushFamily hierarchy:

BrushFamily
β”œβ”€β”€ InputModel (BrushFamily.InputModel.SlidingWindowModel or PASSTHROUGH_MODEL)
└── BrushCoat[] (one or more rendering layers)
    β”œβ”€β”€ BrushTip (shape: scaleX, scaleY, cornerRounding, rotationDegrees, slantDegrees, pinch)
    β”‚   └── BrushBehavior[] (dynamic response to stylus or touch input)
    β”‚       └── Tree: TargetNode(input = [Operators](input = SourceNode))
    └── BrushPaint (visual appearance)
        β”œβ”€β”€ SelfOverlap (ANY, ACCUMULATE, or DISCARD)
        β”œβ”€β”€ TextureLayer[] (BrushPaint.TilingTexture or BrushPaint.StampingTexture)
        └── BrushPaint.ColorFunction[] (OpacityMultiplier or ReplaceColor)

Create a Brush by combining a custom BrushFamily with a Compose Color, size, and epsilon:

val brush = Brush.createWithComposeColor(
    family = myCustomFamily,
    color = Color.Black,
    size = 10f,
    epsilon = 0.1f,
)
<br />

Version and experimental API requirements :

  • Requires androidx.ink 1.1.0-alpha03 and higher : In 1.0.0 (Stable) and 1.1.0-alpha01-alpha02, BrushFamily(...), BrushCoat, BrushTip, BrushPaint, BrushBehavior, and androidx.ink.brush.behavior.* nodes were @RestrictTo(LIBRARY_GROUP) (in 1.0.0 stable, custom brushes can only be loaded from binary proto streams using BrushFamily.decode). Starting in 1.1.0-alpha03 and higher , programmatic custom brush constructors graduated to public API (BrushPaint.TilingTexture, BrushPaint.StampingTexture, BrushPaint.ColorFunction, BrushFamily.InputModel.SlidingWindowModel, and all behavior nodes).
  • No @OptIn required in 1.1.0-alpha03 and higher : All public custom brush classes and ink-storage BrushFamily serialization APIs (BrushFamily.encode and decode, AndroidBrushFamilySerialization, BrushFamilyDecodeCallback) are unannotated in 1.1.0-alpha03 and higher (ExperimentalInkCustomBrushApi is @RestrictTo(LIBRARY_GROUP) in 1.1.0-alpha05 and higher, and is only required on BrushFamily serialization in 1.0.0 stable).

Workflow and task routing

Follow these conditional instructions based on the requested custom brush task:

  • Step 1 (Dependencies) : When setting up an Android project for programmatic custom brushes, ask user permission before editing build files and verify that androidx.ink:ink-brush, androidx.ink:ink-brush-compose, androidx.ink:ink-storage, and androidx.ink:ink-nativeloader use version 1.1.0-alpha03 or higher in gradle/libs.versions.toml and app/build.gradle.kts.
  • Step 2 (Hierarchy, tip shape, paint, and input smoothing) : When defining BrushFamily and multi-coat BrushCoat layers, configuring BrushTip geometry (scaleX, scaleY, cornerRounding, rotationDegrees, slantDegrees, pinch), setting BrushPaint properties (SelfOverlap, ColorFunction), or smoothing stroke input with BrushFamily.InputModel.SlidingWindowModel, you MUST follow brush-structure.md. For baseline Brush creation or 1.0.0 resource loading, review Brush APIs.
  • Step 3 (Dynamic stylus and touch behaviors) : When making a brush respond dynamically to stylus pressure, tilt, speed, direction, or procedural noise using BrushBehavior node trees (SourceNode, DampingNode, NoiseNode, ResponseNode, TargetNode, PolarTargetNode), you MUST follow brush-behaviors.md.
  • Step 4 (Textures and serialization) : When adding BrushPaint.TilingTexture or BrushPaint.StampingTexture layers, implementing TextureBitmapStore, or encoding and decoding custom BrushFamily definitions (BrushFamily.encode and decode, AndroidBrushFamilySerialization, BrushFamilyDecodeCallback), you MUST follow textures-and-serialization.md. Inform the user which texture image files (such as app/src/main/res/drawable-nodpi/pencil_grain.png) to add to their project and register in TextureBitmapStore.
  • Step 5 (Complete brush recipes) : When building a complete pressure pen, calligraphy nib, shading pencil, watercolor wash, or multi-coat shadow brush from scratch, start from the copy-ready implementations in examples.md.
  • **Compose
Pertanyaan umum

Versi Jetpack Ink mana yang dibutuhkan?

Kuas khusus memerlukan androidx.ink versi 1.1.0-alpha03 atau lebih baru, karena rilis stabil 1.0.0 membatasinya.

Input apa saja yang bisa ditanggapi kuas?

Kuas dapat merespons tekanan, kemiringan, kecepatan, dan noise stylus, tergantung perilaku yang Anda atur.

Apakah kuas khusus bisa disimpan?

Bisa. Skill mencakup penyimpanan keluarga kuas agar bisa disimpan dan dimuat kembali.

Detail

Deskripsi asli dari pembuat

Creates custom BrushFamily definitions for an Android app using Jetpack Ink (androidx.ink 1.1.0-alpha03 and higher). Use this skill when configuring custom BrushTip shapes, adding pressure, tilt, speed, or noise sensitivity using BrushBehavior node graphs, creating multi-coat layered brushes, applying tiling or particle stamping textures, configuring SlidingWindowModel input smoothing, or serializing brushes. Delivers complete Kotlin BrushFamily, BrushCoat, BrushTip, BrushPaint, and BrushBehavior implementations. Don't use for View-based (XML) inking, Compose drawing surface setup, or stock br

repo: android/skills

Popularitas

Bintang GitHub
10k
Peringkat
#11920
Lisensi
Apache-2.0
Diperbarui
29/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa