fade
fun PlaceholderHighlight.Companion.fade(animationSpec: InfiniteRepeatableSpec<Float> = PlaceholderDefaults.fadeAnimationSpec): PlaceholderHighlight(source)
Creates a PlaceholderHighlight which fades in an appropriate color, using the given animationSpec.
Parameters
animationSpec
the AnimationSpec to configure the animation.
Samples
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import io.github.fornewid.placeholder.foundation.PlaceholderHighlight
import io.github.fornewid.placeholder.material.fade
import io.github.fornewid.placeholder.material.placeholder
import io.github.fornewid.placeholder.material.shimmer
fun main() {
//sampleStart
Text(
text = "Content to display after content has loaded",
modifier = Modifier
.padding(16.dp)
.placeholder(
visible = true,
highlight = PlaceholderHighlight.fade(),
),
)
//sampleEnd
}