Skip to content
Permalink
Browse files

@composable functions with a return type shouldn't start with a upper…

…case
  • Loading branch information
IVIanuu committed Mar 10, 2020
1 parent 8a8116f commit ac68116e1f5ed2286a721439cf1ef0900b0d9786
@@ -28,7 +28,7 @@ import androidx.ui.unit.toRect
import kotlin.math.pow

@Composable
fun GradientScrimDrawModifier(baseColor: Color, numStops: Int = 16): DrawModifier {
fun gradientScrimDrawModifier(baseColor: Color, numStops: Int = 16): DrawModifier {
val paint = remember { Paint() }

return draw { canvas, parentSize ->
@@ -104,7 +104,7 @@ fun LoadNetworkImageWithCrossfade(
) { transitionState ->
val image = if (childSize.width > IntPx.Zero && childSize.height > IntPx.Zero) {
// If we have a size, we can now load the image using those bounds...
LoadImage(data, childSize) {
loadImage(data, childSize) {
// Once loaded, update the load state
imgLoadState = ImageLoadState.Loaded
}
@@ -141,7 +141,7 @@ fun LoadNetworkImage(
OnChildPositioned(onPositioned = { childSize = it.size }) {
val image = if (childSize.width > IntPx.Zero && childSize.height > IntPx.Zero) {
// If we have a size, we can now load the image using those bounds...
LoadImage(data, childSize)
loadImage(data, childSize)
} else null

Box(modifier = modifier +
@@ -177,10 +177,10 @@ internal class AndroidColorMatrixImagePainter(
}

/**
* A simple [LoadImage] composable, which loads [data].
* A simple [loadImage] composable, which loads [data].
*/
@Composable
fun LoadImage(
fun loadImage(
data: Any,
pxSize: IntPxSize,
onLoad: () -> Unit = {}
@@ -74,7 +74,7 @@ import androidx.ui.unit.dp
import androidx.ui.unit.toOffset
import androidx.ui.unit.toRect
import app.tivi.animation.invoke
import app.tivi.common.compose.GradientScrimDrawModifier
import app.tivi.common.compose.gradientScrimDrawModifier
import app.tivi.common.compose.InsetsAmbient
import app.tivi.common.compose.InsetsHolder
import app.tivi.common.compose.LoadNetworkImageWithCrossfade
@@ -213,7 +213,7 @@ private fun Backdrop(season: Season, episode: Episode) {
}

Box(modifier = LayoutGravity.Stretch +
GradientScrimDrawModifier(baseColor = Color.Black))
gradientScrimDrawModifier(baseColor = Color.Black))

Column(modifier = LayoutPadding(all = 16.dp) + LayoutGravity.BottomStart) {
val type = MaterialTheme.typography()

0 comments on commit ac68116

Please sign in to comment.
You can’t perform that action at this time.