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

View file

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