Skip to content

fix clip now working when android api < 29#1167

Merged
Tlaster merged 1 commit intomasterfrom
bugfix/ui_clip
Aug 12, 2025
Merged

fix clip now working when android api < 29#1167
Tlaster merged 1 commit intomasterfrom
bugfix/ui_clip

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Aug 12, 2025

No description provided.

@Tlaster Tlaster requested a review from Copilot August 12, 2025 07:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 compatClip function 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()
}
}
}
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
}

Copilot uses AI. Check for mistakes.

@Composable
public fun Modifier.listCardContainer(): Modifier =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
if (Build.VERSION.SDK_INT >= CLIP_COMPATIBILITY_API_LEVEL) {

Copilot uses AI. Check for mistakes.
@Tlaster Tlaster enabled auto-merge August 12, 2025 07:29
@Tlaster Tlaster merged commit 77f17cd into master Aug 12, 2025
5 checks passed
@Tlaster Tlaster deleted the bugfix/ui_clip branch August 12, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants