Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,808,657 Members 43,211 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] HTC Sense 6 built-in themes

Tip us?
 
fisha21
Old
(Last edited by fisha21; 29th April 2014 at 12:03 AM.)
#1  
fisha21's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 3,979
Posts: 2,204
Join Date: Nov 2007

 
DONATE TO ME
Default [GUIDE] HTC Sense 6 built-in themes

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!!
The Following 32 Users Say Thank You to fisha21 For This Useful Post: [ Click to Expand ]
 
fisha21
Old
#2  
fisha21's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 3,979
Posts: 2,204
Join Date: Nov 2007

 
DONATE TO ME
reserved for future info
The Following 8 Users Say Thank You to fisha21 For This Useful Post: [ Click to Expand ]
 
Raymond Ebertt
Old
(Last edited by ApriliaM3; 28th March 2014 at 08:27 AM.)
#3  
Raymond Ebertt's Avatar
Recognized Contributor / Themer
Thanks Meter 2,754
Posts: 2,667
Join Date: Dec 2011
Location: Machachai

 
DONATE TO ME
<RESERVED>

The Following 4 Users Say Thank You to Raymond Ebertt For This Useful Post: [ Click to Expand ]
 
Raymond Ebertt
Old
(Last edited by ApriliaM3; 28th March 2014 at 08:27 AM.)
#4  
Raymond Ebertt's Avatar
Recognized Contributor / Themer
Thanks Meter 2,754
Posts: 2,667
Join Date: Dec 2011
Location: Machachai

 
DONATE TO ME
<RESERVED>

The Following 5 Users Say Thank You to Raymond Ebertt For This Useful Post: [ Click to Expand ]
 
fisha21
Old
#5  
fisha21's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 3,979
Posts: 2,204
Join Date: Nov 2007

 
DONATE TO ME
reserved for future info 5
The Following 8 Users Say Thank You to fisha21 For This Useful Post: [ Click to Expand ]
 
Pneuma1985
Old
#6  
Pneuma1985's Avatar
Recognized Themer
Thanks Meter 1,001
Posts: 772
Join Date: Jan 2011
Location: Around

 
DONATE TO ME
I'm in "mine"
HTC One M8: Rooted S-off Sense 6.0 : HTC One M7: Rooted S-off Sense 6.0 port : Htc Evo 4g Lte: Rooted S-off sense 5.5 port


[/CENTER]
The Following 5 Users Say Thank You to Pneuma1985 For This Useful Post: [ Click to Expand ]
 
Raymond Ebertt
Old
#7  
Raymond Ebertt's Avatar
Recognized Contributor / Themer
Thanks Meter 2,754
Posts: 2,667
Join Date: Dec 2011
Location: Machachai

 
DONATE TO ME
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: [ Click to Expand ]
 
Bairdog35
Old
#8  
Bairdog35's Avatar
Senior Member
Thanks Meter 250
Posts: 555
Join Date: Sep 2011

 
DONATE TO ME
This is awesome, Thank you

Sent from my HTCONE using Tapatalk
The Following User Says Thank You to Bairdog35 For This Useful Post: [ Click to Expand ]
 
nashshafrulrezza
Old
#9  
nashshafrulrezza's Avatar
Senior Member
Thanks Meter 1,433
Posts: 1,946
Join Date: Jul 2011
Location: Johor Bahru

 
DONATE TO ME
I'm disappointed with this new theme engine. 😠

Sent from my HTC One using Tapatalk
I'm Nash, Team420 Members and BadSeed's Beta Tester.

The Following User Says Thank You to nashshafrulrezza For This Useful Post: [ Click to Expand ]
 
Onepagebook
Old
#10  
Onepagebook's Avatar
Recognized Themer
Thanks Meter 2,295
Posts: 1,891
Join Date: Dec 2010
Location: Land of Buckeye & Formosa

 
DONATE TO ME
I will be in and watch this, very nice info bro

The Following 2 Users Say Thank You to Onepagebook For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes