android-button Questions

3

Solved

I want to implement the MaterialButtonToggleGroup in Jetpack Compose. This component looks like this (image taken from here): So far, I got the following result: Note, that the vertical grey bord...

25

Solved

I'm new to android programming. How do I change the color of a button? <Button android:id="@+id/btn" android:layout_width="55dp" android:layout_height="50dp" android:layout_gravity="center"...
Bandore asked 19/9, 2015 at 17:10

7

I need to add border with rounded corner in Button using Jetpack Compose Like :

10

Solved

I'm following the tips from questions like this to create a button style like suggested on Material Design. However, I need to change the corner radius and haven't been able to do so by inheriti...

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) ) { ...

20

Solved

I want to make the corners of a button round. Is there an easy way to achieve this in Android?
Dubuffet asked 19/5, 2011 at 6:14

31

Solved

In this, this and this thread I tried to find an answer on how to set the margins on a single view. However, I was wondering if there isn't an easier way. I'll explain why I rather wouldn't want to...
Petrous asked 4/10, 2012 at 13:22

6

Solved

I made a button that changes the background drawable on different states, this way: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pre...
Tomlin asked 14/1, 2011 at 15:26

3

Solved

The buttons created programmatically don't follow the buttonStyle defined in the apptheme, but the buttons created in xml follow it. Below is my style.xml <style name="AppTheme" paren...

2

Solved

I want to redirect user to particular URL while clicking on Button in Android App.
Betoken asked 10/2, 2010 at 11:31

3

Solved

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

14

Solved

I am trying to set the background color of a button in my app and I am unable to achieve the result that I want... The color that I am trying to set is holo_green_light(#ff99cc00). In order to do ...
Nonproductive asked 6/8, 2013 at 0:35

8

Solved

I'm trying to invoke the method in my onClick (View v) XML, but does not work with Fragment. This is the error. 01-17 12:38:36.840: E/AndroidRuntime(4171): java.lang.IllegalStateException: Could ...
Wharton asked 17/1, 2014 at 17:42

57

Solved

What is the best way to prevent double clicks on a button in Android?
Consueloconsuetude asked 9/4, 2011 at 23:49

6

Solved

I find out that since Android Studio 4.1 I cannot change the background color of a Button by setting color on its android:background, just no effect. And custom Drawable is not working as well. My ...

11

Solved

I have some buttons like this in my app: <Button android:id="@+id/bSearch" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="16dp" android:text="Sea...
Longstanding asked 9/4, 2014 at 14:45

4

I'm trying to do in android a group of buttons that can be selected and activate only one of them. I need to work with the same logic of a radiogroup and radiobuttons. I tried many alternatives bu...
Whithersoever asked 12/9, 2015 at 0:56

24

Solved

I'm trying to make a round button, but I don't know how can I do it. I can make button with rounded corners, but how can I can round circle. It's not the same. Please, tell me, is it possible on An...
Stlaurent asked 22/4, 2012 at 8:57

4

Solved

I want two separate event for long click Down and Long click up. How can I do this in Android? What I have tried is as follows public class FfwRewButton extends ImageButton { public interface B...
Pulling asked 14/2, 2013 at 14:27

4

Solved

I have a simple HTML app with CSS and Javascript. I want to prevent the users from pressing the back button. I have achieved it using JavaScript and it works fine. My problem is that it doesn't wor...
Mossbunker asked 16/8, 2017 at 7:56

6

Solved

I am using Button in one of the layouts. I want Button size to be as small as the text/label size. I am using the following code. <Button android:text="@string/cancle_button" android:id="@+i...
Vendue asked 24/10, 2013 at 4:14

3

Solved

I'm trying to set the background tint of a button programmatically, not to a color resource as done here, but instead to a hex value. At the moment, I have converted a hex value into a ColorDrawabl...
Junco asked 10/2, 2018 at 3:49

3

Solved

I'm creating a form in android which asks for gender. To get this input I use Material Button Toggle Group which contains two buttons. I don't know how to know which button is clicked in my activit...

9

Solved

I'm using the new material components com.google.android.material:material with android x but I can't set a custom background to the button. I know that I can use app:backgroundTint to change the ...

4

Solved

I would like my TextView to paint with a different color background when pressed. The below xml contains a Button and TextView, both of which specify a Selector as their background. The Button work...
Millennial asked 8/11, 2012 at 21:38

© 2022 - 2024 — McMap. All rights reserved.