1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
| <?xml version="1.0" encoding="UTF-8"?> <Lockscreen version="2" frameRate="60" screenWidth="1080"> <var name="wave_width" type="number" expression="#move_x" /> <var name="wave_y" type="number" expression="(2*valueholder_circle_r+valueholder_wave_height)*(1-#battery_level/100)" />
<ValueHolder name="valueholder_wave_height" type="param" description="振幅" defaultValue="50" /> <ValueHolder name="valueholder_circle_r" type="param" description="圆半径" defaultValue="380" /> <ValueHolder name="valueholder_group_x" type="param" description="x坐标" defaultValue="175" /> <ValueHolder name="valueholder_group_y" type="param" description="y坐标" defaultValue="#screen_height/2-80" /> <ValueHolder name="valueholder_wave_color" type="param" description="水波纹颜色" defaultValue="#ff00ff00" /> <ValueHolder name="valueholder_circle_color" type="param" description="圆颜色" defaultValue="#ffffffff" /> <ValueHolder name="valueholder_paint_wave_color_r" type="param" description="圆颜色(R)" defaultValue="255" /> <ValueHolder name="valueholder_paint_wave_color_g" type="param" description="圆颜色(G)" defaultValue="255" /> <ValueHolder name="valueholder_paint_wave_color_b" type="param" description="圆颜色(B)" defaultValue="255" /> <ValueHolder name="valueholder_circle_alpha" type="param" description="透明度" defaultValue="125" /> <ValueHolder name="valueholder_text_color" type="param" description="文本颜色" defaultValue="#fffefefe" />
<Var name="crg_val" expression="ifelse(eq(1, #battery_state)||eq(3, #battery_state), 1, 0)" /> <Var name="crg" expression="#crg_val" threshold="1"> <Trigger> <Command target="move_x.animation" value="play" delay="1000"/> </Trigger> </Var> <Var name="move_x"> <VariableAnimation loop="true" initPause="true"> <Item value="#screen_width" time="0" /> <Item value="0" time="1500" /> <Item value="-#screen_width" time="3000" /> </VariableAnimation> </Var>
<ExternalCommands> <Trigger action="init"> <VariableCommand name="scale_mum" expression="int(#raw_screen_width/1.08)/1000" /> <MethodCommand targetType="ctor" class="android.graphics.Path" return="pathWave" returnType="object"/> <MethodCommand target="pathWave" targetType="var" method="moveTo" paramTypes="float,float" params="-#move_x,0"/> <MethodCommand target="pathWave" targetType="var" method="quadTo" paramTypes="float,float,float,float" params="-0.75*#wave_width,valueholder_wave_height,-#wave_width/2,0"/> <MethodCommand target="pathWave" targetType="var" method="quadTo" paramTypes="float,float,float,float" params="-0.25*#wave_width,-valueholder_wave_height,0,0"/> <MethodCommand target="pathWave" targetType="var" method="quadTo" paramTypes="float,float,float,float" params="#wave_width/4,valueholder_wave_height,#wave_width/2,0"/> <MethodCommand target="pathWave" targetType="var" method="quadTo" paramTypes="float,float,float,float" params="0.75*#wave_width,-valueholder_wave_height,#wave_width,0"/> <MethodCommand target="pathWave" targetType="var" method="quadTo" paramTypes="float,float,float,float" params="#wave_width*1.25,valueholder_wave_height,#wave_width*1.5,0"/> <MethodCommand target="pathWave" targetType="var" method="quadTo" paramTypes="float,float,float,float" params="1.75*#wave_width,-valueholder_wave_height,#wave_width*2,0"/> <MethodCommand target="pathWave" targetType="var" method="lineTo" paramTypes="float,float" params="#wave_width*2,-#wave_y"/> <MethodCommand target="pathWave" targetType="var" method="lineTo" paramTypes="float,float" params="-#wave_width,-#wave_y"/> <MethodCommand target="pathWave" method="close" /> <MethodCommand targetType="ctor" class="android.graphics.Paint" return="paintWave" returnType="object"/> <MethodCommand targetType="var" class="miui.maml.util.ReflectionHelper" method="getEnumConstant" paramTypes="String,String" params="'android.graphics.Paint$Style','FILL'" return="style" returnType="object"/> <MethodCommand target="paintWave" targetType="var" method="setStyle" paramTypes="android.graphics.Paint$Style" params="'style'"/> </Trigger> </ExternalCommands> <Group visibility="eq(#battery_state,1)||eq(#battery_state,3)" alignV="top" align="left" x="valueholder_group_x+2+#defaultScreen_x" y="valueholder_group_y" scale="#scale_mum" w="valueholder_circle_r*2+4" h="valueholder_circle_r*2+4" layered="true"> <CanvasDrawer x="#move_x" y="#wave_y-valueholder_wave_height"> <Triggers> <Trigger action="draw"> <MethodCommand target="paintWave" targetType="var" method="setARGB" paramTypes="int,int,int,int" params="255,valueholder_paint_wave_color_r,valueholder_paint_wave_color_g,valueholder_paint_wave_color_b"/>
<MethodCommand target="__objCanvas" targetType="var" method="drawPath" paramTypes="android.graphics.Path,android.graphics.Paint" params="'pathWave','paintWave'"/> </Trigger> </Triggers> </CanvasDrawer>
<Text x="valueholder_circle_r+2-68" align="left" y="valueholder_circle_r*2-100" size="68" color="valueholder_text_color" textExp="#battery_level+'%'"/> <Circle alpha="valueholder_circle_alpha" alignV="top" align="left" x="valueholder_circle_r+2" y="valueholder_circle_r" r="valueholder_circle_r" strokeColor="valueholder_wave_color" weight="valueholder_circle_r" cap="round" dash="1,1,1,1" strokeAlign="inner" xfermodeNum="10"> </Circle> </Group> </Lockscreen>
|