透過集合功能整理內容
你可以依據偏好儲存及分類內容。
手繪功能
打造一流的觸控筆應用程式。降低開發人員門檻,輕鬆打造高效能的精美筆跡體驗。
最近更新時間 |
穩定版 |
候選版 |
Beta 版 |
Alpha 版 |
2025 年 8 月 13 日 |
- |
- |
- |
1.0.0-alpha06 |
宣告依附元件
如要為 Ink 新增依附元件,必須將 Google Maven 存放區新增至專案。詳情請參閱 Google 的 Maven 存放區。
在應用程式或模組的 build.gradle
檔案中,新增所需構件的依附元件:
Groovy
dependencies {
implementation "androidx.ink:ink-authoring:1.0.0-alpha06"
implementation "androidx.ink:ink-brush:1.0.0-alpha06"
implementation "androidx.ink:ink-geometry:1.0.0-alpha06"
implementation "androidx.ink:ink-nativeloader:1.0.0-alpha06"
implementation "androidx.ink:ink-rendering:1.0.0-alpha06"
implementation "androidx.ink:ink-strokes:1.0.0-alpha06"
}
Kotlin
dependencies {
implementation("androidx.ink:ink-authoring:1.0.0-alpha06")
implementation("androidx.ink:ink-brush:1.0.0-alpha06")
implementation("androidx.ink:ink-geometry:1.0.0-alpha06")
implementation("androidx.ink:ink-nativeloader:1.0.0-alpha06")
implementation("androidx.ink:ink-rendering:1.0.0-alpha06")
implementation("androidx.ink:ink-strokes:1.0.0-alpha06")
}
如要進一步瞭解依附元件,請參閱「新增建構依附元件」一文。
意見回饋
您的意見可協助我們改善 Jetpack。如果您發現新問題,或是有改進這個程式庫的建議,請告訴我們。回報新問題前,請先查看這個程式庫的現有問題。只要按一下星號按鈕,即可投票給現有的問題。
建立新問題
詳情請參閱 Issue Tracker 文件。
這個構件沒有任何版本資訊。
1.0 版本
1.0.0-alpha06 版本
2025 年 8 月 13 日
發布 androidx.ink:ink-*:1.0.0-alpha06
。1.0.0-alpha06 版包含這些修訂項目。
新功能
- 表情符號螢光筆筆刷:使用任何您選擇的表情符號醒目顯示文件內容,增添趣味並協助整理文件。
- 幾何模組原始形狀的更多輔助 API
- 提升裝置相容性和效能
API 變更
- 簡化
InProgressStrokesView
的 API、完成幾何 API、表情符號螢光筆、從 MutableParallelogram
中移除工廠函式,改用填入方法、支援隨機筆刷行為的種子。(I38280)
修正錯誤
1.0.0-alpha05 版本
2025 年 6 月 18 日
發布 androidx.ink:ink-*:1.0.0-alpha05
。1.0.0-alpha05 版包含這些修訂項目。
新功能
API 變更
- 新的 Compose 互通性模組和 API、API 清理 (I0e464)
- 已移除傳回
kotlin.Result
的 InProgressStroke.enqueueInputs/updateShape
方法,用戶端應改用 enqueueInputsOrThrow
或 enqueueInputsOrIgnore
等方法。InProgressStroke.getNeedsUpdate
已重新命名為 isUpdateNeeded
。InProgressStroke.populateOutlinePosition
現在會傳回輸出參數,以允許呼叫鏈結,與 Ink 中的其他方法一致。TextureBitmapStore
介面已從轉譯模組移至筆刷模組。BoxAccumulator.populateFrom
會採用可為空值的不可變動 Box,而非可變動的 BoxAccumulator
,以便更清楚瞭解變動內容,因此呼叫端應將 boxAccumulator.add(other)
變更為 boxAccumulator.add(other.box)
。已移除 BrushUtil.toBuilderWithAndroidColor/createBuilderWithAndroidColor
,請改用建構後的 Brush.Builder
的 setAndroidColor
。(Ia7155)
- 先前實驗性屬性
InProgressStrokesView.textureBitmapStore
現在已設為私人。這個屬性仍有公開存取子項。(I1d706)
修正錯誤
1.0.0-alpha04 版本
2025 年 4 月 9 日
發布 androidx.ink:ink-*:1.0.0-alpha04
。1.0.0-alpha04 版包含這些修訂項目。
新功能
- 推出新的實驗性 API,可自訂
BrushFamily
物件,啟用鉛筆和雷射筆等新筆刷。API 可載入這個 proto 定義的筆刷。(I8809a)
1.0.0-alpha03 版本
2025 年 2 月 12 日
發布 androidx.ink:ink-*:1.0.0-alpha03
。1.0.0-alpha03 版包含這些修訂項目。
新功能
- 節省磁碟和網路大小:
StrokeInputBatch
的序列化作業可節省許多程式碼行數,產生的物件大小僅為傳統儲存筆劃的一小部分。(Ie898d)
- 套索選取:虛線筆刷可繪製選取筆觸,並將選取筆觸轉換為幾何查詢的
PartitionedMesh
。(Ia38a0)
1.0.0-alpha02 版
2024 年 12 月 11 日
發布 androidx.ink:ink-*:1.0.0-alpha02
。1.0.0-alpha02 版包含這些修訂項目。
API 變更
外部貢獻
- 淘汰
BuildCompat.isAtLeastV
。呼叫端應直接檢查 SDK_INT 是否為 35。(I294d1)
1.0.0-alpha01 版
2024 年 10 月 2 日
發布 androidx.ink:ink-*:1.0.0-alpha01
。1.0.0-alpha01 版包含這些修訂項目。
新功能
- 這個模組化且可設定的程式庫可讓您輕鬆建立、算繪及操控應用程式中撰寫的精美筆跡。
API 變更
全新模組可協助開發人員打造豐富的筆跡體驗:
- 撰寫:使用
InProgressStrokesView
即時轉譯筆觸,效能高且延遲時間短。
- 算繪:使用
CanvasStrokeRenderer
和 ViewStrokeRenderer
繪製完成的筆跡,做為應用程式使用者介面的一部分。
- 筆劃:用於手寫筆功能的基礎資料類型。
- 筆刷:可設定筆觸的外觀和行為,以回應使用者輸入內容。
- 幾何:交集和涵蓋範圍等幾何運算,可支援選取和清除等工具。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-08-13 (世界標準時間)。
[null,null,["上次更新時間:2025-08-13 (世界標準時間)。"],[],[],null,["# ink\n===\n\nAPI Reference \n[androidx.ink.authoring](/reference/kotlin/androidx/ink/authoring/package-summary) \n[androidx.ink.authoring.compose](/reference/kotlin/androidx/ink/authoring/compose/package-summary) \n[androidx.ink.brush](/reference/kotlin/androidx/ink/brush/package-summary) \n[androidx.ink.brush.compose](/reference/kotlin/androidx/ink/brush/compose/package-summary) \n[androidx.ink.geometry](/reference/kotlin/androidx/ink/geometry/package-summary) \n[androidx.ink.geometry.compose](/reference/kotlin/androidx/ink/geometry/compose/package-summary) \n[androidx.ink.android.canvas](/reference/kotlin/androidx/ink/rendering/android/canvas/package-summary) \n[androidx.ink.android.view](/reference/kotlin/androidx/ink/rendering/android/view/package-summary) \n[androidx.ink.strokes](/reference/kotlin/androidx/ink/strokes/package-summary) \nInspire best-in-class pen apps. Lower the developer barrier to entry for high performance, beautiful inking experiences. \n\n| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |\n|-----------------|----------------|-------------------|--------------|---------------------------------------------------------------|\n| August 13, 2025 | - | - | - | [1.0.0-alpha06](/jetpack/androidx/releases/ink#1.0.0-alpha06) |\n\nDeclaring dependencies\n----------------------\n\nTo add a dependency on Ink, you must add the Google Maven repository to your\nproject. Read [Google's Maven repository](/studio/build/dependencies#google-maven)\nfor more information.\n\nAdd the dependencies for the artifacts you need in the `build.gradle` file for\nyour app or module: \n\n### Groovy\n\n```groovy\ndependencies {\n \n implementation \"androidx.ink:ink-authoring:1.0.0-alpha06\"\n implementation \"androidx.ink:ink-brush:1.0.0-alpha06\"\n implementation \"androidx.ink:ink-geometry:1.0.0-alpha06\"\n implementation \"androidx.ink:ink-nativeloader:1.0.0-alpha06\"\n implementation \"androidx.ink:ink-rendering:1.0.0-alpha06\"\n implementation \"androidx.ink:ink-strokes:1.0.0-alpha06\"\n \n}\n```\n\n### Kotlin\n\n```kotlin\ndependencies {\n\n\n implementation(\"androidx.ink:ink-authoring:1.0.0-alpha06\")\n implementation(\"androidx.ink:ink-brush:1.0.0-alpha06\")\n implementation(\"androidx.ink:ink-geometry:1.0.0-alpha06\")\n implementation(\"androidx.ink:ink-nativeloader:1.0.0-alpha06\")\n implementation(\"androidx.ink:ink-rendering:1.0.0-alpha06\")\n implementation(\"androidx.ink:ink-strokes:1.0.0-alpha06\")\n}\n```\n\nFor more information about dependencies, see [Add build dependencies](/studio/build/dependencies).\n\nFeedback\n--------\n\nYour feedback helps make Jetpack better. Let us know if you discover new issues or have\nideas for improving this library. Please take a look at the\n[existing issues](https://issuetracker.google.com/issues?q=componentid:1662443%20status:open)\nin this library before you create a new one. You can add your vote to an existing issue by\nclicking the star button.\n\n[Create a new issue](https://issuetracker.google.com/issues/new?component=1662443&template=2055047)\n\nSee the [Issue Tracker documentation](https://developers.google.com/issue-tracker)\nfor more information.\n\nThere are no release notes for this artifact.\n\nVersion 1.0\n-----------\n\n### Version 1.0.0-alpha06\n\nAugust 13, 2025\n\n`androidx.ink:ink-*:1.0.0-alpha06` is released. Version 1.0.0-alpha06 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/e8af6ab7417811bf386c52a59ab5d0b94d194eeb..c359e97fece91f3767a7d017e9def23c7caf1f53/ink).\n\n**New Features**\n\n- Emoji highlighter stock brush: Highlight parts of a document with any emoji you choose, to add a fun flair and help stay organized.\n- More helper APIs for geometry module primitive shapes\n- Improve device compatibility and performance\n\n**API Changes**\n\n- Simplified API for `InProgressStrokesView`, finish geometry APIs, emoji highlighter, remove factory functions from `MutableParallelogram` in favor of populate methods, support seed for randomized brush behaviors. ([I38280](https://android-review.googlesource.com/#/q/I38280146fca9a55b06d87a835670efdd012990e7))\n\n**Bug Fixes**\n\n- Fix a performance issue and a wet/dry color consistency issue. ([Ifcd1d](https://android-review.googlesource.com/#/q/Ifcd1da4081a01ba8165b4e8624219b1bd26bd248))\n\n### Version 1.0.0-alpha05\n\nJune 18, 2025\n\n`androidx.ink:ink-*:1.0.0-alpha05` is released. Version 1.0.0-alpha05 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/4c37298a97c16270c139eb812ddadaba03e23a52..e8af6ab7417811bf386c52a59ab5d0b94d194eeb/ink).\n\n**New Features**\n\n- Compose interoperability modules for authoring, brush, and geometry modules\n\n**API Changes**\n\n- New Compose interoperability modules and APIs, API cleanup ([I0e464](https://android-review.googlesource.com/#/q/I0e4641822d568573fc8c7b3955a007a8ac9cd1c5))\n- `InProgressStroke.enqueueInputs/updateShape` methods which returned `kotlin.Result` are removed, clients should use e.g. `enqueueInputsOrThrow` or `enqueueInputsOrIgnore` instead. `InProgressStroke.getNeedsUpdate` is renamed to `isUpdateNeeded`. `InProgressStroke.populateOutlinePosition` now returns its output parameter to allow call chaining, consistent with other methods in Ink. The `TextureBitmapStore` interface is moved from the rendering module to the brush module. `BoxAccumulator.populateFrom` is made to take a nullable immutable Box instead of a mutable `BoxAccumulator`, to make it clearer what is mutated, callers should change `boxAccumulator.add(other)` to `boxAccumulator.add(other.box)`. `BrushUtil.toBuilderWithAndroidColor/createBuilderWithAndroidColor` are removed, use the `setAndroidColor` of `Brush.Builder` after constructing instead. ([Ia7155](https://android-review.googlesource.com/#/q/Ia7155560602b8319183aa12671d7f1d925873448))\n- Previously experimental property `InProgressStrokesView.textureBitmapStore` is now private. There are still public accessors for this property. ([I1d706](https://android-review.googlesource.com/#/q/I1d7064ff25c953066a4b43a6c30a4b3aa0b145d5))\n\n**Bug Fixes**\n\n- Improved performance for custom brushes containing many particles.\n\n### Version 1.0.0-alpha04\n\nApril 9, 2025\n\n`androidx.ink:ink-*:1.0.0-alpha04` is released. Version 1.0.0-alpha04 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/24c00eb294d9cda579d8d6e48a29497fe0f8d3f7..4c37298a97c16270c139eb812ddadaba03e23a52/ink).\n\n**New Features**\n\n- Introduces new experimental APIs for custom `BrushFamily` objects, enabling new brushes like Pencil and Laser Pointer. The API allows for loading brushes defined by this proto. ([I8809a](https://android-review.googlesource.com/#/q/I8809a675a5527c1a7bc2f519e041a8af1ed693b3))\n\n### Version 1.0.0-alpha03\n\nFebruary 12, 2025\n\n`androidx.ink:ink-*:1.0.0-alpha03` is released. Version 1.0.0-alpha03 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/46295bc0b75a16f452e8e0090e8de41073d4dbb6..24c00eb294d9cda579d8d6e48a29497fe0f8d3f7/ink).\n\n**New Features**\n\n- Disk and network size savings: Serialization of `StrokeInputBatch`, saving many lines of code, with the resulting objects a tiny fraction of the size of traditionally stored strokes. ([Ie898d](https://android-review.googlesource.com/#/q/Ie898d91e3c77eccbf26e9ee6d7f384a3a57b974f))\n- Lasso selection: dashed line brush to draw a selection stroke, and a function to turn the selection stroke into a `PartitionedMesh` for geometry queries. ([Ia38a0](https://android-review.googlesource.com/#/q/Ia38a0e3e7a2da344d978bdfd5b8db8210a753e74))\n\n### Version 1.0.0-alpha02\n\nDecember 11, 2024\n\n`androidx.ink:ink-*:1.0.0-alpha02` is released. Version 1.0.0-alpha02 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/b6ae8d0a0e8cd803f7b84f30101eda1af4f1d6b6..46295bc0b75a16f452e8e0090e8de41073d4dbb6/ink).\n\n**API Changes**\n\n- Assorted bug fixes. ([I05dd8](https://android-review.googlesource.com/#/q/I05dd84cb83c29b6f8af876164c426fee57f6f932))\n\n**External Contribution**\n\n- Deprecate `BuildCompat.isAtLeastV`. Callers should check SDK_INT against 35 directly instead. ([I294d1](https://android-review.googlesource.com/#/q/I294d117a8fea924e7f1b739d52268a9a54be6db7))\n\n### Version 1.0.0-alpha01\n\nOctober 2, 2024\n\n`androidx.ink:ink-*:1.0.0-alpha01` is released. Version 1.0.0-alpha01 contains [these commits](https://android.googlesource.com/platform/frameworks/support/+log/b6ae8d0a0e8cd803f7b84f30101eda1af4f1d6b6/ink).\n\n**New Features**\n\n- A modular and configurable library to make it easy to create, render, and manipulate beautiful ink strokes authored in your application.\n\n**API Changes**\n\nNew modules to help developers build rich inking experiences:\n\n- Authoring: Use `InProgressStrokesView` for high-performance, low latency rendering of strokes in real time as inputs are received.\n- Rendering: Use `CanvasStrokeRenderer` and `ViewStrokeRenderer` to draw the finished ink strokes as part of an app's user interface.\n- Strokes: Core data types used for inking features.\n- Brush: Configurable specification of how strokes will look and act in response to user input.\n- Geometry: Geometric operations like intersection and coverage to power tools like selection and erasing."]]