Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reply is laid out edge-to-edge in 2 & 3-button navigation mode #1261

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,7 +19,6 @@ package com.example.reply.ui
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.compose.material3.windowsizeclass.ExperimentalMaterial3WindowSizeClassApi
import androidx.compose.material3.windowsizeclass.WindowSizeClass
Expand All @@ -40,7 +39,6 @@ class MainActivity : ComponentActivity() {

@OptIn(ExperimentalMaterial3WindowSizeClassApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)

setContent {
Expand Down
11 changes: 11 additions & 0 deletions Reply/app/src/main/java/com/example/reply/ui/theme/Theme.kt
Expand Up @@ -16,7 +16,11 @@

package com.example.reply.ui.theme

import android.graphics.Color
import android.os.Build
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
Expand Down Expand Up @@ -91,6 +95,13 @@ fun ReplyTheme(
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val transparent = Color.TRANSPARENT
(LocalContext.current as ComponentActivity).enableEdgeToEdge(
navigationBarStyle = if (darkTheme)
SystemBarStyle.dark(transparent)
else
SystemBarStyle.light(transparent, transparent)
)
val replyColorScheme = when {
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
val context = LocalContext.current
Expand Down