-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #747 from theimpulson/a15
Support edge to edge
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/stevesoltys/seedvault/extensions/Activity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 The Calyx Institute | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package com.stevesoltys.seedvault.extensions | ||
|
||
import android.app.Activity | ||
import androidx.core.view.ViewCompat | ||
import androidx.core.view.WindowCompat | ||
import androidx.core.view.WindowInsetsCompat | ||
|
||
fun Activity.setupEdgeToEdge() { | ||
val rootView = window.decorView.rootView | ||
WindowCompat.setDecorFitsSystemWindows(window, false) | ||
ViewCompat.setOnApplyWindowInsetsListener(rootView) { v, windowInsets -> | ||
val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) | ||
v.setPadding(insets.left, insets.top, insets.right, insets.bottom) | ||
WindowInsetsCompat.CONSUMED | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters