Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-edge-to-edge-decor-fits-system-windows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@capawesome/capacitor-android-edge-to-edge-support": patch
---

fix(android-edge-to-edge-support): opt into edge-to-edge on all API levels
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import androidx.annotation.Nullable;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import com.getcapacitor.Logger;
import java.lang.reflect.Constructor;
Expand Down Expand Up @@ -42,6 +43,12 @@ public EdgeToEdge(@NonNull EdgeToEdgePlugin plugin, @NonNull EdgeToEdgeConfig co
}

public void enable() {
// Opt into edge-to-edge layout so the DecorView stops auto-consuming system bar
// insets as padding. Without this, inset listeners set by other plugins (notably
// @capacitor/keyboard >= 8.0.2) can perturb the inset dispatch chain and make the
// overlay views end up in the wrong place or with zero height. On Android 15+
// this is already enforced by the platform.
WindowCompat.setDecorFitsSystemWindows(plugin.getActivity().getWindow(), false);
// Create color overlays if they don't exist
createColorOverlays();
// Restore previously set colors
Expand Down
Loading