feat: implement safe area insets for Android and add development tooling #182

Merged
jose merged 7 commits from android-safe-area-insets into master 2 months ago
jose commented 2 months ago
Owner
  • Add @capacitor/status-bar dependency for safe area detection
  • Implement SafeAreaPlugin for Android with proper inset calculation
  • Create safeAreaInset.js utility for CSS custom property injection
  • Update Android manifest and build configuration for plugin
  • Integrate safe area handling across Vue components and views
  • Update iOS Podfile and Android gradle configurations
  • Add commitlint and husky for commit message validation

Technical changes:

  • SafeAreaPlugin uses WindowInsets API for Android R+ devices
  • Fallback detection for navigation bar and gesture bar heights
  • CSS custom properties: --safe-area-inset-{top,bottom,left,right}
  • Platform-specific detection (Android WebView only)
  • StatusBar plugin integration for top inset calculation
- Add @capacitor/status-bar dependency for safe area detection - Implement SafeAreaPlugin for Android with proper inset calculation - Create safeAreaInset.js utility for CSS custom property injection - Update Android manifest and build configuration for plugin - Integrate safe area handling across Vue components and views - Update iOS Podfile and Android gradle configurations - Add commitlint and husky for commit message validation Technical changes: - SafeAreaPlugin uses WindowInsets API for Android R+ devices - Fallback detection for navigation bar and gesture bar heights - CSS custom properties: --safe-area-inset-{top,bottom,left,right} - Platform-specific detection (Android WebView only) - StatusBar plugin integration for top inset calculation
jose added 2 commits 2 months ago
4ba58145d0 feat: implement safe area insets for Android and add development tooling
trentlarson reviewed 2 months ago
BUILDING.md Outdated
# Validate assets include safe area support
npm run assets:validate:android
```
Poster
Owner

This commentary doesn't seem to belong with "build" instructions. Things like "build:android:dev" are already in the build instructions. The "assets:validate:android" is new, so that's worth listing with all the other build commands, but it doesn't seem useful to other people to list all the work that has gone into fixing this problem.

This commentary doesn't seem to belong with "build" instructions. Things like "build:android:dev" are already in the build instructions. The "assets:validate:android" is new, so that's worth listing with all the other build commands, but it doesn't seem useful to other people to list all the work that has gone into fixing this problem.
trentlarson reviewed 2 months ago
BUILDING.md Outdated
1. Replace `env(safe-area-inset-*)` with the max() pattern
2. Test on all target platforms
3. Verify safe area behavior is consistent
Poster
Owner

This commentary especially seems only useful for historical purposes... not for building, and not even to help other people in the future unless it's for your own reference. If you want to keep this historical change log, let's make a folder under "doc"... something like "history" or "changelog", something that separates it from the documentation that will help future developers who don't need to know the whole history.

This commentary especially seems only useful for historical purposes... not for building, and not even to help other people in the future unless it's for your own reference. If you want to keep this historical change log, let's make a folder under "doc"... something like "history" or "changelog", something that separates it from the documentation that will help future developers who don't need to know the whole history.
jose added 1 commit 2 months ago
Poster
Owner

@trentlarson you're right: those weren't supposed to be there. I removed the misplaced documentation from BUILDING.md. (validate:android documentation was already included in a previous commit on master.)

@trentlarson you're right: those weren't supposed to be there. I removed the misplaced documentation from BUILDING.md. (`validate:android` documentation was already included in a previous commit on `master`.)
trentlarson reviewed 2 months ago
package.json Outdated
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
Poster
Owner

The commitlint & husky pieces seem unrelated to this PR.

The commitlint & husky pieces seem unrelated to this PR.
jose commented 2 months ago
Poster
Owner

I reverted the changes to package.json; Cursor linted it and formatted + reordered some things around, but no actual changes were made to those packages. I made sure capacitor-status-bar was retained.

I reverted the changes to package.json; Cursor linted it and formatted + reordered some things around, but no actual changes were made to those packages. I made sure `capacitor-status-bar` was retained.
jose added 1 commit 2 months ago
Owner

👍

👍
jose added 1 commit 2 months ago
jose added 1 commit 2 months ago
jose added 1 commit 2 months ago
jose merged commit 3969167d92 into master 2 months ago
The pull request has been merged as 3969167d92.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.