Skip to content

Instantly share code, notes, and snippets.

View aritra-tech's full-sized avatar
💪
Focusing

Aritra Das aritra-tech

💪
Focusing
View GitHub Profile
@OptIn(ExperimentalLayoutApi::class)
@Composable
fun ContextualFlowRowLayout(modifier: Modifier = Modifier) {
val techStacks = listOf(
"Kotlin",
"Jetpack Compose",
"Java",
"Rust",
"Go",
val navController = rememberSwipeDismissableNavController()
SwipeDismissableNavHost(
navController = navController,
startDestination = "home_screen"
) {
composable("home_screen") {
HomeScreen()
}
composable("add_note_screen") {
val listState = rememberScalingLazyListState()
val list: List<String> =
listOf("Kotlin", "Jetpack Compose", "Android", "Kotlin Notebook", "KMP", "CMP", "Koin")
Column(Modifier.fillMaxSize()) {
ScalingLazyColumn(
state = listState,
scalingParams = ScalingLazyColumnDefaults.scalingParams(
CircularProgressIndicator(
progress = .7f,
modifier = Modifier
.fillMaxSize()
.padding(all = 1.dp),
startAngle = 295.5f,
endAngle = 245.5f,
indicatorColor = MaterialTheme.colors.secondary,
trackColor = MaterialTheme.colors.onBackground.copy(alpha = 0.1f),
strokeWidth = 6.dp
Column(
modifier = Modifier.padding(8.dp)
) {
TitleCard(
onClick = {},
title = { Text("Workout") },
contentColor = MaterialTheme.colors.onSurface,
titleColor = MaterialTheme.colors.onSurface
) {
Text("1 Hour 32 mins")
@Composable
fun SliderExample() {
var value by remember { mutableFloatStateOf(4f) }
Column(
Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
@Composable
fun SteppersExample() {
var value by remember { mutableIntStateOf(2) }
Column(
Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
@Composable
fun ToggleChipExample() {
var checked by remember { mutableStateOf(true) }
ToggleChip(
modifier = Modifier.fillMaxWidth(),
label = {
Text("Dark Mode")
},
checked = checked,
@Composable
fun ChipExample2() {
Chip(
onClick = { /*TODO*/ },
label = {
Text(text = "Bengaluru")
},
secondaryLabel = {
Text(text = "32 °C")
},
@Composable
fun ChipExample() {
Chip(
onClick = { /*TODO*/ },
label = {
Text(text = "Tools")
},
icon = {
Icon(
painter = painterResource(id = R.drawable.tools),