android-jetpack-compose-button Questions

3

Solved

I am trying to create a circular OutlinedButton with an icon in the center without text. OutlinedButton(onClick = { /*TODO*/ }, shape = CircleShape, border= BorderStroke(1.dp, Color.Blue) ) { ...

6

I find listeners for onClick and onLongClick and even onPress but there is no event/listener for something like buttonDown and buttonUp, or onPress and onRelease. Am I missing something? My current...

6

Solved

How can we achieve this in jetpack compose I'm doing something like this Button( elevation = ButtonDefaults.elevation( defaultElevation = 0.dp, pressedElevation = 8.dp, disabledElevation = 0.d...

3

Solved

How do I change the background color of a button on click?

4

Solved

How can I change the ripple color of an IconButton? I tried doing it this way, but it doesn't change: IconButton( onClick = { onClick() }, modifier = Modifier.clickable( onClick = { onClick() },...

2

For some reason, I'm unable to change the color of the ripple effect of a Button. What am I doing wrong here? androidx.compose.material.Button( onClick = onClick, modifier = modifier .indication...

4

Solved

I am trying to build the following component, Following is my code, Button(onClick = { /*TODO*/ }, modifier = Modifier.fillMaxWidth()) { Image(painter = painterResource(id = R.drawable.ic_check_c...

3

Solved

I am trying to align the icon of a button to the left and keep the text centered. Any ideas how this can be achieved? My composable: @Composable fun CustomButton() { MaterialTheme { OutlinedBut...

2

Solved

I'm building a re-usable Button component in Jetpack Compose, which is basically a Row. The button should have a text on the left end and an icon on the right end. This works straight forward like ...

4

Solved

I am trying to remove padding from TextButton but it wont work. TextButton( onClick = {}, modifier = Modifier.padding(0.dp) ) { Text( " ${getString(R.string.terms_and_conditions)}", ...

2

Solved

As solved here, I disable the tap flashing by setting the indication to null. However, this is not working for Button or Icons?!

2

Solved

I want to create button where I have only text and icon and all background and borders are transparent. I create something like that: OutlinedButton( colors = ButtonDefaults.buttonColors(backgroun...

2

Solved

Unable to reduce the huge padding in OutlinedButton. Tried contentPadding, modifier padding, etc. Cannot reduce padding for text "apple". Any idea? Should I use any other type of compose ...

2

I have button to record voice so I want it to start record when user press it and stop when he leave it @Composable fun Screen(){ Button(){ Text("record") } }

1

Solved

I am trying to create a custom button that is small and can show a numerical value between 0 and 99 as Text. Depending on the fontsize the Text disappears from the Button when the size of the Butto...

2

Solved

Let's say I have a Composable like this : @Composable fun LoadingButton() { val (isLoading, setIsLoading) = state { false } Button( onClick = setIsLoading, text = { if (isLoading) { Text(te...
1

© 2022 - 2024 — McMap. All rights reserved.