Skip to content

Commit

Permalink
update: [ANDROAPP-6097] code formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAparicioAlbaAsenjo committed May 10, 2024
1 parent 443f761 commit 636cfed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.AssistChipDefaults
import androidx.compose.material3.FilterChipDefaults
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -66,12 +65,11 @@ fun ChipsScreen() {
FilterChip(label = "Label", selected = false, badge = "3")
Spacer(Modifier.size(Spacing.Spacing18))


SubTitle("Assist Chips")
//var isSelected5 by remember { mutableStateOf(false) }
// var isSelected5 by remember { mutableStateOf(false) }
AssistChip(
label = "Label",
onClick = { }
onClick = { },
)
AssistChip(
label = "Label",
Expand All @@ -80,14 +78,13 @@ fun ChipsScreen() {
imageVector = Icons.Filled.Search,
contentDescription = "search icon",
modifier = Modifier
.size(AssistChipDefaults.IconSize)
.size(AssistChipDefaults.IconSize),
)
},
onClick = { }
onClick = { },
)
Spacer(Modifier.size(Spacing.Spacing18))


SubTitle("Assist Chips With badges")
AssistChip(
label = "Label",
Expand All @@ -96,16 +93,16 @@ fun ChipsScreen() {
imageVector = Icons.Filled.Search,
contentDescription = "search icon",
modifier = Modifier
.size(AssistChipDefaults.IconSize)
.size(AssistChipDefaults.IconSize),
)
},
onClick = {},
badge = "2"
badge = "2",
)
AssistChip(
label = "Label",
onClick = {},
badge = "4"
badge = "4",
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material3.AssistChip
import androidx.compose.material3.AssistChipDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FilterChip
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
Expand Down Expand Up @@ -47,7 +46,6 @@ fun AssistChip(
onClick: (() -> Unit),
badge: String? = null,
) {

val interactionSource = remember { MutableInteractionSource() }
val isPressed by interactionSource.collectIsPressedAsState()

Expand All @@ -60,20 +58,20 @@ fun AssistChip(
colors = if (isPressed) {
AssistChipDefaults.assistChipColors(
containerColor = SurfaceColor.Container,
leadingIconContentColor = TextColor.OnSurfaceVariant
leadingIconContentColor = TextColor.OnSurfaceVariant,
)
} else {
AssistChipDefaults.assistChipColors(
containerColor = SurfaceColor.SurfaceBright,
leadingIconContentColor = TextColor.OnSurfaceVariant
leadingIconContentColor = TextColor.OnSurfaceVariant,
)
},
},
border = AssistChipDefaults.assistChipBorder(
borderColor = Outline.Dark,
),
borderColor = Outline.Dark,
),
leadingIcon = {
icon?.invoke()
}
},

)
}
Expand All @@ -88,4 +86,4 @@ fun AssistChip(
)
}
}
}
}

0 comments on commit 636cfed

Please sign in to comment.