From 477520440353cb62c8431f8c9d018ab074414e94 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UIQTHKE\\User" Date: Wed, 25 May 2022 11:26:45 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A1=9C=EB=94=A9=EA=B3=BC?= =?UTF-8?q?=EC=A0=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 이미지 로드전에 텍스트가 나오는 현상 수정 CircularProgressIndicator 가운데로 이동 --- .../search/components/LoadMainImage.kt | 77 ++++++++++--------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/com/example/todo/airbnb/presentation/search/components/LoadMainImage.kt b/app/src/main/java/com/example/todo/airbnb/presentation/search/components/LoadMainImage.kt index c282f9f29..f0f8137c4 100644 --- a/app/src/main/java/com/example/todo/airbnb/presentation/search/components/LoadMainImage.kt +++ b/app/src/main/java/com/example/todo/airbnb/presentation/search/components/LoadMainImage.kt @@ -41,7 +41,9 @@ fun LoadMainImage() { contentScale = ContentScale.FillBounds ) if (painterState is ImagePainter.State.Loading) { - CircularProgressIndicator() + CircularProgressIndicator( + modifier = Modifier.align(Alignment.Center) + ) } else if (painterState is ImagePainter.State.Error) { Image( painter = painterResource(id = R.drawable.ic_error), @@ -49,45 +51,46 @@ fun LoadMainImage() { modifier = Modifier.fillMaxSize(), contentScale = ContentScale.FillBounds ) - } - Text( - text = "슬기로운\n자연생활", - modifier = Modifier - .padding(start = 16.dp, bottom = 279.dp, top = 32.dp, end = 90.dp) - .height(96.dp) - .width(254.dp), - style = MaterialTheme.typography.h4, - lineHeight = 48.sp, - color = Color(0xff010101) - ) - Text( - text = "에어비앤비가 엄선한\n위시리스트를 만나보세요", - modifier = Modifier - .padding(start = 16.dp, bottom = 225.dp, top = 136.dp, end = 90.dp) - .height(46.dp) - .width(254.dp), - style = MaterialTheme.typography.body1, - lineHeight = 23.sp, - color = Color(0xff010101), - ) - Box( - modifier = Modifier - .padding(start = 16.dp, bottom = 165.dp, top = 206.dp, end = 90.dp) - .clip(RoundedCornerShape(10.dp)) // padding 이후, height,width 이전에 써줘야함 - .height(36.dp) - .width(154.dp) - .background(Color(0xff333333)), - ) { + } else if (painterState is ImagePainter.State.Success) { Text( - text = "여행\r아이디어\r얻기", - style = MaterialTheme.typography.button, + text = "슬기로운\n자연생활", modifier = Modifier - .padding(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 8.dp) - .height(20.dp) - .width(122.dp), - lineHeight = 20.sp, - color = Color(0xffffffff), + .padding(start = 16.dp, bottom = 279.dp, top = 32.dp, end = 90.dp) + .height(96.dp) + .width(254.dp), + style = MaterialTheme.typography.h4, + lineHeight = 48.sp, + color = Color(0xff010101) ) + Text( + text = "에어비앤비가 엄선한\n위시리스트를 만나보세요", + modifier = Modifier + .padding(start = 16.dp, bottom = 225.dp, top = 136.dp, end = 90.dp) + .height(46.dp) + .width(254.dp), + style = MaterialTheme.typography.body1, + lineHeight = 23.sp, + color = Color(0xff010101), + ) + Box( + modifier = Modifier + .padding(start = 16.dp, bottom = 165.dp, top = 206.dp, end = 90.dp) + .clip(RoundedCornerShape(10.dp)) + .height(36.dp) + .width(154.dp) + .background(Color(0xff333333)), + ) { + Text( + text = "여행 아이디어 얻기", + style = MaterialTheme.typography.button, + modifier = Modifier + .padding(start = 16.dp, end = 16.dp, top = 8.dp, bottom = 8.dp) + .height(20.dp) + .width(122.dp), + lineHeight = 20.sp, + color = Color(0xffffffff), + ) + } } } } \ No newline at end of file