I want to create a button background, which is exactly the same as ?attr/selectableItemBackground but with a black stroke outline.
Is there a way to "extend" ?attr/selectableItemBackground and add a black outline or will I have to create a completely new stateList?
Related
How do you add a shadow on a button with your own colour? The button is set on a gradient background and I have various buttons that require shadows (preferably different colours). Can this be done or if not, how would I create a standard shadow?
So far I am just seeing an option to set background. I want to set the filled portion to one color and the unfilled portion to another color.
I think you could achieve this, setting background of progressBar to color of unfilled portion and setting progressTint to filled portion color.
I have a list view and now all cells have white background.
What I want is to keep the white color in listview's background and put some "alpha" value to make it semi transparent so the user can see the whole view's background.
If I put android:alpha in listview , everything gets alpha ( the content too ). I want the content of the listview to be fully visible and the background color to be semi-transparent. Is there any way to achive this?
Don't use white color as background, define a color in resources that has a transparency, you could do something like #66FFFFFF, this is a transparent white.
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.
I've got an app which creates widgets where the user can set the colour of the button's background via a colour picking dialog. However, the only way I can set the button in the remote view to have this colour is by doing this
rv.setInt(R.id.button, "setBackgroundColor", colour);
but this always makes the background a rectangle shape, replacing any previously set background drawable. What I would like to do is have the button as a rounded-corners rectangle shape which can be set to a custom colour. Is this possible, and if so how?