mirror of
https://github.com/fromchat-messenger/app.git
synced 2026-09-22 19:15:05 +03:00
@@ -0,0 +1,25 @@
|
||||
---
|
||||
description: Prefer utils package APIs when available
|
||||
globs: "**/*.kt"
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Utils Package Preference
|
||||
|
||||
When working with the Android/KMP codebase, prefer APIs from `com.pr0gramm3r101.utils` whenever possible.
|
||||
|
||||
## Clipboard
|
||||
- Use `supportClipboardManagerImpl` (Composable) instead of `LocalClipboardManager` / `LocalClipboard`
|
||||
- `SupportClipboardManager.setText(string: String)` is suspend; call from `scope.launch { }`
|
||||
|
||||
## String
|
||||
- Use `String.toAnnotatedString()` for `AnnotatedString` conversion
|
||||
|
||||
## Modifier
|
||||
- Use `Modifier.conditional` from `com.pr0gramm3r101.utils.Compose` for conditional modifiers
|
||||
|
||||
## CompositionLocal
|
||||
- Use `CompositionLocal.invoke()` for `current` when available
|
||||
|
||||
## Other
|
||||
- Check `Utils.kt`, `Compose.kt`, `Components.kt`, `Adaptive.kt` before implementing custom solutions
|
||||
Reference in New Issue
Block a user