Skip to content

Allow SafeArea to Capture the Bitmap - #36

Merged
maiatoday merged 3 commits into
gdg-berlin-android:mainfrom
maiatoday:work/better-safe-area
Sep 7, 2025
Merged

Allow SafeArea to Capture the Bitmap#36
maiatoday merged 3 commits into
gdg-berlin-android:mainfrom
maiatoday:work/better-safe-area

Conversation

@maiatoday

@maiatoday maiatoday commented Sep 5, 2025

Copy link
Copy Markdown
Collaborator

Make the SafeArea capture the bitmap. So that the demo Patch Composables can have an interactive part. See AndyA Demo which has a text field to specify the text.

This requires the annotation generated code to have parameters now to trigger the bitmap creation of the safe area.
Screenshot_20250905_224635

@maiatoday maiatoday self-assigned this Sep 5, 2025
@maiatoday
maiatoday marked this pull request as draft September 5, 2025 20:51
This change modifies the patchable composables and the `PatchableToBitmap` composable to handle bitmap capturing more directly.

Refactor PatchableBoundingBox composable

Refactor: Remove explicit `androidx.compose.ui.graphics.ImageBitmap` type
@maiatoday
maiatoday force-pushed the work/better-safe-area branch from 489e7f5 to cec7393 Compare September 5, 2025 21:00
@maiatoday
maiatoday marked this pull request as ready for review September 5, 2025 21:02
Spacer(modifier = Modifier.weight(1f))
}
}
TextField(value = name, onValueChange = { name = it })

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This makes this particular patch interactive so you can change the name on the patch. The part that will be converted is in the SafeArea. See the screenshot

Comment thread gradle.properties
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true No newline at end of file
android.nonTransitiveRClass=true
ksp.incremental=false

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this is the line that makes it always generate the PatchRegistry. Its a hack I know I know.

@mariobodemann mariobodemann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Amazing, looks easier and more straight forward than I imagined!

@maiatoday
maiatoday added this pull request to the merge queue Sep 7, 2025
Merged via the queue into gdg-berlin-android:main with commit 31b1757 Sep 7, 2025
1 check passed
@maiatoday
maiatoday deleted the work/better-safe-area branch September 21, 2025 17:02
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