Skip to content

Commit 2ecfced

Browse files
committed
showcase change.
1 parent 102c685 commit 2ecfced

File tree

1 file changed

+12
-8
lines changed
  • app/src/main/java/com/commandiron/expandablehorizontalpagercompose

1 file changed

+12
-8
lines changed

app/src/main/java/com/commandiron/expandablehorizontalpagercompose/MainActivity.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ class MainActivity : ComponentActivity() {
5252
) {
5353
ExpandableHorizontalPager(
5454
count = films.size,
55-
initialHorizontalPadding = 80.dp,
55+
initialHorizontalPadding = 64.dp,
56+
initialWidth = 240.dp,
5657
targetWidth = maxWidth,
5758
mainContent = { page ->
5859
AsyncImage(
@@ -79,9 +80,10 @@ class MainActivity : ComponentActivity() {
7980
)
8081
},
8182
hiddenContent = { page ->
82-
Column(Modifier.padding(16.dp)) {
83-
HiddenContent(page)
84-
}
83+
HiddenContent(
84+
title = films[page].title,
85+
overview = films[page].overview
86+
)
8587
}
8688
)
8789
}
@@ -139,10 +141,12 @@ fun OverMainContent(
139141
}
140142

141143
@Composable
142-
fun HiddenContent(page: Int) {
143-
Text(text = films[page].title)
144-
Spacer(Modifier.height(8.dp))
145-
Text(text = films[page].overview)
144+
fun HiddenContent(title: String, overview: String) {
145+
Column(Modifier.padding(16.dp)) {
146+
Text(text = title)
147+
Spacer(Modifier.height(8.dp))
148+
Text(text = overview)
149+
}
146150
}
147151

148152
data class Film(

0 commit comments

Comments
 (0)