android-button

selected color of MaterialToggleButton to a solid color

吃可爱长大的小学妹 提交于 2021-02-20 19:11:38
问题 Not able to make the selected color of MaterialToggleButton to a solid color, only a transparent shade of color primary is shown. I tried the below set of code and the out image is shown below. Button theme in styles <style name="ThemeButtonColorToggle" parent="AppTheme"> <item name="colorPrimary">@color/colorOrange</item> <item name="colorButtonNormal">@color/colorOrange</item> <item name="android:backgroundTint">@color/black</item> <item name="strokeColor">@color/colorOrange</item> <item

selected color of MaterialToggleButton to a solid color

こ雲淡風輕ζ 提交于 2021-02-20 19:10:46
问题 Not able to make the selected color of MaterialToggleButton to a solid color, only a transparent shade of color primary is shown. I tried the below set of code and the out image is shown below. Button theme in styles <style name="ThemeButtonColorToggle" parent="AppTheme"> <item name="colorPrimary">@color/colorOrange</item> <item name="colorButtonNormal">@color/colorOrange</item> <item name="android:backgroundTint">@color/black</item> <item name="strokeColor">@color/colorOrange</item> <item

selected color of MaterialToggleButton to a solid color

人走茶凉 提交于 2021-02-20 19:10:17
问题 Not able to make the selected color of MaterialToggleButton to a solid color, only a transparent shade of color primary is shown. I tried the below set of code and the out image is shown below. Button theme in styles <style name="ThemeButtonColorToggle" parent="AppTheme"> <item name="colorPrimary">@color/colorOrange</item> <item name="colorButtonNormal">@color/colorOrange</item> <item name="android:backgroundTint">@color/black</item> <item name="strokeColor">@color/colorOrange</item> <item

How to make default Google and Facebook login buttons look even and pretty? Please see details

╄→гoц情女王★ 提交于 2021-02-19 04:14:40
问题 I have given option to login with google and facebook in my app. But the default buttons looks uneven and ugly like this: Here's xml code: <android.support.v7.widget.CardView android:layout_width="match_parent" android:layout_height="wrap_content" app:contentPadding="10dp" app:cardElevation="2dp" app:cardBackgroundColor="@android:color/white"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <com.google.android.gms.common

How to set width and track text in a Switch/SwitchCompat button and achieve this result? (Image and GIF attached)

这一生的挚爱 提交于 2021-02-07 19:22:36
问题 I need to implement a button in my app like this I used a SwitchCompat button but the closest I arrived was to this point, having two main problems: 1 - The width of the button does not adjust correctly when screen sizes change (drawable gets cut off, become too small etc), it is important that the width occupies the parent view correctly ( a small linear layout enclosing it) 2 - I was not able to understand how I could get the letters in the Switch Track Is it possible to achieve this result

Filter with chips android

陌路散爱 提交于 2021-01-29 05:19:09
问题 I would like to ask you if exist in component which is an radiobutton, but it is format from chips like this image. it is an component presents in Google Play Games when you want search an game thank for ours response 回答1: It is not exactly what you are looking for but you can use: a container with rounded corners, like a CardView or a LinearLayout single Button with rounded corners for each items add animations on the onClick event Something like: <LinearLayout android:id="@+id/ll_container"

How to create borderless button using style from style.xml file (along with all other styles)

*爱你&永不变心* 提交于 2021-01-28 07:02:50
问题 I am trying to create a borderless button, but I also have many other styles for my button and I want to design button borderless by embedding code into my style.xml file. One way I found was: By using style="?android:attr/borderlessButtonStyle" in my layout file. <Button android:id="@+id/button_send" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_send" android:onClick="sendMessage" style="?android:attr/borderlessButtonStyle" /> But I

Having an issue coloring custome xml button

我只是一个虾纸丫 提交于 2021-01-27 17:49:35
问题 I'm having an issue coloring a custom button. For some reason, it seems like no matter what coloring change I want to apply (text or background) the button remains the same. I notice the button.xml has the desired color and the right shape though it doesn't appear the button background-color property on the activity the button from an activity <Button android:id="@+id/button2" android:layout_width="162dp" android:layout_height="53dp" android:background="@drawable/button" android:text="@string

How to change the color of a button?

删除回忆录丶 提交于 2021-01-20 16:22:17
问题 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" android:text="Button Text" android:paddingBottom="20dp"/> 回答1: You can change the colour two ways; through XML or through coding. I would recommend XML since it's easier to follow for beginners. XML: <Button android:background="@android:color/white" android:textColor="@android:color/black" /> You can also

How to change the color of a button?

江枫思渺然 提交于 2021-01-20 16:19:45
问题 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" android:text="Button Text" android:paddingBottom="20dp"/> 回答1: You can change the colour two ways; through XML or through coding. I would recommend XML since it's easier to follow for beginners. XML: <Button android:background="@android:color/white" android:textColor="@android:color/black" /> You can also