本站资源收集于互联网,不提供软件存储服务,每天免费更新优质的软件以及学习资源!

玩转WM5系列智能手机的主题(XML)源文件

手机教程 手机教程 1℃ 0评论

玩转WM5系列智能手机的主题(XML)源文件
  主题是智能手机上才有的东东,它就是手机在桌面上显示的内容,主题一般由主题 XML 文件和图片组成,这些 XML 源文件就保存在手机内储的\ Application Data \ Home 目录下,都为*。xml文件,文件名必须是*。home。xml的形式,如手机默认的简单主题的文件名为: simple.home.xml ,但若将它改写成 simple.xml ,那么在“开始”——“设置”——“主屏幕”里就无法找到 simple. 这个主题了!

XML 文件是由一些代码构成的,所以我们只要大概的明白了这些代码的含义,就可以随心所欲的 DIY 自己的主题了!

首先我们有必要了解 XML 的一些基本规则:

1. XML 文档必须包含在一个单一元素中;

2. XML 元素不能重叠,必须正确的嵌套;

3. 不能省去任何结束标记 , 或者说标记必须成对;

4. XML 元素是区分大小写的,也就是大小写敏感;

5. XML 文档中的属性必须有值,那些值必须用引号括起,可以使用单引号,也可以使用双引号,但要始终保持一致;

6. 如果文档包含 XML 声明,则它一定是第一个出现的东西;

7. XML 注释和 HTML 注释的形式及用法相同,如:

<!– 拆成多个插件块是考虑到各部分的更新频率不一样,拆开后更省电 –>

就表示一个注释。 ]

即: <!– 中间的文字说明就为注释的内容 –>

下面我们先来看一个简单的主题的 XML 源文件,即 simple.home.xml ,首先当然要将智能手机与电脑联机,然后将这个文件从\ Application Data \ Home 目录下复制到电脑上的任意位置,再在这个文件上单击右键,选择用“记事本”方式打开它。

 

当然如果你经常要编辑这些 XML 主题源文件的话建议你设置“始终用记事本这个程序打开这类文件”,如下图所示。

用记事本打开 simple.home.xml 显示如下,我一一来向大家介绍这些代码的含义:

最搞笑是将 <text><carrier/></text>

改成 :     <text lang=”0x0804″> 桃江移不动~联不通 </text>

这样就会在桌面上显示桃江移不动~联不通 , 但是在拨打电话时还是显示你默认的运营商的名字 , 如下图 :

也就是说如果想让手机的桌面和拨打电话窗口都显示其他的名字 , 必须改注册表 , 如果只是想桌面上换一下就用上面的方法可以非常容易的实现了。

附在注册表中修改中国移动为其他名称的方法:

打开注注册表,找到 hkey_local_matchine \ software \ microsoft \ ril \ operatornames 下建一个 string , value name 为 46000,value data 为你要显示的字符串如 ” 中国移动3G网络 ” 。

 

我最喜欢的是 http://www.orchid-soft.com/ 网站上的 Orchid 主题,因为它开放了源代码,我们可以任意的修改和编辑的,下面就来介绍一下这个主题的源文件。我们先必须 gc http://www.orchid-soft.com/html/zuopinxiazai/index.html 下载一个 Orchid 主题的 CAB 格降陌沧拔募⒁獍姹居泻芏嘀郑葑约旱陌醚≡癜桑?J

有一种效果如下:

一种效果如下:

还有一种设置非常方便的:

安装后以后只要任意地再选一个主题,它就会自动加上上面的导航栏——“最近,开始,游戏,附件,插件”,当然还可以分组设置……

任意打开一个 Orchid_full.home.xml 源文件后,如下图:

 

<plugin clsid=” ………… > 与 </plugin> 之间就对应一个插件,要知道这个插件是什么意思,关键的就看 name= ?,如 iconbar 就是电池,信号图标的状态栏; carrier ——移动运营商…………

 

一、以下为手机桌面的最上面一行、显示电池、信号图标的状态栏的代码,一般是源文件里的第一个插件!当然你也可以删除,或者复制这段代码到其他地方。

       <plugin clsid=”{837FC251-FE69-43ad-84E0-EBCEDEBA0884}” name=”iconbar” height=”27″>      

<iconbar fgcolor=”COLOR_TRAYTEXT”/>

       <background gradient=”title” bgcolor=”COLOR_TRAYGRADLEFT” b-border-color=”COLOR_WINDOWFRAME” />        </plugin>

 

 

二、以下为显示移动运营商的代码:

       <plugin clsid=”{E09043DF-510E-4841-B652-388316977A7A}” name=”carrier” height=”27″>

              <allowselection/>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <label font-weight=”bold”>

                     <text><carrier/></text>

              </label>

       </plugin>

 

三、以下为显示时间的代码 :

<plugin clsid=”{AFC6BAE1-194B-487c-856C-70C540EFD189}” name=”calender”>

              <background padding-bottom=”0″ b-border-width=”0″/>

              <label align=”left” valign=”top” font-size=”44″ font-width=”12″ cleartype=”true” shadow=”true” color=”#36FF1A”>

                     <format state=”selected” bgcolor=”transparent” font-underline=”true”/>

                     <shortcut lang=”0x0804″ cmd=”ShowInfo” title=” 系统信息 “/>

                     <text><hour/>:<minute len=”2″ leadzero=”true”/>:<second len=”2″/></text>

              </label>

              </plugin>

这里要重点说明一下 :

这个插件的关键语句显然是 <text><hour/>:<minute len=”2″ leadzero=”true”/>:<second len=”2″/></text> ,其中 <second len=”2″/> 是我加上去的,它的作用就是显示秒钟,不过听说这样会比较耗电! len=”2″ 如果改成 len=”1″ ,那么就会由 8:08:08 变成 8: 8: 8 ,就是位数的意思。当然如果秒数有两位,比如说是 18 秒, len=”1″ 也会显示成 18 的。

: 可以改成其他的字符,如 * , # ,时,分,秒。看图:

上面的 <label align=”left” valign=”top” font-size=”44″ font-width=”12″ cleartype=”true” shadow=”true” color=”#36FF1A”> 这一段代码显然是控制时钟,分钟,秒钟的字体大小 font-size 、宽度 font-width 、阴影 shadow 、颜色 color 的。这个可以任意的设置,自己多改几次对照一下就会出效果的!

关于颜色的代码,可以访问下面这个网页,非常的棒,偶一直在用的,当然将这个网页保存了: http://www.cclw.net/resources/CheckColor/CheckColor.htm

四、以下为通话中的桌面显示代码:

       <plugin clsid=”{37391041-C324-4725-BEE1-3232ED3539CA}” name=”callprog” height=”48″>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <format state=”nocall” visible=”false”/>

              <label>

                     <text lang=”0x0409″>Call in progress:</text>

                     <text lang=”0x0404″> 通話中 :</text>

                     <text lang=”0x0804″> 嘻嘻,广大 Lqem ,你的手机正在通话中哦 …</text>

              </label>

              <label y=”23″>

                     <text><progress/></text>

              </label>

       </plugin>

显然, <format state=”nocall” visible=”false”/> 这段代码的意思就是当不是在通话中时,这个提示就不会出现的.

五、以下为未接电话的代码:

<plugin clsid=”{0BA8ABB8-1F1D-417f-88C6-DA8530E2E7A6}” name=”missedcalls” height=”24″>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <format state=”nocall” visible=”false”/>

              <label h=”22″>

                     <text lang=”0x0409″>Missed calls: <calls/></text>

                     <text lang=”0x0404″> 未接來電 : <calls/></text>

                     <text lang=”0x0804″> 嘻嘻,广大 Lqem ,你有未接电话哦 : <calls/></text>

              </label>

       </plugin>

 

六、以下为全天事件的代码:

       <plugin clsid=”{2FFD93B3-0FF0-4228-A6D6-D2DF177D7D92}” name=”alldayevent” height=”24″>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <format state=”noevent” visible=”false”/>

              <label h=”22″>

                     <text><subject/></text>

              </label>

       </plugin>

同样的, <format state=”noevent” visible=”false”/> 这段代码表示,当没有设置全天事件时,它不会显示 ~

  七、以下代码表示桌面上被选择文字的颜色:

       <plugin clsid=”{4e822425-a00f-497c-80ff-1c554665a369}” name=”cooltext” height=”20″>

              <scrolltext textsource=”cellbroadcast”/>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

            </background>

       </plugin>

  八、以下代码为 Orchid 主题的精华所在,本人觉得非常的实用,不过它本身的排版不是很合理,

字体较小,颜色偶也不满意,所以就这些代码改得面目全非后,终于弄好了,即将关键性的文字放到了左边 , 效果如下图 :

代码如下 :

<plugin clsid=”{AFC6BAE1-194B-487c-856C-70C540EFD189}” name=”info”>

              <background padding-top=”0″/>

              <label align=”left” font-size=”24″ font-width=”5″ fgcolor=”#FFFFF0″

cleartype=”true”>

                     <text lang=”0x0804″><battery/>% ★ <storageload op=”x-” opnum=”100″/>%</text>

                     <text lang=”0x0404″> 電池 :<battery/>%<temperature invalid=”0″ ls=” ”

rs=” ℃ “/><space/> 信號 :<signal/>%<space/> 記憶 :<memoryload op=”x-” opnum=”100″/>%<space/> 存

儲 :<storageload op=”x-” opnum=”100″/>%</text>

              </label>

<label y=”24″ align=”left” font-size=”21″ font-width=”5″ color=”#FF27FF”>

              <text lang=”0x0804″><month/> 月 <day/> 日 </text>

                     <text lang=”0x0404″><year/>-<month/>-<day/><space/> 星期

<cweek/><space/><xingzuo/></text>

</label>

<label y=”45″ align=”left” font-size=”21″ font-width=”6″ color=”#56FFFF”>

              <text lang=”0x0804″> 星期 <cweek/></text>

                     <text lang=”0x0404″><year/>-<month/>-<day/><space/> 星期

<cweek/><space/><xingzuo/></text>

</label>

       <label y=”66″ align=”left” font-size=”21″ font-width=”4″ color=”#118FFF”>

                     <text lang=”0x0804″><lmonth/><lday/><jieqi ls=” “/></text>

                     <text lang=”0x0404″><shengxiao/> 年 <space/><lmonth/><space/><lday/><jieqi

ls=” “/></text>

              </label>

              </plugin>

唉 , 这里要说明的东东太多了 , 我只简单的介绍一下 , 自己慢慢去 DIY 吧 ,

<label y=”45″ align=”left” font-size=”21″ font-width=”6″ color=”#56FFFF”>

显然是控制字体的的垂直位置 y=”45″ ,水平位置 align, 大小 font-size, 宽度 font-width, 颜色 fgcolor 的 .

<battery/>% ★ <storageload op=”x-” opnum=”100″/>% 表示手机的剩余电量和剩余存储量 .

<text lang=”0x0804″><year/> 年 <month/> 月 <day/> 日 </text> 显然表示年月日 , 其中年月日可以用其他字符表示 , 如-,/……●■▲,反正只要自己明白就行。

<text lang=”0x0804″> 星期 <cweek/><space/><xingzuo/></text>  表示星期和星座,其中星期可以改成“周”。

<text lang=”0x0804″><shengxiao/> 年 <space/><lmonth/><space/><lday/><jieqi ls=” “/></text>

分别表示生肖(如猪年),农历(如十一月大十九),节气。另外 lmonth 标签可以改成 lleapmonth, lshortmonth, lmonthlen 中的任何一个~效果我懒得说了,自己去改。

 

九、以下为情景模式的代码:

<plugin clsid=”{95976968-45D5-40c9-9779-2B859B1C2FEC}” name=”profile” height=”24″>

                     <label>

                     <text lang=”0x0409″>Profile: <profile/></text>

                     <text lang=”0x0404″> 操作模式 : <profile/></text>

                     <text lang=”0x0804″> 多普达 596 ,这里的文字可以任意修改 : <profile/></text>

              </label>

       </plugin>

 

十、以下为日程提醒的代码:

<plugin clsid=”{865A354A-4A96-4687-B001-C155DC0DBE76}” name=”calendar” height=”24″>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <label h=”22″>

                     <text><subject/> ◆ <time/> <location/></text>

              </label>

       </plugin>

如果将 <background><format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background> 这一段去掉的话,选中日程提醒就不会有背景了!其他的类似!

这里本身显示两行的(即一行日程提醒的内容,一行是日程提醒的时间),我修改了一下,变成一行了 ~

 

十一、以下为 Orchid Home 快捷方式插件代码(显然我作了改动  ^_^ ):

       <plugin clsid=”{AFC6BAE1-194B-487c-856C-70C540EFD189}” name=”header” b-border-width=”0″ padding-bottom=”0″>

              <shortcutbar icon-spacing=”3″ mode=”title”>

                     <format state=”selected” bgcolor=”transparent” fgcolor=”#FC6450″/>

                     <shortcut lang=”0x0804″ title=”EM” desc=” 全部 ” relbar=”list” relgroup=”0″/>

                     <shortcut lang=”0x0804″ title=” 地球 ” relbar=”list” relgroup=”1″/>

                     <shortcut lang=”0x0804″ title=” 中国 ” relbar=”list” relgroup=”2″/>

                     <shortcut lang=”0x0804″ title=” 湖南 ” relbar=”list” relgroup=”3″/>

                     <shortcut lang=”0x0804″ title=” 益阳 ” relbar=”list” relgroup=”4″/>

                     <shortcut lang=”0x0804″ title=” 桃江 ” relbar=”list” relgroup=”5″/>

                     <shortcut lang=”0x0804″ title=” 鲊埠 ” relbar=”list” relgroup=”6″/>

                     <shortcut lang=”0x0404″ title=” 全 ” desc=” 全部 ” relbar=”list” relgroup=”0″/>

                     <shortcut lang=”0x0404″ title=” 系統 ” relbar=”list” relgroup=”1″/>

                     <shortcut lang=”0x0404″ title=” 工具 ” relbar=”list” relgroup=”2″/>

                     <shortcut lang=”0x0404″ title=” 程式 ” relbar=”list” relgroup=”3″/>

                     <shortcut lang=”0x0404″ title=” 媒體 ” relbar=”list” relgroup=”4″/>

                     <shortcut lang=”0x0404″ title=” 遊戲 ” relbar=”list” relgroup=”5″/>

                     <shortcut lang=”0x0404″ title=” 網路 ” relbar=”list” relgroup=”6″/>

              </shortcutbar>

       </plugin>

 

十二、以下为快捷方式文字说明的代码:

<plugin clsid=”{AFC6BAE1-194B-487c-856C-70C540EFD189}” name=”shortcut” padding-top=”1″ padding-bottom=”0″>

              <shortcutbar icon-spacing=”3″ icon-size=”small” mode=”icon” name=”list” grouped=”true” autosort=”true” last

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              <!– 快捷组支持 shortcut 直接指定文件和 shortcutdir 指定目录下所有文件两种方式,

         为了方便定制,这里使用 shortcutdir 来指定快捷方式目录,两种方式可以混合使用。

         如果需要指定快捷方式顺序或自己组织分组,可参考下面 shortcut 标签的例子。

                     <shortcut title=” 媒体播放器 ” target=”WMPlayer.lnk” group=”4″/>

                     <shortcut title=”Active 同步 ” target=”repllog.exe” args=”/remote” group=”6″/>

                     <shortcut target=”InstMsgr.exe” group=”6″/>

                     <shortcut target=”iexplore.exe” group=”6″/>

              –>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart Menu” subdir=”false” group=”1″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart Menu 系统 ” subdir=”true” group=”1″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart Menu 工具 ” subdir=”true” group=”2″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart MenuAccessories” subdir=”true” group=”2″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart Menu 程序 ” subdir=”true” group=”3″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart Menu 媒体 ” subdir=”true” group=”4″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart MenuGames” subdir=”true” group=”5″/>

                     <shortcutdir lang=”0x0804″ dir=”windowsStart Menu 网络 ” subdir=”true” group=”6″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart Menu” subdir=”false” group=”1″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart Menu 系統 ” subdir=”true” group=”1″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart Menu 工具 ” subdir=”true” group=”2″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart MenuAccessories” subdir=”true” group=”2″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart Menu 程式 ” subdir=”true” group=”3″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart Menu 媒體 ” subdir=”true” group=”4″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart MenuGames” subdir=”true” group=”5″/>

                     <shortcutdir lang=”0x0404″ dir=”windowsStart Menu 網路 ” subdir=”true” group=”6″/>

              </shortcutbar>

       </plugin>

 

十三、以下为短信、彩信、电子邮件的代码:

<plugin clsid=”{8486CC1E-025B-4888-9C76-048DF7C1787D}” name=”msgcount2″ height=”25″ autoheight=”false”>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <mail account=”sms”/>

       </plugin>

       <plugin clsid=”{8486CC1E-025B-4888-9C76-048DF7C1787D}” name=”msgcount2″ height=”25″ autoheight=”false”>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <mail account=”activesync”/>

       </plugin>

       <plugin clsid=”{8486CC1E-025B-4888-9C76-048DF7C1787D}” name=”msgcount2″ height=”25″ autoheight=”true”>

              <text padding-bottom=”5″/>

              <background>

                     <format state=”selected” bgcolor=”COLOR_HOMEHIGHLIGHT”/>

              </background>

              <mail account=”others”/>

       </plugin>

 

十四、以下为 Orchid Home 的节日插件:

       <plugin clsid=”{AFC6BAE1-194B-487c-856C-70C540EFD189}” name=”holiday”>

              <background padding-top=”0″ padding-bottom=”0″ b-border-width=”0″ />

              <label align=”right” ellipsis=”true”>

                     <text lang=”0x0804″><holiday ls=” 今日 “/><holiday sday=”1″ ls=” 明日 “/><holiday sday=”2″ eday=”6″ incdate=”true” ls=” “/></text>

                     <text lang=”0x0404″><holiday ls=” 今日 “/><holiday sday=”1″ ls=” 明日 “/><holiday sday=”2″ eday=”6″ incdate=”true” ls=” “/></text>

              </label>

       </plugin>

 

十五、以下为 Orchid Home 的倒计时插件:

       <plugin clsid=”{AFC6BAE1-194B-487c-856C-70C540EFD189}” name=”downcounter”>

              <background padding-top=”0″ padding-bottom=”0″ b-border-width=”0″ />

              <label align=”right” ellipsis=”true” color=”#4800d3″>

                     <text lang=”0x0804″><downtext refname=”” ls=” ★★距离 ” rs=” 还有 “/><downday refname=”” invalid=”0″ isend=”true” ls=”” rs=” 天 “/></text>

                     <text lang=”0x0404″><downtext refname=”” ls=” 距離 ” rs=” 還有 “/><downday refname=”” invalid=”0″ isend=”true” ls=”” rs=” 天 “/></text>

              </label>

       </plugin>

这两个都可以在 Orchid Home 里设置的,具体的方法为,当摇杆上下移动到时间上时,出现下划线,再按确定键,就可以设置了。如图:

 

最后还有一点要说明的:主题文件中 <scheme> 与 </scheme> 之间的就是配色文件,这里截了图,来源: http://www.wmpol.com/viewthread.php?tid=20733&extra=page%3D2

 

呵呵,当然关于插件的代码远远不止这些,由于本人水平有限,就提供这么多,大家以后还可以在友人网 596 的论坛里找我交流的 ~~

今天 ( 二○○七年元月七日 ) 刚好是偶买多普达 596 三个月的日子,特写此文章作纪念,希望对一些刚刚开始玩智能手机的友人有一点点帮助 ~~~

End!

全文完.

 

转载请注明:范的资源库 » 玩转WM5系列智能手机的主题(XML)源文件

喜欢 (0)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址