Android - Edge-to-Edge Display
Edge-to-edge display allows your app to render content behind the system bars (status bar and navigation bar), creating a more immersive user experience that utilizes the full screen real estate.
theme that will not inherit Q2 Mobile App's styling. This means your activity will lose the consistent Q2 look and feel, including colors, typography, and other design elements. We strongly discourage enabling this feature unless absolutely necessary. This feature will be enabled in future releases, but it is not yet supported.
Current Status
Edge-to-edge display is disabled by default in the Q2 Mobile App theme for the current release. However, Q2 provides partners and financial institutions the flexibility to enable this feature within their Mobile SDK activities by overriding the theme configuration.
configuration.
Enabling Edge-to-Edge in Your Activity
won't inherit Q2 Mobile App's styling. Your activity will lose the standard Q2 visual design.
To enable edge-to-edge display, you must create a custom theme that doesn't opt out of edge-to-edge enforcement, then apply it to your activity.
Implementation
- Create a custom theme in your library:
<!-- In your module's styles.xml -->
<style name="YourModule.Theme" parent="Theme.Material3.DayNight">
<!-- Note: android:windowOptOutEdgeToEdgeEnforcement is NOT set (defaults to false) -->
<!-- You'll need to manually add any styling you want -->
</style>
- Apply the theme to your activity:
<!-- In your AndroidManifest.xml -->
<activity
android:name=".YourActivity"
android:theme="@style/YourModule.Theme"
... />
- Enable edge-to-edge in your activity:
class YourActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Enable edge-to-edge display
enableEdgeToEdge()
setContentView(R.layout.activity_your_layout)
}
}
Considerations
When enabling edge-to-edge display, keep in mind:
- System Bar Overlays: Content may be drawn behind system bars
- Inset Handling: You'll need to handle window insets to prevent content from being obscured
- Layout Adjustments: UI elements may need padding adjustments to account for system bars
- Testing: Test across different device configurations and Android versions
Future Changes
The default edge-to-edge behavior may change in upcoming releases. We recommend:
- Monitoring release notes for theme changes
- Testing your implementation with new releases
- Being prepared to adjust your override if the default behavior changes
ensure your content remains accessible and properly positioned.