Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[GUIDE] HTC Sense 6 built-in themes

OP fisha21

28th March 2014, 03:43 AM   |  #1  
fisha21's Avatar
OP Recognized Contributor / Themer
Thanks Meter: 4,079
 
2,234 posts
Join Date:Joined: Nov 2007
Donate to Me
More
With the avalanche of Sense 6 ROMs, and the release of the M8, we are finally getting to dig into the themes HTC reintroduced in Sense 6. Some of you may remember Sense skins, like we used to have on Sense 3 -- 4.5, and be eagerly looking forward to put those skinning skills back into action.

HTC, however had other ideas - gone are the standalone skin .apks, and instead we have a slightly convoluted implementation instead...thanks HTC (If the concept of Sense skins mean nothing to you, then please just ignore this bit....nothing to see here, other than a themer who's been at this way too long!)

So, what and where are these themes? I've uncovered a few things while digging around, and thought I'd share what I learnt with my fellow themers. Please note, this thread is not intended to be a guide on how to theme - there are plenty of excellent threads covering this already. The purpose of this thread is to share ideas and findings

What are the Sense 6 themes?


This is the easy bit! If you open Settings/Personalise/Theme, you'll be presented with the four built-in themes:


Where are the Sense 6 themes?


This is where things get complicated.

There are four themes, each of which is split into five categories. The themes are called:



The system wide theme is controlled by hex colour codes located in colors.xml and styles.xml of com.htc.resources. This controls the majority of system apps.

If you look at com.htc.resources.apk/styles.xml line 2047 for example, you'll see that there are entries called:

Code:
<style name="ThemeOne.CategoryOne" parent="@style/HtcDeviceDefault">
<style name="ThemeOne.CategoryTwo" parent="@style/HtcDeviceDefault">
<style name="ThemeOne.CategoryThree" parent="@style/HtcDeviceDefault">
<style name="ThemeOne.CategoryFour" parent="@style/HtcDeviceDefault">
etc, starting from line 2047

Categories 1-4 are represented by the four boxes along the top of the theme preview. The fifth category is defined by HTC within apks as Category 0, and this is the default category. It is used when the code within the apk doesn't specify which category to use (more on this later). With the default theme, you'll probably have noticed that various HTC apps have different coloured header bars, which correspond to the four boxes on the preview image:


So if you wanted to change the colour of the dialer, you'd edit the colour codes for HtcDeviceDefault.CategoryOne. If you were using the second theme, the orange one, you'd edit ThemeOne.CategoryOne to change dialer header, and so on...

I've managed to track down which category each HTC app uses, but if there are any I'm missing, please let me know
  • Category 0
    • HTC Backup
    • Internet
    • Settings
    • Setup
    • Tips & Help
    • Scribble
    • All apps launched while in Car mode
  • Category 1
    • Calendar
    • Contacts
    • Mail
    • Message
    • Tasks
    • Phone
  • Category 2
    • Calculator
    • Clock
    • Stocks
    • Voice recorder
    • Weather
  • Category 3
    • Camera
    • FM radio
    • Music
  • Category 4
    • Didn't actually find any apps that seemed to use this category

All of these apps use the specified category from com.htc.resources, so that's where you should edit it. There are some HTC apps that have seem to have their own internal themes:
  • Prism.apk
  • HMS_Gallery.apk
  • HTC-IME.apk
  • Video_Center.apk
  • HtcExtremePowerSaverLauncher.apk

so they have their own specified themes and categories within the colors and styles.xml of their own apk. There may be other apks as well, I just haven't spotted them yet. They read the system flag to determine which Theme to use, but then use their own categories for various elements within the app.

So Prism for example will set the overall Theme according to what's been set in the Theme picker but then will use its own internal categories. From my testing so far, all aspects of Prism (app drawer header, Blinkfeed, app drawer icon overlay) seem to use Category 4 colours from within Prism.apk. Haven't looked into any of the other apps listed above!
How are the Sense 6 themes used?


So, which theme the system is using is determined by you, via the Theme Picker. As for which category an app uses, that is determined within the java code - thanks to @Mikanoshi for some more detailed info

Still not sure where the current theme flag is set, so that the other themed apps (Gallery, Prism etc) know which theme to use. I'm guessing framework2.jar or framework3.jar, though I guess it doesn't really matter!

As for the preview images, these are generated within, and then cached in /data/data/com.htc.home.personalize/files/themePreview/ - again, thanks to @Mikanoshi for more detailed info.

If you want the Theme picker screen to show your edited themes, rather than the default ones, you'll need to delete these cached images. This can be done by full wiping, but obviously not so convenient. The other option is to add the following line

Code:
delete_recursive("/data/data/com.htc.home.personalize/files/themePreview");
somewhere in the updater-script of your rom/theme zip.
Can we add new ones?


The four built in themes offer a great way to offer multiple variations of your theme. But what if 4 options aren't enough?

I'm currently looking into this question. The biggest uncertainty I have right now is whether the themes are entirely defined in xml, or whether there is a smali compoment - some hidden smali arrays perhaps. Certainly, editing the theme don't require any smali edits, but it may be the overall number is hardcoded somewhere. Even if we can add our own, it will be via apk modification, so the themes will have to be flashed, and compatibility will likely be limited depending on much a given rom has modified their com.htc.res, Prism or Gallery apks. However it ends up working, it certainly won't be as easy as installing a skin apk from the Playstore....part of me suspects this may have been a factor behind HTC's decision to use this integrated theming solution.

I've had a few messages comparing this to the CM Theme chooser. Having never flashed any non-Sense rom, I've no experience of this. Perhaps someone more familiar with Theme chooser could offer some insight?
Well, that's all for now. Apologies for the slightly wordy post, a consequence of me thinking out loud. I will say one more thing though. When Sense 6 first landed, I was not a fan of these new themes at all. But having spent time exploring and getting to know how they work, I actually really like them now. Overall, theming Sense 6 requires less smali edits than Sense 5/5.5 did, and the theme picker aspect is actually quite powerful....how else could you offer 4 variants of a theme so easily. I suspect that it's better for themers like myself, who theme specific roms, than it is for standalone themers.

Happy theming!!
Last edited by fisha21; 29th April 2014 at 01:03 AM.
The Following 33 Users Say Thank You to fisha21 For This Useful Post: [ View ]
28th March 2014, 03:44 AM   |  #2  
fisha21's Avatar
OP Recognized Contributor / Themer
Thanks Meter: 4,079
 
2,234 posts
Join Date:Joined: Nov 2007
Donate to Me
More
reserved for future info
The Following 8 Users Say Thank You to fisha21 For This Useful Post: [ View ]
28th March 2014, 03:44 AM   |  #3  
Raymond Ebertt's Avatar
Recognized Contributor / Themer
Flag Machachai
Thanks Meter: 2,944
 
2,799 posts
Join Date:Joined: Dec 2011
Donate to Me
More
<RESERVED>
Last edited by ApriliaM3; 28th March 2014 at 09:27 AM.
The Following 4 Users Say Thank You to Raymond Ebertt For This Useful Post: [ View ]
28th March 2014, 03:44 AM   |  #4  
Raymond Ebertt's Avatar
Recognized Contributor / Themer
Flag Machachai
Thanks Meter: 2,944
 
2,799 posts
Join Date:Joined: Dec 2011
Donate to Me
More
<RESERVED>
Last edited by ApriliaM3; 28th March 2014 at 09:27 AM.
The Following 5 Users Say Thank You to Raymond Ebertt For This Useful Post: [ View ]
28th March 2014, 03:47 AM   |  #5  
fisha21's Avatar
OP Recognized Contributor / Themer
Thanks Meter: 4,079
 
2,234 posts
Join Date:Joined: Nov 2007
Donate to Me
More
reserved for future info 5
The Following 8 Users Say Thank You to fisha21 For This Useful Post: [ View ]
28th March 2014, 03:52 AM   |  #6  
Pneuma1985's Avatar
Recognized Themer
Flag Around
Thanks Meter: 1,029
 
790 posts
Join Date:Joined: Jan 2011
Donate to Me
More
I'm in "mine"
The Following 5 Users Say Thank You to Pneuma1985 For This Useful Post: [ View ]
28th March 2014, 04:29 AM   |  #7  
Raymond Ebertt's Avatar
Recognized Contributor / Themer
Flag Machachai
Thanks Meter: 2,944
 
2,799 posts
Join Date:Joined: Dec 2011
Donate to Me
More
I'm going to like this.

Sent from my HTC One using xda app-developers app
The Following User Says Thank You to Raymond Ebertt For This Useful Post: [ View ]
28th March 2014, 05:14 AM   |  #8  
Bairdog35's Avatar
Senior Member
Thanks Meter: 250
 
567 posts
Join Date:Joined: Sep 2011
Donate to Me
More
This is awesome, Thank you

Sent from my HTCONE using Tapatalk
The Following User Says Thank You to Bairdog35 For This Useful Post: [ View ]
28th March 2014, 05:56 AM   |  #9  
nashshafrulrezza's Avatar
Senior Member
Flag Johor Bahru
Thanks Meter: 1,437
 
1,959 posts
Join Date:Joined: Jul 2011
Donate to Me
More
I'm disappointed with this new theme engine. 😠

Sent from my HTC One using Tapatalk
The Following User Says Thank You to nashshafrulrezza For This Useful Post: [ View ]
28th March 2014, 06:04 AM   |  #10  
Onepagebook's Avatar
Recognized Themer
Flag Land of Buckeye & Formosa
Thanks Meter: 2,344
 
1,914 posts
Join Date:Joined: Dec 2010
Donate to Me
More
I will be in and watch this, very nice info bro

The Following 2 Users Say Thank You to Onepagebook For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes