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
// Reference: https://stackoverflow.com/questions/66341823/jetpack-compose-scrollbars/68056586#68056586 | |
// Modify: LazyListState -> ScrollState | |
fun Modifier.verticalScrollbar( | |
scrollState: ScrollState, | |
scrollBarWidth: Dp = 4.dp, | |
minScrollBarHeight: Dp = 5.dp, | |
scrollBarColor: Color = Color.Blue, | |
cornerRadius: Dp = 2.dp | |
): Modifier = composed { |
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
@ExperimentalMaterialApi | |
@Composable | |
fun OverlayBottomSheetScaffold( | |
sheetContent: @Composable ColumnScope.() -> Unit, | |
scaffoldState: BottomSheetScaffoldState = rememberBottomSheetScaffoldState(), | |
sheetPeekHeight: Dp = 0.dp, | |
maxOverlayAlpha: Float = 0.7f, | |
overlayColor: Color = Color.Black, | |
cancelable: Boolean = true, | |
content: @Composable (PaddingValues) -> Unit, |
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.* | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.BoxWithConstraints | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.getValue | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.geometry.Offset |
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
@OptIn(ExperimentalAnimationApi::class) | |
@Composable | |
fun Heart(modifier: Modifier, horizontalPadding: Int, bottomMargin: Int) { | |
val width = LocalConfiguration.current.screenWidthDp | |
val height = LocalConfiguration.current.screenHeightDp - bottomMargin | |
val yRandom = Random.nextInt(0, height / 2) | |
val xRandom = Random.nextInt(horizontalPadding, (width - horizontalPadding)) | |
val state = remember { |
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
package des.c5inco.material3 | |
import androidx.compose.animation.core.Animatable | |
import androidx.compose.animation.core.spring | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.offset | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.material3.Surface |
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
const val MAX_ITERATIONS = 7f | |
@OptIn(ExperimentalGraphicsApi::class) | |
@Composable | |
fun CantorCirclePatternComposable(modifier: Modifier) { | |
BoxWithConstraints(modifier = Modifier) { | |
val frame by rememberInfiniteTransition().animateFloat( |
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
package des.c5inco.material3 | |
import android.graphics.Matrix | |
import android.graphics.Path | |
import androidx.compose.animation.core.* | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | |
import androidx.compose.foundation.layout.size |
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
package des.c5inco.material3 | |
import android.graphics.Matrix | |
import androidx.compose.animation.core.* | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.material3.MaterialTheme | |
import androidx.compose.material3.Surface | |
import androidx.compose.material3.Text | |
import androidx.compose.runtime.Composable |
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
package des.c5inco.material3 | |
import androidx.compose.animation.* | |
import androidx.compose.animation.core.* | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.interaction.MutableInteractionSource | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.foundation.shape.CircleShape | |
import androidx.compose.foundation.shape.RoundedCornerShape |