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
@Composable | |
fun MainScreen() { | |
var thoughtText by remember { mutableStateOf("Funny holiday movie for the family? 🍕❤️") } | |
var yOffset by remember { mutableFloatStateOf(0f) } | |
Column( | |
horizontalAlignment = Alignment.CenterHorizontally, | |
modifier = Modifier | |
) { | |
ThoughtBubbleOverlay( |
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
val colors = listOf( | |
Color(0xFFF3C623), | |
Color(0xFFF2AAAA), | |
Color(0xFFF37121), | |
Color(0xFFF2AAAA), | |
Color(0xFF8FC0A9), | |
Color(0xFF84A9AC), | |
Color(0xFFD54062), | |
Color(0xFF8FC0A9) | |
) |
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
@Composable | |
fun Modifier.starBackgroundAnimated(): Modifier { | |
val image = ImageBitmap.imageResource(R.drawable.bg_image) | |
val transition = rememberInfiniteTransition(label = "") | |
val offset by transition.animateFloat( | |
initialValue = 0f, | |
targetValue = image.width.toFloat(), | |
animationSpec = infiniteRepeatable( | |
animation = tween(durationMillis = 10000, easing = LinearEasing), | |
repeatMode = RepeatMode.Reverse |
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
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.ExperimentalFoundationApi | |
import androidx.compose.foundation.gestures.AnchoredDraggableState | |
import androidx.compose.foundation.gestures.DraggableAnchors | |
import androidx.compose.foundation.gestures.Orientation | |
import androidx.compose.foundation.gestures.anchoredDraggable | |
import androidx.compose.foundation.gestures.animateTo | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column |
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
@Composable | |
fun AnimatedTextSwitcher() { | |
var isYellowBoxVisibility by remember { mutableStateOf(true) } | |
LaunchedEffect(Unit) { | |
while (true) { | |
delay(3000) | |
isYellowBoxVisibility = !isYellowBoxVisibility | |
} | |
} |
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
@Composable | |
fun AutoTextSizeCard() { | |
var textLength by remember { mutableStateOf(50) } | |
val baseText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " | |
val longText = baseText.repeat(textLength / baseText.length + 1).substring(0, textLength) | |
Card( | |
modifier = Modifier | |
.fillMaxWidth() |
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
data class Place( | |
val name: String, | |
val resId: Int | |
) |
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
@Composable | |
fun RulerView( | |
startValue: Int, | |
endValue: Int, | |
step: Int | |
) { | |
val density = LocalDensity.current | |
val scrollState = rememberScrollState() | |
val sectionWidth = 80.dp | |
var sliderValue by remember { mutableFloatStateOf(0.5f) } |
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
data class BarDataM(val value: Float, val label: String) | |
@Composable | |
fun BarChartComponent( | |
bars: List<BarDataM>, | |
barWidth: Dp, | |
spaceBetweenBars: Dp, | |
animateChart: Boolean | |
) { | |
var selectedBar by remember { mutableIntStateOf(-1) } |
NewerOlder