fix clip now working when android api < 29#1167
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes clip functionality for Android API versions below 29 by implementing a compatibility layer. The primary issue addressed is that standard clipping wasn't working properly on older Android versions.
- Introduces a custom
compatClipfunction that uses manual drawing to achieve clipping effects - Replaces standard
.clip()calls with conditional logic that uses the compatibility implementation for older Android versions - Adds helper functions for common UI patterns like list card styling
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| AboutScreenContent.kt | Replaces .clip() calls with .compatClip() for Material shapes |
| CompatClip.kt | Adds new compatibility clipping function using drawWithContent and clipPath |
| PlatformShapes.android.kt | Implements conditional clipping with API version check and helper functions |
| Multiple settings screens | Updates various screens to use new list card helper functions instead of direct clipping |
| Login screens | Removes software layer configuration that may have been related to rendering issues |
| Theme.kt | Adds outline variant colors for pure color mode |
| Other files | Minor improvements like keyboard options and UI refinements |
| this@drawWithContent.drawContent() | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This compatClip function is identical to the one in CompatClip.kt. The duplication should be removed by using the existing implementation from the shared component.
| } |
|
|
||
| @Composable | ||
| public fun Modifier.listCardContainer(): Modifier = | ||
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { |
There was a problem hiding this comment.
The API level check VERSION_CODES.Q (API 29) should be documented or use a constant to explain why this specific version is the threshold for clip compatibility.
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { | |
| if (Build.VERSION.SDK_INT >= CLIP_COMPATIBILITY_API_LEVEL) { |
No description provided.