feat: implement safe area insets for Android and add development tooling #182
Reference in New Issue
Block a user
Delete Branch "android-safe-area-insets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Technical changes:
- 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@@ -1187,0 +1323,4 @@# Validate assets include safe area supportnpm run assets:validate:android```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.
@@ -1696,0 +2065,4 @@1. Replace `env(safe-area-inset-*)` with the max() pattern2. Test on all target platforms3. Verify safe area behavior is consistentThis 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.
@trentlarson you're right: those weren't supposed to be there. I removed the misplaced documentation from BUILDING.md. (
validate:androiddocumentation was already included in a previous commit onmaster.)@@ -140,0 +138,4 @@"commitlint": {"extends": ["@commitlint/config-conventional"]The commitlint & husky pieces seem unrelated to this PR.
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-barwas retained.👍