Skip to content

bug: edge-to-edge support for Android SDK 35 #83

@JasonAsmk

Description

@JasonAsmk

Plugin version:
^7.0.0

Platform(s):
Android

Current behavior:
Open a simple photo with the share and close buttons enabled. On Android SDK 35 or on edge-to-edge enabled Android the buttons overlap with the statusbar, being unclickable. This probably could apply to other layouts in this plugin as well.

await PhotoViewer.show({ images: [{ url, title: 'Photo' }], mode: 'one', startFrom: 0, });

Expected behavior:
Share and close buttons render below the statusbar.

Steps to reproduce:
Use SDK 35 in Android Studio ( or enable edge-to-edge) and open an image with the snippet above.

Related code:
Somewhere around here: https://github.com/capacitor-community/photoviewer/blob/main/android/src/main/java/com/getcapacitor/community/media/photoviewer/PhotoViewer.java#L91
We should get insets and adjust top and bottom padding.

Other information:
Official docs:
https://developer.android.com/develop/ui/views/layout/edge-to-edge

Temporary fork that works for my case:
JasonAsmk@bccb747

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 7.2.0
  @capacitor/core: 7.2.0
  @capacitor/android: 7.2.0
  @capacitor/ios: 7.2.0

Installed Dependencies:

  @capacitor/cli: 7.2.0
  @capacitor/core: 7.2.0
  @capacitor/android: 7.2.0
  @capacitor/ios: 7.2.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions