Skip to content

Commit

Permalink
style: enable edge to edge
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed Apr 13, 2024
1 parent 1b0b794 commit 51316b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
3 changes: 2 additions & 1 deletion app/src/main/java/com/bnyro/clock/ui/AlarmActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.view.Window
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
Expand All @@ -24,7 +25,7 @@ class AlarmActivity : ComponentActivity() {
requestWindowFeature(Window.FEATURE_NO_TITLE)

window.addFlags(windowFlags)

enableEdgeToEdge()
setContent {
AlarmAlertScreen(
onDismiss = this@AlarmActivity::dismiss,
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/bnyro/clock/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import android.os.IBinder
import android.provider.AlarmClock
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.fillMaxSize
Expand Down Expand Up @@ -75,6 +76,7 @@ class MainActivity : ComponentActivity() {
) == it.route
}
}
enableEdgeToEdge()
setContent {
val settingsModel: SettingsModel = viewModel()

Expand Down
13 changes: 0 additions & 13 deletions app/src/main/java/com/bnyro/clock/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,15 @@ import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.unit.dp
import androidx.core.view.WindowCompat

val AmoledDarkColorScheme = darkColorScheme(
primary = Color(0xFF6836FF),
background = Color(0xFF000000),
onPrimary = Color(0xFFFFFFFF)
)

@Composable
fun ClockYouTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
Expand Down Expand Up @@ -57,9 +47,6 @@ fun ClockYouTheme(
SideEffect {
val activity = view.context as Activity
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
activity.window.statusBarColor = colorScheme.background.toArgb()
activity.window.navigationBarColor =
colorScheme.surfaceColorAtElevation(5.dp).toArgb()
val insetsController = WindowCompat.getInsetsController(
activity.window,
view
Expand Down

0 comments on commit 51316b5

Please sign in to comment.