[XPERIA X10 Themes and Apps] _calum_:
For 2.1 themes see post #17 on page 2: http://xdaforums.com/showpost.php?p=9049613&postcount=17

I decided to open a thread to share the knowledge I have collected on timescape themes. This also partially applies to mediascape and up until now has been split between these two threads:

http://xdaforums.com/showthread.php?t=737778&page=46

http://xdaforums.com/showthread.php?t=765686 Please read this!

I thought it would be better to combine this into one thread that will be easier to find. If anyone disagrees then please post with reasons and alternatives. I will update this first post as we figure out more tweeks etc. (hopefully it will need a big rework soon because SE finally gets us 2.1 :) )

Before I start, thanks to Chewitt for finding the acet files, and for inspiring me to start messing with the look of my x10 with his Dark10 themes.

Timescape (and mediascape) do not store all of their images in the .apk resources. Oh no, that would just be too logical, and we are talking about Sony Ericsson here ;)

The timescape theme .apk resources do contain some of the images used (e.g. the trash can and app drawer handles), and the actual Timescape .apk has the resources for the tile images etc. I'm not going to go into this as there is enough content about modifying these sorts of resources here. What I will go into is where the timescape background, wave animation, pagination slider colours and the tile alpha blending and default colours.

1. The background: This is stored in an .acet file (see the first of the above posts). This is an file that basically just contains a samll header and then rgb information (or sometimes argb, this is specified in the header which I haven't got 100% sussed yet). The background images are in the assets/ts folder in the theme .apk and are called ts_bg_app.acet and ts_bg_home.acet for the application and timescape home respectively. These can be modified with acetConverter.exe. You can load an image and export an acet file or you can go the other way. TS uses acet backgrounds without an alpha channel so leave the alpha checkbox unticked when creating them (it might work with alpha... never tried...).

2. The Tiles: I'm pretty sure the alpha blend images for the tiles are found in the system/usr/semc/seee/files folder (alpha_tile.acet and alpha_tile_fade*.acet) but I haven't modified these yet. As an aside the background for the first page of mediascape is here too. More important is the default background for a tile. This file, ts_tile_empty.acet, is a single pixel file found in the assets/ts folder for each theme. This specifies the solid colour to be used as a background for the alpha overlay on empty tiles.

3. Animation files: Wave and Pagination. This is all stored in three .afx java animation files in the themes assets/ts folder (ts_bg_wave.afx, pagination_glow.afx and pagination_area.afx). pagination_area is the square around the selected item in the scroll menu at the bottom (or the top if TS is the home page) and pagination_glow defines the lines at the top and bottom of this area. I haven't got these files fully sussed either, at the moment I'm restricted to doing some awful byte replacement to change the color (I can also change the wave pitch, but it doesn't look any good). I have attached an exe to generate these files (SetTimescapeAnimationColor.exe). Click on the white square to choose a base color and use the buttons to generate whichever of the files you want. If anyone knows how to edit these files properly please let me know, I come from a c# and c++ background and don't really know what I'm doing with java...

Thats pretty much it. Just sort out 6 files, update the png resources (the thumbnails for the theme selection are in the Timescape.apk resources folder) and you're done.

Note: I have had problems when I modified the wrong bytes in the afx files. Basically, after selecting the theme timescape just crashed. If you replace the theme file it still won't start, you need to clear the application data to get it running again. Along the same lines, after modifying a theme you need to reselect it from the themes menu as the files are cached.

Please let me know if I missed anything.

Update: I have attached the source code for the animation color tool. Please keep in mind that this was just a bit of code quickly thrown together so we can modify the animation color, I don't usually write code that looks like that :o

The project is a C# project from visual studio 2010 but the meat of it is in MainForm.cs so just open that if you use a different language/dev environment.

Here is the code from one of the buttons. Resources.pagination_glow is a byte array from an embedded resource (pagination_glow.afx).

string r = string.Format("{0:000}", (int)(((double)colorPanel.BackColor.R / 255.0) * 100));
string g = string.Format("{0:000}", (int)(((double)colorPanel.BackColor.G / 255.0) * 100));
string b = string.Format("{0:000}", (int)(((double)colorPanel.BackColor.B / 255.0) * 100));

byte[] bytes = new byte[Resources.pagination_glow.Length];
Array.Copy(Resources.pagination_glow, bytes, Resources.pagination_glow.Length);

bytes[949] = (byte)r[0];
bytes[950] = (byte)'.';
bytes[951] = (byte)r[1];
bytes[952] = (byte)r[2];
bytes[953] = (byte)',';
bytes[954] = (byte)g[0];
bytes[955] = (byte)'.';
bytes[956] = (byte)g[1];
bytes[957] = (byte)g[2];
bytes[958] = (byte)',';
bytes[959] = (byte)b[0];
bytes[960] = (byte)'.';
bytes[961] = (byte)b[1];
bytes[962] = (byte)b[2];
bytes[963] = (byte)',';

using (FileStream stream = new FileStream(saveDialog.FileName, FileMode.Create))
{
stream.Write(bytes, 0, bytes.Length);
}

What is important to note is that the embedded afx resources came from the orange theme, the other themes will require different offsets for the byte modification. I'm not sure why the different themes have different code here, I haven't looked closely at the wave animation code for each theme so there may only be a difference there, or there could just be one more space here and there in the preceeding lines or four spaces instead of a single byte tab ('\t')...

Anyway, the next step is to try and modify the number of bytes in the code and see if it still works, on my first few tests timescape just crashed so I thought that the number of bytes of clear-text code may be stored in the header. I'm not so sure now as I think I may have just been having problems while mixing the use of the .Net stream classes for reading an writing. I'll check this out though.

If we can modify the code however we want then I just need to learn a bit more java ;)

The code for the wave animation is in the comments at the bottom of MainForm.cs. Here is the line with the characters being modified in bold:

fcolor.rgb = vec3(1.0, 0.91, 0.72) * ambientRatio + vec3(1.0, 0.516, 0.0) * specularRatio;