I'm using a textview in a dark background so I'd like to use the light colored 'holo light' themed items in my activity instead of the defaults. In the past I've copied these from the android source to my own res directories. There must be a better way but I haven't found it so far. Suggestions please...
Related
I'm trying to set background color of ActionBar ,I found that I can't use red color as it is private instead I have to use holo_red_dark but why, does anybody has explanation.
Just like your application has it's colors in a colors.xml file so do the components of the Android system and this is one of them. In the same manner, you can't (actually you can but you really shouldn't) use them in your application because they are the design of the system and may change.
You can see the value of the color in the source code of Android.
red color in android is private You can reference them like this
android:drawable="#*android:color/red"
but it is not recommended, because private resources are likely to be renamed or removed in the future.
i suggest add custom color in your colors.xml file resource.
E.G. #FFFFFFFF OR color/white
Is there any difference/affect in performance on color redraws? Pros/Cons ?
I have asked a few android theme developers and some say that using the #FFFFFFFF recommended as its basically telling it how it is, rather than using the color/white which is to call from another location.
Though I have asked then why in say for example Android Framework/res/values/colors, both formats are being used ?
Is there any difference/affect in performance on color redraws?
Pros/Cons ?
not really.
#color/white
retrieve an entry in your colors.xml file, that contains the colours in the hex format.
#android:color/
retrieve an entry in the colors.xml file provided by the framework
Performance reasons, no.
But, you will likely want a combination of the two. You will define color/white in your styles and in the styles you will set color/white to #FFFFFFFF.
The reason for this is that you can reference the same white color that you defined in the styles everywhere in your app. So if (when?) the day comes that your designer says "I don't want pure white anymore, I want a creamy off-white" you can just change the color in one place and you're done. And if the name is no longer representative of what it is, you can do a global rename with just a few keystrokes.
#FFFFFFFF will make you have control over it.
color/white will have android/samsung/htc/lg control over it; they can override it with somewhat white or greyish in framework.
So, it depends if you want it to be in sync with the white globally in the users framework or not.
I've currently implemented a style via the http://jgilfelt.github.io/android-actionbarstylegenerator/ website. I used the light version of the style here and I need to change the homeAsUpIndicator icon to white. I've been looking for a while now and haven't been able to find a psd or something of the sort to be able to change the icon to the desired colour (which is white). I've already found the Holo.Dark icon, but that one is transparent and too big when I put it in the ActionBar. Overlaying a colour, is not as good looking as having the original and being able to modify it.
Does anyone know if there is a PSD/PDF with this image? Or an alternative?
There is "up caret" icon and much more in design files available (for free ;) ) there
I'm building an android app and i want to have different color themes picked by the user in the GUI. Something simple like different shades of a color.
How do you handle this? Do you save all needed colors as colors in the android resources and then depending on the color setting set the colors programmatically? Or can you some how read settings straight in the xml:s?
Or (if you can't do it via the xmls) do you store all colors in a class as public static? Which to me appears simpler if you have to change the colors programmatically.
Thoughts on the matter would be much appreciated :)
All this can be done with Themes on Android, you fill find more information reading this article:
http://developer.android.com/guide/topics/ui/themes.html
I'm looking at how to give an app that I develop and deploy it's own look and feel. So I read about the Style and Themes on developer.android.com. After some initial success with text color, text size, background color... I seem to get stuck at changing buttons, toggle buttons... It appears to me that to change the color of a button a .9.png file must be created (possibly for the different dpi's). Looking at the artwork in the default style, I see a large number of these .9.png files. To have a consistent style they should all be updated.
Is it correct to say that defining a new style involves modifying/recreating the .9.png files?
If no, how should one go about modifying the style of these .9.png based elements?
If so, are there any tools that assist with creating a custom style? And are there any style packages that can be downloaded/purchased?
I'm not sure it's a good idea to give a new look to every UI control in your application unless you are a very experienced designer. Probably, we can't beat Google designers at their craft and it would be better to comply with existing styles adding some cool features instead of changing button colors at random.