Button themes in android studio - android

How can I change the tint of the buttons within the android studio?
I see some properties when I select the button namely textColor, textColorHighlight, textColorHint and textColorLink
I'm expecting some built-in color themes without me creating custom styles, like standard green colored buttons, and blue secondary buttons.

If you want to change background tint color you can just use:
android:backgroundTint="#android:color/holo_green_light"
or
android:backgroundTint="#android:color/holo_green_dark"
and so on...
you can see other colors using autocomplete.

Related

Can't get different state background for MaterialButtonToggleGroup

I'm using Material 3 ButtonToggleGroup, I want to have a different background when a button is selected. However, If I don't add any attributes to my style applied to MaterialButton, I get the background set to colorPrimary when a button is selected but when it's not it's transparent.
When I add a backgroundTint attribute, it always has the same background color, no matter if the button is selected.

How to change the EditText background Tint color in Android?

I am developing an app using Material theme. In my app, I'm having multiple edit texts to get the input from user.
I've divided the screen into two portions:
top portion background color is white background so it showing the default material theme style but
bottom portion I'm using the blue color,
If I'm using the same style in the bottom portion, EditText background tint not visible clearly. So I'm planning to change the background tint color.It supports the lollipop version. I want to show style for below versions also.
How can I do this?
Take a look at this. android.support.v4.graphics.drawable.DrawableCompat#setTint
With this you can set the tint to your EditText.
DrawableCompat

android : what decided edit text default border colour on focus

I have two different apps and how the edittext appears in both are different. In one when i focus , the border is getting an orange colour and in other app its blue. I am not setting background in either the app. So how is the difference coming. Is it the android version selected ?
The default styling of widgets is controlled by the theme used by the activity. From your described symptoms, my guess is that you have not specified any theme, which means that you will get an orange focus ring on Android 1.x/2.x, a blue border on Android 3.x/4.x, and IIRC a gray border (subject to custom tints) in Android 5.0+.
More tactically, the focus is part of the EditText background, which will be a StateListDrawable pointing to other drawables for the various states (normal, focused, disabled, etc.).

Change Android blue color scheme

On Android ICS you get the standard blue highlight color for all user controls, you get this on elements like textviews, highlights on buttons, indications on the end of a scrollview and tabwidgets.
Is there a way to change all the color's at once using a theme?
Thanks in advance!
Cheers!

Transparent Tint on Buttons

In my Android app, I'm trying to get buttons to be tinted a certain color (either blue, red or gold). The default button tint is grey. Does anyone know how to change the color of the button so that the transparency remains with it?
I tried using:android:background
but that ditches the transparency completely and makes the button one solid color.
I also tried using:android:#color/transparent
but that ditches the color completely in favor of a fully transparent button. I've looked online for a while and found mostly stuff relating to image buttons. The kind that I'm trying to tint is just the standard Button buttons. I'm also guessing that this can be done mostly just through XML. Is that correct?
You could try and create your own button drawable like so...
Take the button drawable from the Android SDK ([ANDROID_SDK_HOME]/platforms/data/res) and import the drawables into your project. Then create a layer list with the button drawable on the bottom and a semi-transparent color on top.

Categories

Resources