ModalRichmediaConfig
Configuration class for customizing the presentation and behavior of modal in-app messages.
This class allows you to control how modal in-app messages are displayed, including their position, animations, swipe gestures, and visual layout. The configuration can be applied globally using setDefaultRichMediaConfig or specified for individual messages.
Key Features:
- Position Control - TOP, CENTER, BOTTOM, or FULLSCREEN presentation
- Custom Animations - Fade, slide, or drop animations for show/hide
- Swipe Gestures - Enable swipe-to-dismiss in any direction
- Layout Options - Control window width and status bar behavior
- Edge-to-Edge Support - Modern Android layout compatibility
Basic Usage:
// Configure modal presentation globally
ModalRichmediaConfig config = new ModalRichmediaConfig()
.setAnimationDuration(500);
// Apply global configuration
RichMediaManager.setDefaultRichMediaConfig(config);
Content copied to clipboard
Advanced Configuration:
// E-commerce app with bottom-positioned modals and swipe gestures
Set<ModalRichMediaSwipeGesture> swipeGestures = new HashSet<>();
swipeGestures.add(ModalRichMediaSwipeGesture.DOWN);
swipeGestures.add(ModalRichMediaSwipeGesture.RIGHT);
ModalRichmediaConfig ecommerceConfig = new ModalRichmediaConfig()
.setViewPosition(ModalRichMediaViewPosition.BOTTOM)
.setSwipeGestures(swipeGestures)
.setPresentAnimationType(ModalRichMediaPresentAnimationType.SLIDE_UP)
.setDismissAnimationType(ModalRichMediaDismissAnimationType.SLIDE_DOWN);
RichMediaManager.setDefaultRichMediaConfig(ecommerceConfig);
Content copied to clipboard
Default Values:
When configuration values are not specified (null), the following system defaults are used:
- View Position:FULLSCREEN - modals cover the entire screen
- Present Animation:FADE_IN - smooth fade-in presentation
- Dismiss Animation:FADE_OUT - smooth fade-out dismissal
- Window Width:FULL_SCREEN - modals span full screen width
- Animation Duration: 1000ms - balanced speed for smooth animations
- Swipe Gestures: Empty set - no swipe-to-dismiss enabled by default
- Status Bar Covered: false - respects status bar area (applies to API 34 and below where edge-to-edge behavior is not enforced by default)
- Edge-to-Edge Layout: true - uses modern edge-to-edge layout by default (applies to API 35+ where edge-to-edge is the standard)
Important Notes:
- All configuration properties are optional - null values will use system defaults
- Method chaining is supported for fluent configuration
- Global configuration affects all subsequent in-app messages
- Individual messages can override global settings via server-side configuration
- Status bar and edge-to-edge settings require Android API level considerations