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.).
Related
There are many "default" apps that have the window decorator matching the app color theme such as the Youtube or Google Play apps.
My app otherwise has a gray bar (the bottom one in the pic) as most of the apps one can download from Google Play that aren't from Google.
How can I change the color of it?
The window decoration color roughly follows the status bar color. You can set it at runtime via Window#setStatusBarColor
If you do not set it specifically, the color will be derived from your theme colors.
So setting ColorPrimaryDark or ColorPrimary would define your decorations color.
The color can't be transparent, if it is, you might get the grey color you are seeing.
If you are still not seeing the right color, you are hitting a bug that should be fixed in ChromeOS 60.
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
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!
How can I replace the color of a listview item background when in the non-(focused|pressed|activated) state with a custom color, but keep all the system default colors for pressed, long-pressed, activated, focused etc. states?
I'm trying to give my listviews a card style - that is white items with space in between on a grey background (as in Google Play Store app and others).
So I want to give the items a white background, but at the same time, keep all the system default selectors, including the fade animation for long press. That is, I want to replace the transparent color for the inactive states with white, but keep all the other states as by default.
This is even more important since the KitKat release, because all the accents have now switched from blue to grey, so I would like the app to respect that - to have blue color when pressed on ICS and JellyBean, but grey on KitKat. Therefore, I don't want to hard-code any values into a custom selector.
All right, I figured it out and it's incredibly simple:
All I have to do is to add this attribute to the given ListView:
android:drawSelectorOnTop="true"
And that's all! I can give the list items any background color that I want and it will always be overlayed by the system default selector!
On my Galaxy S3, by default when buttons are pressed their backgrounds take on a light blue color. Is there a way to change this color?
I am aware of State List Drawables, and I've been able to use them to do this in certain situations. However, there are some things that still use this default color that I would like to change. For instance:
The home button in the Action Bar still uses the light blue color when it's pressed
The display buttons in a MapFragment (zoom in, zoom out, my location, etc.) still use the light blue color
If anyone knows how to change this color in general across the entire app, or even for just these two instances, that would be very helpful. Thanks.