Tweak Crash activity (#8229)

- Scroll entire content body
- Edge2Edge
This commit is contained in:
Andreas 2022-10-18 02:38:05 +02:00 committed by GitHub
parent ea33f8dba5
commit fed914827a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -4,9 +4,13 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
@ -42,11 +46,13 @@ fun CrashScreen(
val scope = rememberCoroutineScope()
val context = LocalContext.current
Scaffold(
contentWindowInsets = WindowInsets.systemBars,
bottomBar = {
val strokeWidth = Dp.Hairline
val borderColor = MaterialTheme.colorScheme.outline
Column(
modifier = Modifier
.background(MaterialTheme.colorScheme.surface)
.drawBehind {
drawLine(
borderColor,
@ -55,6 +61,7 @@ fun CrashScreen(
strokeWidth.value,
)
}
.padding(WindowInsets.navigationBars.asPaddingValues())
.padding(horizontal = horizontalPadding, vertical = verticalPadding),
verticalArrangement = Arrangement.spacedBy(verticalPadding),
) {
@ -79,10 +86,10 @@ fun CrashScreen(
) { paddingValues ->
Column(
modifier = Modifier
.verticalScroll(rememberScrollState())
.padding(paddingValues)
.padding(top = 56.dp)
.padding(horizontal = horizontalPadding)
.verticalScroll(rememberScrollState()),
.padding(horizontal = horizontalPadding),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(

View File

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.crash
import android.content.Intent
import android.os.Bundle
import androidx.core.view.WindowCompat
import eu.kanade.presentation.crash.CrashScreen
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
import eu.kanade.tachiyomi.ui.main.MainActivity
@ -11,6 +12,9 @@ class CrashActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
val exception = GlobalExceptionHandler.getThrowableFromIntent(intent)
setComposeContent {
CrashScreen(