# [Q] How to switch from holo dark to holo light using a ListPreference



## RoLa (Jun 12, 2011)

I've been messing with Adams new tiles in JB 4.2. I love them.

I'm trying to code a ListPreference selector to invert the tiles using holo dark and holo light.
I have the ListPreference and arrays coded (all the easy stuff) but now I'm not sure how to make the selector work.

ArtVandelay pointed me to where the image is described as an xml. This would be used for "holo dark"










I inverted the hex code to make a light version, and this would have to be applied as "holo light"










This is as far as I have gotten. I'm having a bit of trouble figuring out how to attach the array selector to pick the designated xml.

Any help or suggestions would be appreciated. Here is what I have so far.










https://github.com/R...d2b37874077a557


----------



## JBirdVegas (Jun 11, 2011)

Did you figure this out?


----------



## RoLa (Jun 12, 2011)

JBirdVegas said:


> Did you figure this out?


Not yet man. I've came across a few ideas, I'm having a hard time executing my plan. I've talked with a couple of developers on my talk list for guidance but I've tried and am coming up short come compile time. I know everyone is busy with their own projects and I hate to be a bother.

I was initially trying to accomplish all of this through ROMcontrol. Everything I have is coded there.
My first attempt would be to make a light tile and drop it in the same directory where the dark one resides. Then, find where QuickSettings.java is calling everything and make it call to light drawable tile and dark text. I don't know if I need to describe the themes and add them in the Androidmanifest.xml or make a seperate themes.xml describing holo dark and holo light and drop it in res/values.

Another thing I was advised with was to trigger a broadcast and put a receiver in the Quick Settings base class and have the receiver set the background drawable/text color based on a setting. Or have a settings observer in the base class and set the setting in the preference. I think that's how it was described to me but it's a little over my head man. I wish I could see how it's done. I did some research on settings observers and they look fabulous. I just need to learn the basics and stop trying to develop because when I hit a wall like this, it seriously tugs on meh heart strings. Then I bug every developer I know to help mop up my mess.


----------



## JBirdVegas (Jun 11, 2011)

your going to need frameworks support... you may be able to place the theme setting code in https://github.com/AOKP/frameworks_base/blob/jb-mr1/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsTileView.java but from just a quick look I would think that is only called to setup the view and not called everytime the statusbar gets pulled down. That is where the SettingsObserver would com into play but I would try to avoid having to place a watcher in each tile instead I would try to make the code act on the base view.

but more likely you will need to place it in here: https://github.com/AOKP/frameworks_base/blob/jb-mr1/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

Either way messing with the frameworks is tricky and can cause compatibility issues if you not careful notice that code is only for the 'phone' package so if you don't also modify the 'tablet' package you may cause FC's on other devices if your not careful.

Look there and see what you think but your going to need a working knowledge of java to get this done :-/


----------



## RoLa (Jun 12, 2011)

Thanks J, it's getting there. As soon as the phone package is done, I'll look at the transition to tablet.

EDIT: I have most of it working. I'll look at tablet directory when phone is 100%  https://www.youtube....h?v=qAhEW8pzAyQ


----------

