惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
J
Java Code Geeks
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
DataBreaches.Net
腾讯CDC
GbyAI
GbyAI
I
InfoQ
博客园 - Franky
G
Google Developers Blog
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Vercel News
Vercel News
博客园_首页
MyScale Blog
MyScale Blog
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
V
V2EX
T
The Blog of Author Tim Ferriss
M
MIT News - Artificial intelligence
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog

Inside Nutrient

A guide to the invisible work behind documents Introducing Nutrient Documents for Salesforce: Native document generation and signing Document AI vs. traditional OCR: Choosing between OCR, AI, and hybrid pipelines PDF SDK compliance and security evaluation checklist for enterprise teams (2026) Invariant Corp replaces paper processes with Nutrient Workflow and scales without limits What is process mapping? A complete guide Nutrient vs. Conga Composer for Salesforce document generation (2026) Document routing: How to automate document distribution The CTO’s AI playbook: Why accountability architecture beats orchestration Compliance workflow automation: Why built-in compliance is table stakes Workflow diagrams: Examples, symbols, and how to build one that actually runs Digital forms: Replace paper forms with automated workflows Approval workflow software: How to automate approvals Why document-centric automation is different The CEO’s AI playbook: Why decision architecture beats model selection Nutrient SDK product updates for Q1 2026 PDF redaction verification: How to prove sensitive data is permanently removed What is a VPAT? The complete guide to accessibility conformance reports What is PDF/UA? The accessible PDF standard explained Salesforce eSignatures: Generate, sign, and track documents in one flow Online document viewer: Options, tradeoffs, and how to embed one Document viewer for web apps: React, Vue, Angular (2026) Best document viewers in 2026: A buyer’s guide How to edit a PDF in Python: Add text, images, and annotations Nutrient advances Workflow platform with agentic AI for enterprise-grade speed and consistency in document-heavy operations How to create a Salesforce quote template from opportunity data The business case for accessibility: Five ways it drives enterprise value Python PDF library comparison (2026): 7 libraries for developers Why your AI agent hallucinates PDF table data PDF.js limitations: When to upgrade to a commercial PDF SDK
Edge-to-edge support on Android 15+
Rafał Wesołowski · 2025-10-22 · via Inside Nutrient

Table of contents

    Edge-to-edge support on Android 15+

    Edge-to-edge(opens in a new tab) enforcement ensures your app content fills the entire screen of a device. Starting with Android 15 (API level 35), this behavior is enabled by default for all apps.

    Implications and potential issues

    With edge-to-edge enabled, app content often extends beneath the status and navigation bars. This can make parts of your user interface (UI) difficult to read or interact with, since elements may be obscured by system components.

    Proper handling is crucial to ensure your app content is fully visible and interactive.

    Goal of proper edge-to-edge handling

    The goal is to ensure all app content is fully visible and interactive. This article will cover handling edge-to-edge behavior using both Jetpack Compose and traditional XML layouts.

    Compose approach

    The following snippet demonstrates a common problem in Compose:

    EdgeToEdgeTestTheme {

    LazyColumn {

    items(100) {

    Text(

    text = "Item number $it",

    modifier = Modifier

    .fillMaxWidth()

    .padding(16.dp)

    )

    }

    }

    }

    The result looks like this.

    Result

    Here, the list content scrolls beneath the status and navigation bars.

    Solution with Scaffold

    A simple solution is to use Scaffold, which automatically handles system insets. The LazyColumn can then take advantage of the paddingValues provided by Scaffold:

    EdgeToEdgeTestTheme {

    Scaffold { paddingValues ->

    LazyColumn(

    modifier = Modifier.padding(paddingValues)

    ) {

    items(100) {

    Text(

    text = "Item number $it",

    modifier = Modifier

    .fillMaxWidth()

    .padding(16.dp)

    )

    }

    }

    }

    }

    Now the content is drawn properly.

    Result

    This approach works with all composables — not just LazyColumn — making it flexible for any UI layout. The content is fully visible and remains interactable at all times.

    Handling cases without Scaffold

    If you’re not using Scaffold, content may still extend beneath system bars:

    EdgeToEdgeTestTheme {

    Text(

    modifier = Modifier

    .fillMaxSize()

    .background(Color.LightGray),

    text = LoremIpsum(words = 1000).values.joinToString { it }

    )

    }

    Result

    To fix this, apply Modifier.safeContentPadding():

    EdgeToEdgeTestTheme {

    Text(

    modifier = Modifier

    .fillMaxSize()

    .background(Color.LightGray)

    .safeContentPadding(),

    text = LoremIpsum(words = 1000).values.joinToString { it }

    )

    }

    The content is now fully visible.

    Result

    XML approach

    Here’s a basic example showing the issue in XML:

    override fun onCreate(savedInstanceState: Bundle?) {

    super.onCreate(savedInstanceState)

    enableEdgeToEdge()

    setContentView(R.layout.activity_main)

    val textView = findViewById<TextView>(R.id.textView)

    textView.text = LoremIpsum(words = 1000).values.joinToString { it }

    }

    activity_main.xml:

    <?xml version="1.0" encoding="utf-8"?>

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:orientation="vertical"

    android:layout_width="match_parent"

    android:layout_height="match_parent">

    <TextView

    android:id="@+id/textView"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    android:background="@android:color/background_light"

    android:textColor="@color/black" />

    </LinearLayout>

    The content will be drawn beneath the system bars.

    Result

    Applying window insets

    To fix the problem, programmatically apply window insets:

    override fun onCreate(savedInstanceState: Bundle?) {

    super.onCreate(savedInstanceState)

    enableEdgeToEdge()

    setContentView(R.layout.activity_main)

    val textView = findViewById<TextView>(R.id.textView)

    textView.text = LoremIpsum(words = 1000).values.joinToString { it }

    ViewCompat.setOnApplyWindowInsetsListener(textView) { v, windowInsets ->

    // Here you need to determine which specific insets you want to combine with your `TextView` insets.

    // Choosing `WindowInsetsCompat.Type.systemBars()` would mean both status bar and navigation bar insets.

    val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())

    v.updateLayoutParams<ViewGroup.MarginLayoutParams> {

    leftMargin = insets.left

    topMargin = insets.top

    bottomMargin = insets.bottom

    rightMargin = insets.right

    }

    // Return `CONSUMED` if you don't want the window insets to keep passing

    // down to descendant views. Otherwise, just return `windowInsets

    WindowInsetsCompat.CONSUMED`.

    }

    }

    Now the content is fully visible and interactive.

    Result

    Conclusion

    This post explored approaches using both Compose and XML to handle edge-to-edge behavior on Android 15+. These methods ensure your app content remains fully visible and interactive, keeping system bars from overlapping any UI elements.

    With these strategies, you can confidently adopt edge-to-edge layouts while maintaining usability and accessibility.

    Explore related topics

    Try for free Ready to get started?

    Related SDK articles

    Explore more