Android: use dark ExpandableListView icon? - android

My app uses Theme.Holo. When I instantiate an ExpandableListView, it uses white icons for the group rows. (in the image, the icon is visible in the first row because I am pressing this row to highlight it, the other rows have invisibly white icons).
I know I can set the group icon with ExpandableListView.setGroupIndicator(), but I would rather specify to use a dark version of the OS icon, if this is possible?

You will need to change the default group indicator in this case. A light or dark indicator are just different icons anyway. Without changing the theme, the only way is to change the icons/drawables for the indicator.

Related

Text color inverting on selection

I have a multichoice ListView whose items have a light (transparent) background by default and a dark one while selected. Therefore, I would like to have the TextViews in the items change their color accordingly, i.e. black by default and white while selected.
Obviously, I can manually define a selector that does this, but is there some predefined color or style in the Android SDK that I could use out of the box?
Just for illustration, the navigation drawer in Gmail does this:

Set color of ShareActionProvider

I defined a color for my whole app (a dark grey) and so when I click on the ShareActionProvider, a black list shows up but the text color is dark grey too (and so not really visible). The text in the ActionBar is white, but not the one in the list.
Is there any way I can set a different color (some item in styles.xml ?)
Thanks
Best way to customize shareActionProvider is create separate menu specifically for Sharing. See this link https://stackoverflow.com/a/22192759/1237175

How to match the menu bar/notification bar color match application

I have an Android app which allows the user to change the color of a background based on the selection they choose.
This is the line that changes the color:
appBackground.setBackgroundColor(Color.rgb(inRed, inGreen, inBlue));
How do I also change the menu bar color as well the notification bar to change to that color of the user's choice?
I know it's only possible in KitKat but can someone point me to the way...
If you would like an effect like the image below, have a look here:
Why can't we use a Translucent system bars with and ActionBar
As you can see, the background color can be changed programatically (so it's not defined in the xml).

Override list item background color with white, keep system default (long)pressed color

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!

Android menu item background

I want to change the menu item background beacuse I use black icons, but on some phones the default color of background is black or other dark color. I tried this solution and it's worked but there was a little problen with it:
I have ten items and that's why I have a "More" item to show other options, but if I choose the More item (which is got the custom background) and after that I press back button, the item will be in the default state, default colors. What is the solution? Thanks!
The style attribute for the menu background is android:panelFullBackground. It's not hackish like the other solution, so it's not as buggy.
Despite what the documentation says, it needs to be a resource (e.g. #android:color/black or #drawable/my_drawable), it will crash if you use a color value directly.
try to use android own menu icon like as setIcon(android.R.drawable.ic_menu_search)

Categories

Resources