近期米青给大家带来锁屏密码系统验证代码,设定系统锁屏密码的用户终于可以不用二次密码解锁了(数字密码) 这给锁屏密码带来非常大的实用性,终于可以摆脱主题锁屏密码部分样子货的境地,虽然还仅限数字密码,但还是一项很大的进步,不禁要给主题组一个大大的赞。 通过阅读米青发布的示例代码,发现有很多可取和新特性,故专门贴出我的第三篇代码笔记,只期对一些人对于此段代码的理解有所帮助,同时理解能力有限,错误难免,敬请斧正。解读代码,也请勿忘见怪。 代码附件出处使用系統密码的个性化密码输入界面,如果链接失效,请在论坛中搜索”使用系统密码的个性化密码输入界面“ 代码当中有诸多动画,如果理解有困难可以略过,动画的作用仅是锦上添花,而非必须,就看动画最后的数值就好。 1.代码中出现了一个新的全局变量#_password_mode。它的值为0就表示系统未设定数字密码。值为1表示,系统存在数字密码,值为-1表示锁定,当然如果系统设定的是混合密码或是图案密码它的值为0,这方面希望主题组能在以后给大家带来更多的惊喜。 2.元素数组(Array),属性有:name,x,y,count,indexName。count表示元素重复次数,indexName与变量数组中的index类似,组标。这个东西有什么作用呢,其实是简化了有规律重复元素的编写。 主要代码如下:<Array name="" x="" count="" indexName="" >3.数字数组(number[]),定义一个数字数组只需在普通数字变量类型中加入type="number[]" 同时指定指定数量size,组标index,数组赋值时需分别赋值。 主要代码如下: 定义:<Var name="" type="number[]" size="" const="true" index="" expression=""/>4.命令集(MultiCommand)可以把诸多命令放在里面,统一命令的执行判断条件(condition) 主要代码如下:<MultiCommand condition=""> <VariableCommand name="" expression="" type=""/> <MethodCommand target="" method="performAction" paramTypes="String" params="''"/>5.组操作集,可将triggers(触发集)放置组中,触发集中除可包含已知动作up,down,double,cancel等外,还可自定义动作名,以备其他地方调用。调用方法:MethodCommand taget="组操作集名" method="performAction" paramTypes="String" params="'动作名(包含自定义)'" /> 此组操作集对于代码的书写和理解调用等带来了极大的便利。主要代码如下: 定义:<Group name=""> <Triggers>调用:MethodCommand target="" method="performAction" paramTypes="String" params="''" />6.解锁数字密码验证命令(UnlockVerifyPasswordCommand ),属性有password字符串类型,enable支持类型(1即为数字型密码)包含触发动作验证成功(success),验证失败(fail),特别指出的是,密码是字符串型,验证锁定次数取决于系统设定。多次验证失败后将调出系统验证解锁,直至锁定。这个命令也是此篇代码的核心所在,主要代码如下:<UnlockVerifyPasswordCommand password="" condition="" unlockDelay="" enable="1"> <Triggers> <Trigger action="success"> ...... </Trigger> 写在最后,主题的锁屏密码其实表大于实,主要原因是过去的锁屏密码很容易被绕过,同时和系统解锁密码可能会产生重复,带来诸多尴尬。但此次主题组给锁屏密码带来了新的实用化的特性,虽然还是不够全面,但还是值得一些编写过锁屏密码主题制作者学习的。主题组编写的代码本身不是特别难以理解,但是带来的新的元素数组,组操作集等对于简化代码的编写和理解意义还是很大的。值得理解、学习和运用。同时大量的动画的加入使得解锁界面动感十足,我想对于主题市场ios类型主题锁屏密码泛滥的今天,还是很有借鉴意义。
2015年07月02日
bynewspower
大家好,我是本初,本次是专题代码演示的第一部分,其他新奇好玩的解锁方式将陆续贴在论坛里。很多人觉官方miui v6 锁屏的解锁方式很方便,全屏四向解锁。实现起来也不是难事,以下代码时候有一些maml代码基础的人阅读,当然大神可以略过,还很肤浅,就不解释了,相信写过代码的人都能看懂,只是提供一点思路。以下为定义,具体应用还需配合解锁滑块,欲观摩实际效果可以试用我上线的测试主题。可以在主题市场搜本初,若馨 绿韵 就是,基本没人用,呵呵,算是增添些人气也好。<?xml version="1.0" encoding="UTF-8"?><!-- edit by 本初 2015.6 --><Lockscreen version="1" frameRate="30" screenWidth="720" displayDesktop="true" showSysWallpaper="true"> <Wallpaper /> <Button name="test_btn" x="0" y="0" w="720" h="1280"> <Triggers> <Trigger action="down"> <!-- /> --> <VariableCommand name="click_time_begin" expression="#time_sys" /> <VariableCommand name="click_judge" expression="0" /> <VariableCommand name="click_judge_40" expression="0" /> <VariableCommand name="long_click_judge" expression="0" /> <VariableCommand name="time10_touch_x" expression="#touch_begin_x"/> <VariableCommand name="time10_touch_y" expression="#touch_begin_y"/> </Trigger> <Trigger action="up"> <VariableCommand name="click_time_over" expression="#time_sys" /> <VariableCommand name="click_judge" expression="ge(#click_time,30)*le(#click_time,300)" /> <VariableCommand name="click_judge_40" expression="le(#click_time,40)" /> <VariableCommand name="long_click_judge" expression="gt(#click_time,5000)" delay="100" /> <!-- --> </Trigger> <Trigger action="double"> <ExternCommand command="unlock" /> </Trigger> </Triggers> </Button> <Var name="click_time_begin" expression="#time_sys" const="true" /> <Var name="click_time_over" expression="#time_sys" /> <Var name="click_time" expression="#click_time_over-#click_time_begin" /> <Var name="click_judge" expression="0" const="true"/> <Var name="click_judge_40" expression="0" const="true"/> <Var name="long_click_judge" expression="0" const="true"/> <Var name="unlock_click" expression="ifelse((#touch_dist-30),0,1)" /> <Var name="up_unlock" expression="lt(abs(#time10_touch_x-#touch_begin_x),(#touch_begin_y-#time10_touch_y))" /> <Var name="down_unlock" expression="lt(abs(#time10_touch_x-#touch_begin_x),(#time10_touch_y-#touch_begin_y))" /> <Var name="left_unlock" expression="lt(abs(#time10_touch_y-#touch_begin_y),(#touch_begin_x-#time10_touch_x))" /> <Var name="right_unlock" expression="lt(abs(#time10_touch_y-#touch_begin_y),(#time10_touch_x-#touch_begin_x))" /> <Var name="time10_touch_x" expression="0" const="true" /> <Var name="time10_touch_y" expression="0" const="true" /> <Var name="touch_dist" expression="abs(#touch_x-#touch_begin_x)+abs(#touch_y-#touch_begin_y)" /> <Var name="unlock_judge" expression="min(#touch_dist,40)" threshold="30"> <Trigger> <VariableCommand name="time10_touch_x" expression="#touch_x"/> <VariableCommand name="time10_touch_y" expression="#touch_y"/> </Trigger> </Var> <Text x="100" y="440" color="#ffff00" size="40" textExp="'up_unlock'+#up_unlock"/> <Text x="100" y="480" color="#ffff00" size="40" textExp="'down_unlock'+#down_unlock"/> <Text x="100" y="520" color="#ffff00" size="40" textExp="'left_unlock'+#left_unlock"/> <Text x="100" y="560" color="#ffff00" size="40" textExp="'right_unlock'+#right_unlock"/> <Text x="100" y="600" color="#ffff00" size="40" textExp="'click_time'+#click_time"/> <Text x="100" y="640" color="#ffff00" size="40" textExp="'long_click_judge'+#long_click_judge"/> <Text x="100" y="680" color="#ffff00" size="40" textExp="'click_judge'+#click_judge"/> <Text x="100" y="720" color="#ffff00" size="40" textExp="'click_judge_40 '+#click_judge_40"/> <Text x="360" y="1220" align="center" color="#ffffff" size="40" textExp="'双击解锁屏幕'"/> </Lockscreen> 写在最后,我为什么写这些? 只是想提供些思路,主题市场里的主题杂而多,但有新意的很少,看下热销排行榜可以看到模仿ios,wp之风盛行,其实小米自身的解锁和操作逻辑非常棒,很有必要发扬和拓展。勇敢做自己才更显高贵,手机也是。虽然我很厌恶抄袭,但我不介意把自己的思路共享出来,我觉得原创和专注是一款主题的魂,它是应该有灵气和灵魂的。好,说的废话太多,下次见!
2015年07月02日
bynewspower
大家好,我是本初,本次我给大家带来了解锁系列专题的第二篇,曲线路径解锁,定义一段曲线路径,然后让滑块沿路径解锁。 效果图如下: 本示例适合稍微有一定代码基础的人参考,因所涉及的部分代码wiki上可能没有,可参阅论坛里的教程。曲线路径解锁炫酷性大于实用性,不过选择好适当的曲线方程,解锁效果还是不错的,炫酷的效果取决于选择的曲线方程表达式。这是我解锁系列教程的第二篇,第一篇为类miui6全屏四向解锁,旨在为主题制作者提供些参考,毕竟主题市场中的解锁方式好多都是千篇一律,需要有所创新。当然本篇教程所实现的效果肯定还有其他的更简单的实现方式,但本文注重的是通用性,即曲线路径解锁类的通用示例,可以通过定义不同的曲线方程实现不同的路径解锁,简单示例,疏漏较多,若旦采用,多加测试。示例代码如下:<?xml version="1.0" encoding="UTF-8"?><!-- 曲线路径解锁演示 --><Lockscreen frameRate="60" screenWidth="720" > <ExternalCommands> <Trigger action="resume,pause"> <VariableCommand name="re_flag" expression="0" const="true" /> <VariableCommand name="touch_flag" expression="1" const="true" /> </Trigge> </ExternalCommands> <Rectangle w="720" h="1280" fillColor="#009688" /><!-- 解锁滑块按钮 --> <Button x="#graph_x" y="#graph_y" align="center" alignV="center" w="300" h="300"> <Triggers> <Trigger action="down"> <Command target="graph_x_ani.animation" value="play" /> <VariableCommand name="re_flag" expression="1" /> <VariableCommand name="touch_flag" expression="1" /> </Trigger> <Trigger action="up,cancel"> <VariableCommand name="touch_x_final" expression="#touch_x" const="true" /> <VariableCommand name="touch_flag" expression="0" /> </Trigger> </Triggers> </Button> <!-- 绘制一个圆,并将它的坐标关联到抛物曲线上 作为解锁滑块 --> <Circle x="#graph_x" y="#graph_y" r="60" fillColor="#00ff00" /> <!-- 定义x与t的线性关系,每一秒x的值变化200 用于滑块回弹运动 --> <Var name="graph_x_ani"> <VariableAnimation initPause="true" loop="false" > <AniFrame value="0" time="0" easeType="CubicEaseIn" /> <AniFrame value="-720" time="3600"/> </VariableAnimation> </Var> <!-- 抛物线曲线表达式--> <Var name="graph_y" expression="#a2-#b2+980" /> <Var name="a2" expression="#graph_x*#graph_x/360" /> <Var name="b2" expression="2*#graph_x" /> <!-- 可以定义任何你指定的曲线表达式 --> <!-- 指定曲线横坐标变化范围100-620 --> <Var name="graph_x" expression="ifelse(#graph_x_f-100,min(620,#graph_x_f),100)" /> <Var name="graph_x_f" expression="#re_flag*((#touch_flag*#touch_x+not(#touch_flag)*#touch_x_final)+not(#touch_flag)*#graph_x_ani)" /> <!-- 圆形滑块横坐标达到预定区域解锁,可以设置判断条件,这里直接解锁 --> <Var name="unlock_judge" expression="ge(#graph_x,615)" threshold="1" > <Trigger> <ExternCommand command="unlock" /> </Trigger> </Var> <!-- 绘制解锁路径,当然最好是用绘图软件提前按照曲线表达式绘出,这里为了表达,我采用的是代码生成的路径虚线 --> <Group frameRate="0" x="100" w="520" h="1280" clip="true" > <Array name="describe_graph" count="40" indexName="a" > <Var name="graph_x1" type="number[]" size="40" index="#a" expression="#a*18" /> <Var name="a1" type="number[]" size="40" index="#a" expression="#graph_x1[#a]*#graph_x1[#a]/360" /> <Var name="b1" type="number[]" size="40" index="#a" expression="#graph_x1[#a]*2" /> <Var name="graph_y1" type="number[]" size="40" index="#a" expression="#a1[#a]-#b1[#a]+980" /> <Circle x="#graph_x1[#a]-100" y="#graph_y1[#a]" r="5" fillColor="#00ff00" /> </Array> <Group> <Text x="360" y="1220" align="center" color="#ffffff" size="40" textExp="'沿路径滑动以解锁'"/></Lockscreen>另有附件,可直接套用,观摩效果。MI_20150630_121457.png 曲线解锁.zip
2015年07月01日
最新稳定版中动画增加了新功能(是的,新功能早就在开发版里了,但是没进稳定版是不能写教程的,我也想让大家早点学会新功能,可是代码过早流传开会导致不明真相的制作者辛辛苦苦做完主题发现在稳定版上不能用... )1. 动画控制命令支持播放参数value内容:play,从头播放pause, 暂停resume,从当前位置继续播放play(startTime,endTime,loop,delay)这个命令比较复杂,有4个参数,都支持表达式第一二个参数表示控制动画开始时间和结束时间,loop表示是否循环播放,默认为0,需要写数字0,1 或者数值表达式,如果为0表示只播放一遍就停止delay表示是否支持delay,默认false,需要写数字0,1 或者数值表达式例如: play(100,500,1,1)支持只写前面的参数,后面的参数可忽略: play(100) 从time 100开始播放到结束,不循环播放play(100, 500) 从time 100开始播放到500,停止play(100,500,1) 从time 100开始播放到500,循环播放2. 动画支持缓动类型缓动就是让动画不那么死板,加上各种加速度,运动效果会比较真实,具体大家可以百度一下。缓动效果速查表(这里的缓动名字和MAML里不太一样,注意别混淆了):http://easings.net/zh-cn#动画关键帧增加了两个属性:easeType和easeExpeaseType的值有以下几种BackEaseInBackEaseOutBackEaseInOutBounceEaseInBounceEaseOutBounceEaseInOutCircEaseInCircEaseOutCircEaseInOutCubicEaseInCubicEaseOutCubicEaseInOutElasticEaseInElasticEaseOutElasticEaseInOutExpoEaseInExpoEaseOutExpoEaseInOutQuadEaseInQuadEaseOutQuadEaseInOutQuartEaseInQuartEaseOutQuartEaseInOutQuintEaseInQuintEaseOutQuintEaseInOutSineEaseInSineEaseOutSineEaseInOut其中BackEase可以带1个参数,overshotElasticEase可以带2个参数,priod和amplitude参数为常数,比如BackEaseIn(1.5) ElasticEase(2,3)具体效果大家可以试一下最简单的例子:<Image src="1.png" x="200" y="500"> <PositionAnimation> <Position y="0" time="0" easeType="QuadEaseOut"/> <Position y="-200" time="150" easeType="BounceEaseOut"/> <Position y="0" time="550"/> </PositionAnimation></Image>easeExp为表达式,引用一个内置变量#__ratio,可以自定义缓动函数比如 easeType="QuadEaseIn" 也可以用 easeExp="#__ratio*#__ratio" 来实现当有easeExp时,easeType不起作用属性作用于从该帧到下一帧,最后一帧没用附上demo:bounce实现了类似v6锁屏时间弹跳动画easeType和easeExp分别用两种方式来实现BackEaseIn==================================================<font face="Arial"><Lockscreen screenWidth="720" framerate="60"> <Var name="bounce"> <VariableAnimation loop="false" initPause="true"> <AniFrame value="1" time="0" easeType="QuadEaseOut"/> <AniFrame value="0" time="150" easeType="BounceEaseOut"/> <AniFrame value="1" time="550"/> </VariableAnimation> </Var> <Var name="easeType"> <VariableAnimation loop="false" initPause="true"> <AniFrame value="1" time="0" easeType="BackEaseIn"/> <AniFrame value="0" time="1000" easeType="BackEaseIn"/> <AniFrame value="1" time="2000"/> </VariableAnimation> </Var> <Var name="easeExp"> <VariableAnimation loop="false" initPause="true"> <AniFrame value="1" time="0" easeExp="#__ratio*#__ratio*((1.70158 + 1)*#__ratio-1.70158)"/> <AniFrame value="0" time="1000" easeExp="#__ratio*#__ratio*((1.70158 + 1)*#__ratio-1.70158)"/> <AniFrame value="1" time="2000"/> </VariableAnimation> </Var> <Button x="100" y="1140" w="120" h="120" alignChildren="true"> <Circle x="60" y="60" r="60" strokeColor="#ffffff"/> <Text x="60" y="60" align="center" alignV="center" textExp="'bounce'" size="35" color="#ffffff"/> <Triggers> <Trigger action="up"> <Command target="easeType.animation" value="play(0,0)"/> <Command target="easeExp.animation" value="play(0,0)"/> <Command target="bounce.animation" value="play"/> </Trigger> </Triggers> </Button> <Button x="300" y="1140" w="120" h="120" alignChildren="true"> <Circle x="60" y="60" r="60" strokeColor="#ffffff"/> <Text x="60" y="60" align="center" alignV="center" textExp="'easeType'" size="35" color="#ffffff"/> <Triggers> <Trigger action="up"> <Command target="bounce.animation" value="play(0,0)"/> <Command target="easeExp.animation" value="play(0,0)"/> <Command target="easeType.animation" value="play"/> </Trigger> </Triggers> </Button> <Button x="500" y="1140" w="120" h="120" alignChildren="true"> <Circle x="60" y="60" r="60" strokeColor="#ffffff"/> <Text x="60" y="60" align="center" alignV="center" textExp="'easeExp'" size="35" color="#ffffff"/> <Triggers> <Trigger action="up"> <Command target="easeType.animation" value="play(0,0)"/> <Command target="bounce.animation" value="play(0,0)"/> <Command target="easeExp.animation" value="play"/> </Trigger> </Triggers> </Button> <Circle x="360" y="100+(#bounce+#easeType+#easeExp)*200" r="60" strokeColor="#ffffff" fillColor="#ffffff"/> <Button name="unlocker" x="300" y="1000" w="120" h="120" alignChildren="true"> <Circle x="60" y="60" r="60" strokeColor="#ffffff"/> <Text x="60" y="60" align="center" alignV="center" textExp="'unlock'" size="35" color="#ffffff"/> <Triggers> <Trigger action="up"> <ExternCommand command="unlock"/> </Trigger> </Triggers> </Button></Lockscreen></font> 3. Animation新属性 initPause 动画初始时停止,直到调用播放命令才开始播放 loop 是否循环,默认为true, loop="false" 就不用写原来的最后一个time="1000000000000"的项目了 例如:<Var name="rl_x"> <VariableAnimation initPause="true" loop="false"> <AniFrame value="#rl_x1" time="0" /> <AniFrame value="#rl_x2" time="300" /> </VariableAnimation> </Var>新的动画tag,原来的Animation tag比较难记,新的不管什么动画类型内部tag都可以用Item,属性只有一个值时可以用value属性(比如Rotation的angle),属性多个值时用原来的属性名(比如Position 的x y) 兼容之前的tag语法<RotationAnimation loop="false"> <Item value="0" time="0" easeType="ElasticEaseInOut" /> <Item value="360" time="1000" /> </RotationAnimation> <VariableAnimation initPause="true" loop="false"> <Item value="#rl_x1" time="0" /> <Item value="#rl_x2" time="300" /> </VariableAnimation>新增Scale动画<ScaleAnimation loop="false"> <Item value="0" time="0" easeType="ElasticEaseOut" /> <Item value="1" time="1000" /> </ScaleAnimation>
2015年07月01日
by米青
问题:自由桌面或百变锁屏中,需要获取intent值,启动某些第三方应用。解决:0.准备文件: 解压文件 将adb.exe 复制到 c:/windows/system32下 将其他文件复制到 c:/windows/system下1.win+R,进入cmd命令行: 输入adb devices 查看是否设备连接正常 输入adb shell 输入logcat ActivityManager:V *:S 查看log,获取信息2.Logcat指令过滤 补充。。。
2015年06月11日
byMI-谢
理由: 自由桌面的框架比百变锁屏较为复杂,需要描述图层之间关系、自由部件和图层的关系以及小工具和图层的关系。 自由部件可以实现的功能受限制。 虽然,小工具作为自由部件的一个补充,可以实现更为自由的功能,但,受限于不能获取更多的系统事件或用户反馈(只能识别用户点击和开关屏事件),同样不能实现更为自由的操作。疑惑: 自由桌面自V6发布以来,官方有在维护吗? 自由桌面(或者百变框架)能不能提供更为完整的系统事件或用户事件event? MIUI主题编辑器能不能加入maml代码编辑器功能? maml语法帮助文档什么时候能发布一个【正式版】?
2015年06月11日
byMI-谢
/tools 中的小工具 如何添加到screen图层呢?/tools 中的小工具 如何制作呢?com.miui.home.freestyle/description.xml 中代码如下:<?xml version='1.0' encoding='utf-8' standalone='yes' ?><scene width="1080" name="test1505240011"> <screen type="drift" width="1080" home="1"> <sprite left="0" top="0" _name="tool_1" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="" function="mtz_gadget:tools\page_4x4" /> </screen> <screen type="background" width="1080" home="0" /> <screen type="foreground" width="1080" home="0" /> <screen type="dock" width="1080" home="0" /></scene><sprite /> 标签,指定了某个小工具的单独文件夹(本例为tools/page_4x4文件夹)。注意别踩“坑”: 此时,不要指定外观appearance 文件夹命名没有固定要求,方便查看就行 路径中的 "/"和“\”好像没有区别,不知道不同操作系统是否会有不同待讨论com.miui.home.freestyle/tools/XXX/description.xml 中代码如下:<MIUI-Theme> <title>page_4x4 <version>1.0 <uiVersion>1 <previewX>0 <previewY>0</MIUI-Theme><title/> 是小工具在编辑添加时,显示的名称com.miui.home.freestyle/tools/XXX/manifest.xml 中代码如下:<?xml version='1.0' encoding='utf-8'?><gadget version="1" frameRate="30" width="1080" height="1250" screenWidth="1080" > <!-- 代码同百变框架,也会略有不同 --></gadget><gadget>...</gadget>添加你的代码。
2015年06月11日
byMI-谢
/stage_images 中的背景图片 和 /skins 中的自由部件的外观图片,通过什么方式添加到 screen图层上呢?自由部件,可以理解为(外观上)一张图、一个图标,(功能上)一个app、一个开关、一个文件夹、一个应用抽屉的入口。com.miui.home.freestyle/description.xml 中代码如下:<?xml version='1.0' encoding='utf-8' standalone='yes' ?><scene width="1080" name="test1505240011"> <screen type="drift" width="1080" home="1"> <sprite left="50" top="100" _name="AAA" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="skins/icon_1.png" function="" /> <sprite left="250" top="100" _name="BBB" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="skins/icon_1.png" function="app:com.android.contacts/.activities.PeopleActivity" /> <sprite left="450" top="100" _name="CCC" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="skins/icon_1.png" function="drawer:" /> <sprite left="650" top="100" _name="DDD" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="skins/icon_1.png" function="toggle:torch" /> <sprite left="850" top="100" _name="EEE" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="skins/icon_1.png" function="folder:" /> </screen> <screen type="background" width="1080" home="0"> <sprite left="0" top="0" _name="bg" rotation="0.0" scale_x="0.0" scale_y="0.0" width="0" height="0" appearance="stage_images/bg.png" function="" /> </screen> <screen type="foreground" width="1080" home="0" /> <screen type="dock" width="1080" home="0" /></scene><sprite /> 标签,sprite 小精灵,通过该标签,添加自由部件,并指定在screen图层的位置、大小、外观appearance和功能function。<sprite left="88" top="188" _name="XXX" rotation="0.0" scale_x="0.0" scale_y="0.0" width="88" height="188" appearance="skins/icon_1.png" function="" />left top //图片距屏幕左上角距离(必须指定)_name //名称rotation //顺时针旋转角度scale_x scale_y //横纵轴缩放比例width height //任意指定图片大小apprearance //指定外观图片(必须指定)function //指定功能(必须指定,但可以为空值)自由部件的功能function:无功能打开应用,需要指定Intent值(如何利用adb logcat 获取Intent值?)打开开关打开文件夹打开应用抽屉注意别踩“坑”: background 图层无法获取点击 图片的引用路径 部件的位置,不要超出screen图层的大小
2015年06月11日
byMI-谢
<scene/>根标签,scene 场景、现场,可以理解为一个窗口,也就是手机屏幕当前可见区域。<screen/>一级子标签,screen 在自由桌面中,可以理解为一个大画布、大图层。通过窗口滚动看到图层上的内容。com.miui.home.freestyle/description.xml 中代码如下:<?xml version='1.0' encoding='utf-8' standalone='yes' ?><scene width="1080" name="test1505240144"> <screen type="background" width="4320" home="0"> </screen> <screen type="foreground" width="2160" home="0"> </screen> <screen type="dock" width="1080" home="0"> </screen> <screen type="drift" width="4320" home="0"> </screen></scene>注意别踩“坑”:scene 相当于窗口,scene width确定屏幕显示的宽度其中, 只有drift的宽度/scenn的宽度=屏数n (drift、background、foreground、dock层宽度不应小于scene宽度)其它层,将等分成相应的n屏滚动 距离为foreground的宽度/屏数n=xscreen 相当于画布,每一层有不同的显示特性drift 中的元素:有多屏时,可随屏幕滚动显示 /编辑时,可移动 /可点击 (3)dock 中的元素:有多屏时,固定在屏幕显示 /编辑时,可移动 /可点击 (2) foreground 中的元素:有多屏时,可随屏幕滚动显示 /编辑时,不可移动 /可点击 (1)background 中的元素:有多屏时,可随屏幕滚动显示 /编辑时,不可移动 /不可点击 (0)resume、pause动画在background/foreground中无效home="0" 该参数指定,首屏显示在drift的第几屏(0-第一屏,1-第二屏,类推...)。注意该参数只作用在drift图层。图层的相对位置从下至上:background、drift、foreground、dock。注意无论标签在代码中的上下位置如何,均是如此。每次应用你的新修改的自由桌面,记得更新以下<scene name="test0001">版本,可能是由于缓存问题导致的。注意一定要更新版本号,别懒!!
2015年06月11日
byMI-谢
MIUI主题编辑器 5.3.23 已发布!编辑器下载地址:点我下载为方便缺少测试设备的同学,特提供V5、V6系统素材包下载:点我下载 (V5版解压覆盖到编辑器resourceCatalog_V5目录中,V6版解压覆盖到编辑器resourceCatalog_V6目录中)注意:使用时请保持手机联机状态,如果遇到无法连接的问题,请安装小米手机助手尝试解决:点我下载百变锁屏的编辑器还未更新,可以上上个版本的编辑器的帖子下载:点我下载自由桌面新版暂未支持,可以使用旧版本制作(需要加载包含自由桌面模块的主题才能看到)点我下载支持Windows,Linux,Mac(由于系统原因,Mac无法使用拖放功能)意见和反馈QQ群:329844445 在线教程:MIUI主题文档 主题制作Wiki更新日志:20150323 new新增 图标滤镜更新 V6版主题模板属性标注(尺寸、颜色值等)优化 更换不同系统版本的手机导入资源时不再需要刷新列表修复 诸多bug20141211修复“刷新列表”有可能丢失模块的问题修复“同步模块”后属性条目重复的问题,需要手动清理已有问题的素材库目录(如:..\resourceCatalog_V6\framework-miui-res)20141124更新V6模板,添加文件管理器支持制作状态栏上的百变模块(时钟和音乐)修复导入framework可能出错的bug20141112替换桌面和锁屏壁纸更全面的图标名称精简完美图标个数更新V6模板V6英文模板20140923检测theme_values改动,自动重新加载20140917添加V6模板添加英文模板修复V6无法导入framework-miui问题20140804添加自动更新添加移动弹出窗20140708图标的异步加载修复图标导致的无法启动无法加载图标时显示未知应用20140703添加颜色选取修复修改颜色时光标抖动20140625修复bug20140530添加.9编辑器修复有时替换或删除图片后回复顶部问题修复mac下无法使用的问题修复mac下无法显示注释图片的问题20140516新版设计和实现的编辑器更新主题模板20131115更新适配列表支持部分不适配1080P自动适配拨号盘高度20131025更新模板20130827再次修复适配分辨率时的一些偏差20130820修复适配分辨率时的一些偏差20130814添加适配低分辨率的提示提供自动适配高低分辨率功能更新模板替换更易用的.9编辑器更严格的.9信息检查(不允许非透明或者纯黑出现在.9黑边上)20130619支持主题初始化助手20130606支持关闭完美图标支持theme_values注释图片的直接预览20130521更新模板支持图标滤镜完善图标中文名称完善系统图标添加清理第三方图标添加全局快捷键添加主题wiki站点20130329更新模板自由桌面编辑器添加更多功能20130306V5模板V4转换V5自由桌面(在有自由桌面的V4主题里切换版本号会自动提示转换)V5自由桌面编辑新版本adb20130225不提示已编译.9.png 自动删除Thumb.db .9.png错误的文本显示 优化.9错误提示 一次检测所有.9.png图片错误 V4自由桌面转换到V5自由桌面 20130131应用到手机应用最近改动(只保证最近修改成功应用,可能不完整,用于快速查看效果)同步资源新的图标替换模式更新主题模板更新theme_values注释theme_values编辑支持单独修改模块的全局属性
2015年06月11日
byMasstone