Skip to content

Commit

Permalink
Documentation and reorder params
Browse files Browse the repository at this point in the history
  • Loading branch information
imashnake0 committed Feb 5, 2024
1 parent d34f6fb commit 2ab2ab0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ fun HomeScreen(
}
}
},
contentModifier = Modifier.padding(
top = LocalPaddings.current.large,
bottom = dimensionResource(R.dimen.navigation_bar_height)
),
content = { _ ->
rows.fastForEach { row ->
HomeRow(
Expand All @@ -175,7 +171,11 @@ fun HomeScreen(
}
)
}
}
},
contentModifier = Modifier.padding(
top = LocalPaddings.current.large,
bottom = dimensionResource(R.dimen.navigation_bar_height)
)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ fun MediaPage(
modifier = bannerModifier.bannerParallax(scrollState)
)
},
contentModifier = Modifier.padding(top = LocalPaddings.current.medium),
content = {
MediaDetails(
title = media.title.orEmpty(),
Expand Down Expand Up @@ -169,7 +168,8 @@ fun MediaPage(
.landscapeCutoutPadding()
)
}
}
},
contentModifier = Modifier.padding(top = LocalPaddings.current.medium)
)

// TODO: https://developer.android.com/jetpack/compose/animation/quick-guide#concurrent-animations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,31 @@ import androidx.compose.ui.unit.Dp
import com.imashnake.animite.core.R
import com.imashnake.animite.core.ui.LocalPaddings

/**
* Most screens and pages follow a banner-style layout in Animite.
*
* @param banner A banner [Composable] that is usually an image with
* [com.imashnake.animite.core.extensions.bannerParallax] and other components.
* @param content The content that appears in a [Column] below the banner.
* @param modifier Modifier for [BannerLayout].
* @param bannerHeight The height of the banner in [Dp]s.
* @param bannerModifier Modifier for [banner]. Use this if a [Composable] in [banner] should have
* the dimensions of the banner.
* @param contentModifier Modifier for [content].
*/
@Composable
fun BannerLayout(
banner: @Composable (Modifier) -> Unit,
content: @Composable (bannerHeight: Dp) -> Unit,
modifier: Modifier = Modifier,
bannerHeight: Dp = dimensionResource(R.dimen.banner_height),
bannerModifier: Modifier = Modifier
.height(bannerHeight)
.fillMaxWidth(),
contentModifier: Modifier = Modifier,
bannerHeight: Dp = dimensionResource(R.dimen.banner_height)
) {
Box(modifier) {
banner(
Modifier
.height(bannerHeight)
.fillMaxWidth()
)
banner(bannerModifier)

Column(
modifier = Modifier
Expand Down

0 comments on commit 2ab2ab0

Please sign in to comment.