Refactored the ErrorActivity to support edgeToEdge feature introduced in Android 15.

This commit is contained in:
MohitMaliFtechiz 2025-03-03 17:19:09 +05:30 committed by Kelson
parent 6fb8620057
commit cca03cc06e

View File

@ -27,7 +27,10 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
@ -51,7 +54,6 @@ import org.kiwix.kiwixmobile.core.utils.ComposeDimens.EIGHT_DP
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.SEVENTEEN_DP import org.kiwix.kiwixmobile.core.utils.ComposeDimens.SEVENTEEN_DP
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.SIXTEEN_DP import org.kiwix.kiwixmobile.core.utils.ComposeDimens.SIXTEEN_DP
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.SIXTY_DP import org.kiwix.kiwixmobile.core.utils.ComposeDimens.SIXTY_DP
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.THIRTY_TWO_DP
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.TWELVE_DP import org.kiwix.kiwixmobile.core.utils.ComposeDimens.TWELVE_DP
@Composable @Composable
@ -66,6 +68,8 @@ fun ErrorActivityScreen(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(colorResource(id = R.color.error_activity_background)) .background(colorResource(id = R.color.error_activity_background))
.systemBarsPadding()
.imePadding()
.padding(SIXTEEN_DP), .padding(SIXTEEN_DP),
horizontalAlignment = Alignment.CenterHorizontally horizontalAlignment = Alignment.CenterHorizontally
) { ) {
@ -105,7 +109,7 @@ fun ErrorActivityScreen(
Row( Row(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(bottom = THIRTY_TWO_DP), .navigationBarsPadding(),
horizontalArrangement = Arrangement.SpaceEvenly horizontalArrangement = Arrangement.SpaceEvenly
) { ) {
ComposeButton( ComposeButton(