@@ -26,6 +26,7 @@ import androidx.compose.foundation.clickable
2626import androidx.compose.foundation.layout.Box
2727import androidx.compose.foundation.layout.Column
2828import androidx.compose.foundation.layout.Row
29+ import androidx.compose.foundation.layout.fillMaxHeight
2930import androidx.compose.foundation.layout.fillMaxWidth
3031import androidx.compose.foundation.layout.height
3132import androidx.compose.foundation.layout.padding
@@ -86,19 +87,37 @@ fun CatsStateDispatcher(uiState: CatsScreenState, selectedCat: CatModel?, onCatS
8687
8788@Composable
8889fun LoadingCatsContent () {
89- Box {
90+ Box (Modifier .fillMaxWidth().fillMaxHeight(.6f ),
91+ contentAlignment = Alignment .Center ) {
9092 CircularProgressIndicator (Modifier .align(Alignment .Center ))
9193 }
9294}
9395
9496@Composable
9597fun ErrorCatsContent (cause : Exception ) {
96- Text (stringResource(R .string.cats_list_error, cause.message ? : " " ))
98+ Box (Modifier
99+ .fillMaxWidth()
100+ .fillMaxHeight(.6f )
101+ .padding(8 .dp)
102+ ,
103+ contentAlignment = Alignment .Center ) {
104+ Text (
105+ stringResource(R .string.cats_list_error, cause.message ? : " " ),
106+ color = MaterialTheme .colors.error,
107+ style = typography.body1,
108+ )
109+ }
97110}
98111
99112@Composable
100113fun EmptyCatsContent () {
101- Text (stringResource(R .string.cats_list_empty))
114+ Box (Modifier .fillMaxWidth().fillMaxHeight(.6f ),
115+ contentAlignment = Alignment .Center ) {
116+ Text (
117+ stringResource(R .string.cats_list_empty),
118+ style = typography.body1,
119+ )
120+ }
102121}
103122
104123@Composable
0 commit comments