Dave G Dave G - 6 months ago 12
Android Question

Android application theming on Sense phones

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.

Answer

Yes you can use inheritance in your styles.

Check Applying Styles and Themes.