views:

83

answers:

2

I've hit a brick wall on a UI item with regard to applications on sense phones. I have been unable to craft search queries on google or SO to find any reference to what I'm after.

Is there a way that I can have my application theme its UI styles to match the phone's currently applied style? I'm basically after the styles for different UI widgets (check boxes, spinner, button, etc).

I have a myTouch 3G Slide which is running the Espresso variant of HTC Sense.

Update: (Thanks @Macarse for the tip)

As a clarification I'm attempting to get my spinner drop down, check boxes, buttons, etc) to follow the Sense theme that is currently applied on the phone. Currently, I have done the following with no success:

I have created a res/values/styles.xml file with the following content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme" parent="@android:style/Theme"></style>
</resources>

That unfortunately had no success doing either of the following with the AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.division6.pwgenapp"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/Theme">
    ...
    </application>
    <uses-sdk android:minSdkVersion="7" />
</manifest>

Or

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.division6.pwgenapp"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@android:style/Theme">
    ...
    </application>
    <uses-sdk android:minSdkVersion="7" />
</manifest>

Now if I use something like @android:style/Theme.Light, the application as a whole takes on the light theme. What I'm trying to figure out is if there is some form of reference that would allow me to just ref the system applied theme.

Thanks again for the comments.

UPDATE: I did some digging around in one of the themes available for the Slide and noticed that the theming they did was exclusively for the HTC Sense/Rosie widgets. As a result I am more or less unable to reference those settings without tying myself to the Rosie widget set (which is an HTC exclusive).

Thank you all for viewing and your comments.

+1  A: 

Yes you can use inheritance in your styles.

Check Applying Styles and Themes.

Macarse
I've looked at that and maybe I'm just missing something (I have a tendency to overlook things so bear with me).I created a res/values/styles.xml and in that I put a theme with the parent of @android:style/Theme.Unfortunately this seems to take the android default system theme. Is there any way to reference the currently applied theme?
Dave G
@Dave G: Please edit your question adding some sort of example with code. Something like: I want `MyVeryOwnProgressBar` to look like the HTC Sense, I've used this style but it doesn't look fine. :)
Macarse
A: 

HTC Sense as far I know it's not open, so you won't be able to get and override their default theme.

Pentium10
That's not an issue. Although HTC Sense is not open they should have modified android's default style for your application to have the same look and fell as the rest of the apps. Inheriting from the style and modifying what you need should do the trick.
Macarse
Actually except for very simple and careful theming, it is good that they do not change the behavior of regular applications, otherwise it is entirely possible for them too break apps.I would very much recommend that developers do not try to modify their apps to "match" the UI design of whatever device they are running on... use the standard UI, whatever it is for the device, and let yourself be consistent with all of the other third party apps.
hackbod
@hackbod - this is what I was attempting to do. Essentially I was under the impression that my widgets were not taking the system applied theme when in fact the theme was only applied to the Rosie (Sense) widgets and not additionally applied to the standard widgets.
Dave G