Questions tagged [android-compose-card]
24 questions
48
votes
6 answers
Ripple with rounded corners Jetpack Compose
In this answer I got wrong ripple animation. Do you know how to create ripple with rounded corners using Jetpack Compose?
With default ripple I have this:
Code:
Card(shape = RoundedCornerShape(30.dp),
border = BorderStroke(width = 2.dp,…

Renattele Renattele
- 1,626
- 2
- 15
- 32
38
votes
1 answer
How to set card elevation in jetpack compose with Material3
I've created the simple card in jetpack compose, Here I set elevation but it shows a type mismatch.
Card(
shape = RoundedCornerShape(20.dp),elevation = 10.dp
) {
Box(modifier = Modifier.height(200.dp)) {
…

RaJ
- 775
- 2
- 8
- 21
23
votes
2 answers
How to add border to card view with jetpack compose
I find the way Border(1.dp, Color.Black) can not work with the border property of Card view, what's the best way to work around of it?

ccd
- 5,788
- 10
- 46
- 96
15
votes
2 answers
Event Handling on a Jetpack Compose Card
I have a music player app - on my screen, I have cards displaying information about tracks. When I tap on one card, the player should play its track.
@Composable
fun TrackCard(track: Track) {
Card(
modifier =…

Remo
- 1,112
- 2
- 12
- 25
14
votes
2 answers
Whats the difference between Surface and Card in Jetpack Compose?
It's basically the same right? They have the same properties. I really don't know when I have to use each.
Technically Cards is for a Card view but Surface have the same properties like elevation and border

Aris Guimerá
- 1,095
- 1
- 12
- 27
13
votes
4 answers
Jetpack compose ui : How to create cardview?
I want to create Cardview using jetpack compose but i am not able to find any
example.
user9075369
8
votes
1 answer
Why Compose Card not clickable?
I am trying to use jetpack compose 1.0.0-beta08. If I add clickable to Text it works but only text field ripples so what is the problem on Card click ?
@Composable
fun FoodCategoryChip(
text: String,
onClick: (String) -> Unit
) {
Card(
…

Emre Hamurcu
- 111
- 1
- 6
4
votes
1 answer
Type mismatch: inferred type is Dp but CardElevation was expected in Jetpack Compose
Started learning Jetpack Compose. An error occurred: Type mismatch: inferred type is Dp but CardElevation was expected, I can't understand what the problem is, tell me how to solve it.
import androidx.compose.ui.unit.dp library imported, and…

Dmytro Karpinsky
- 41
- 1
4
votes
1 answer
Android compose Card has a border when semi-transparent colors used
Android Jetpack compose Card draws a border around the card when background color has some transparency. This is how it looks in AS:
But this is how it looks in the app:
If I set background to a solid color it works, but by default backgroundColor…

Luke
- 2,539
- 2
- 23
- 40
3
votes
1 answer
Android Jetpack compose material 3 why Card need this annotation @OptIn(ExperimentalMaterial3Api::class)
I am new in Jetpack Compose(JC).
I started JC and used card but it shows me an error and recommend me to add this annotation @OptIn(ExperimentalMaterial3Api::class).
Also showing this message This material API is experimental and is likely to change…

Mohammad Taqi
- 161
- 2
- 8
3
votes
1 answer
Icon drawable inside IconButton is black despite it being white
The Icon drawable inside the IconButton composable is black despite it being white. The picture below of the current setup shows the garbage can icon at the top right on an alpha background. How can I fix this issue?
@Composable
fun AppImage(
…

Raj Narayanan
- 2,443
- 4
- 24
- 43
2
votes
1 answer
Jetpack Compose - where are the selectable card overloads?
I am using the androidx.compose.material3:material3:1.0.0-beta03.
The Javadoc of the simplest card (in the CardKt.kt file) says
This Card does not handle input events - see the other Card overloads if you want a clickable or selectable Card.
I do…

Florian Reisinger
- 2,638
- 4
- 23
- 34
2
votes
3 answers
JetPack Compose: Adding click duration
I have a composable component like so:
Card(
modifier = Modifier
.fillMaxWidth()
.then(modifier ?: Modifier),
backgroundColor = colorResource(id = R.color.Red),
shape = RoundedCornerShape(percent = 50),
) {
Row (
…

KTOV
- 559
- 3
- 14
- 39
1
vote
0 answers
All the items moving when dragging in LazyVerticalGrid
@Preview(showBackground = true)
@Composable
fun Greeting() {
var initialXOffset by remember { mutableStateOf(0f) }
var initialYOffset by remember { mutableStateOf(0f) }
var xOffset by remember { mutableStateOf(0f) }
var yOffset by…

androidDeweleper
- 21
- 1
1
vote
1 answer
How to get rid of white space from a card jetpack compose
I am working on this design where I have a column that has text and image on top and I have this card view but I want to remove this white space. The card is white I just added the blue to show the white space showing. How can I remove the white…

Suraya
- 63
- 7