setRespectEdgeToEdgeLayout
Sets whether modal in-app messages should respect edge-to-edge layout in modern Android versions.
Edge-to-edge layout extends content to the edges of the screen, including areas behind the status bar and navigation bar. When enabled, modals integrate better with modern Android design guidelines and provide more immersive experiences.
API Level Considerations: This setting is particularly relevant for API 35+ where edge-to-edge layout is enforced by default. For API 34 and below, consider using setStatusBarCovered for similar visual control. Example:
// Modern edge-to-edge layout for API 35+ (uses defaults: FULLSCREEN + edge-to-edge)
ModalRichmediaConfig modernConfig = new ModalRichmediaConfig();
// Legacy approach for API 34 and below using statusBarCovered
ModalRichmediaConfig legacyConfig = new ModalRichmediaConfig()
.setViewPosition(ModalRichMediaViewPosition.FULLSCREEN)
.setStatusBarCovered(true)
.setRespectEdgeToEdgeLayout(false);
// Adaptive approach - works across API levels (uses defaults)
ModalRichmediaConfig adaptiveConfig = new ModalRichmediaConfig();
Content copied to clipboard
Return
this configuration instance for method chaining
Parameters
respectEdgeToEdgeLayout
true to enable edge-to-edge layout, false to use traditional layout, defaults to true if not specified