2,411 questions
0 votes
1 answer
65 views
Buttons layout to be rearrange after hiding any one so fill the first row first
I have six button in two Linear Layouts, three in each linear layout. But If I hide any button from any Linear layout they are rearranged accordingly in the same linear layout. But I required the If I ...
0 votes
0 answers
11 views
Why does "?attr/colorPrimary" get wrong color in color resource file?
An app uses SlateBlue as its primary color <style name="MyAppThemeStyle" parent="Theme.Material3.Dark.NoActionBar"> ... <item name="colorPrimary"&...
0 votes
1 answer
25 views
Layout attributes styling via a theme not working for buttons
The following is in AndroidManifest.xml: <application android:theme="@style/FooAppThemeStyle" ... > In style.xml: <style name="FooAppThemeStyle&...
-1 votes
1 answer
55 views
Guidance in Android studio's Button widget
I am using Button and setting it's background as drawable image (Button not content any leading text, it's blank). I needed clickable image. now the color of that png is black originally but some how ...
1 vote
1 answer
65 views
Android MaterialButtonToggleGroup buttons are getting offset when they have more than one line of text
I am using a MaterialButtonToggleGroup with MaterialButton buttons in it. I am trying to fit 2 lines of text into some of the buttons, but the buttons get shifted down a bit if they have more than one ...
1 vote
0 answers
62 views
Custom Button Background Not Applying in Android Studio (Material Theme Override?)
I'm trying to apply a custom background to a button in my Android app, but no matter what I do, the button still appears pink instead of using my custom drawable. Here's my button XML: <Button ...
3 votes
1 answer
192 views
Button with RepeatListener in Android does not change color when being pressed
I have a button in xml layout file <Button android:id="@+id/button_heat" android:layout_width="0dp" android:layout_height="0dp" ...
0 votes
2 answers
78 views
Android Studio Button not aligned with the rectangular box
When I dragged a button into the design mode, the button is not centered within the rectangle box as shown in the picture. As a result, when I added constraints to the bottom, left, and right, the ...
0 votes
0 answers
55 views
Issue with button colours. Button color is not changing as expected
I'm developing a quiz app. I want to change the button colour when the user selects it and then change it when the option is right or wrong. But the button color changes to grey even though I've not ...
1 vote
0 answers
33 views
Floating Button shifts from position when text is added
I have a little button FloatingButtonView.kt that I embed into my MainActivity.kt. It rotates when clicked and displays other buttons and vice versa when closed. But, when I try to add text underneath ...
1 vote
2 answers
2k views
How to change the default color of Button in Jetpack Compose
Is there a way in Jetpack Compose to automatically apply the primary color defined in the theme to the background of Button composables without specifying the background color every time I use a ...
0 votes
1 answer
43 views
Changing button attributes inside a dialog box upon button click
I have a dialog box that opens upon clicking a button. Inside the dialog box contains multiple buttons, but for the sake of simplicity, I will only focus on the "Sun" button. The ideal ...
0 votes
1 answer
149 views
Button's backgroundTint doesn't change even though a color was specified
My goal is to create a button with rounded corners. I have a button with this in its attributes android:background="@drawable/roundstyle", which is supposed to change the corners of the ...
2 votes
1 answer
138 views
toggle button state of 2 buttons within listview row
i have an activity that shows a listview with 2 rows. Each row has a question, which is pulled from the DB and 2 buttons on ech row, A YES button and a NO button. I am trying to set the pressed state ...
0 votes
1 answer
44 views
setOnClickListener not works in Canvas and FrameLayout
I am making a qr code scanning screen. There is a camera view in the background and scanning animation on it. At the bottom there are two image views that I added programmatically. These image views ...