generated from AND-SOPT-ANDROID/and-sopt-android-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
706497c
commit c22f361
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
app/src/main/java/org/sopt/and/presentation/component/MovieListRow.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package org.sopt.and.presentation.component | ||
|
||
import androidx.compose.foundation.Image | ||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.width | ||
import androidx.compose.foundation.lazy.LazyRow | ||
import androidx.compose.foundation.shape.RoundedCornerShape | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.draw.clip | ||
import androidx.compose.ui.layout.ContentScale | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.unit.dp | ||
|
||
// 홈화면 영화 LazyRow | ||
@Composable | ||
fun MovieListRow( | ||
movieList: List<Int>, // 영화 이미지의 리소스 ID 리스트 | ||
modifier: Modifier = Modifier | ||
) { | ||
LazyRow ( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.height(200.dp) | ||
.padding(horizontal = 8.dp), | ||
horizontalArrangement = Arrangement.spacedBy(8.dp) | ||
) { | ||
items(movieList.size) { index -> | ||
Image( | ||
painter = painterResource(movieList[index]), | ||
contentDescription = "배너", | ||
contentScale = ContentScale.Crop, | ||
modifier = Modifier | ||
.width(140.dp) | ||
.height(200.dp) | ||
.clip(RoundedCornerShape(12.dp)) | ||
) | ||
} | ||
} | ||
} |