<?xml version="1.0" encoding="utf-8"?>
<Lockscreen version="1" frameRate="60" displayDesktop="true" screenWidth="1080">
<Var name="mix" expression="(#screen_height-1920)/120"/>
<Var name="sw" expression="#screen_width"/>
<Var name="sh" expression="#screen_height"/>
<Var name="indexLeftCount" type="number[]" values="0,1,2,3,4" const="true" />
<Var name="appIsinstall" type="number[]" const="true" values="#nameholder_leftApp0.bmp_width!=0,#nameholder_leftApp1.bmp_width!=0,#nameholder_leftApp2.bmp_width!=0,#nameholder_leftApp2.bmp_width!=0,#nameholder_leftApp3.bmp_width!=0" />
<Var name="appPackage" type="string[]" size="5" const="true" />
<Var name="appClass" type="string[]" size="5" const="true" />
<Var name="alphaSwitch" type="number[]" size="5" const="true" />
<Image x="-500" y="-500" name="nameholder_leftApp0" srcType="ApplicationIcon" srcExp="'com.xiaomi.smarthome,com.xiaomi.smarthome.SmartHomeMainActivity'"/>
<Image x="-500" y="-500" name="nameholder_leftApp1" srcType="ApplicationIcon" srcExp="'com.duokan.phone.remotecontroller,com.xiaomi.mitv.phone.remotecontroller.HoriWidgetMainActivityV2'"/>
<Image x="-500" y="-500" name="nameholder_leftApp2" srcType="ApplicationIcon" srcExp="'com.miui.tsmclient,com.miui.tsmclient.ui.quick.DoubleClickActivity'"/>
<Image x="-500" y="-500" name="nameholder_leftApp3" srcType="ApplicationIcon" srcExp="'com.android.thememanager,com.android.thememanager.ThemeResourceTabActivity'"/>
<VariableBinders>
<SensorBinder type="gravity" rate="300">
<Variable name="gx" index="0"/>
<Variable name="gy" index="1"/>
</SensorBinder>
<ContentProviderBinder name="weather_provider" uri="content://weather/weather" columns="city_id,city_name,weather_type,aqilevel,temperature,description,tmplows,wind,humidity" countName="hasweather" denpendency="selected_city">
<Variable name="weather_location_id" type="string" column="city_id"/>
<Variable name="weather_location" type="string" column="city_name"/>
<Variable name="weather_id" type="int" column="weather_type"/>
<Variable name="weather_aqilevel" type="int" column="aqilevel"/>
<Variable name="weather_temperature" type="int" column="temperature"/>
<Variable name="weather_description" type="string" column="description"/>
<Variable name="weather_temphigh" type="int" column="tmphighs"/>
<Variable name="weather_templow" type="int" column="tmplows"/>
<Variable name="weather_wind" type="string" column="wind" />
<Variable name="weather_humidity" type="string" column="humidity" />
</ContentProviderBinder>
<ContentProviderBinder uri="content://weather/selected_city" columns="flag" whereFormat="posID='%s'" whereParas="@weather_location_id" dependency="weather_provider">
<Variable name="is_location_city" type="int" column="flag"/>
</ContentProviderBinder>
<!-- 查询通知 -->
<ContentProviderBinder name="data" uri="content://keyguard.notification/notifications" columns="icon,title,content,time,info,subtext,key" countName="hasnotifications">
<List name="notice" />
</ContentProviderBinder>
</VariableBinders>
<ExternalCommands>
<Trigger action="pause">
<Command target="bg_play.animation" value="play(0,0)" />
<Command target="yun_x.animation" value="play(0,0)" />
<Command target="xing_a.animation" value="play(0,0)" />
<Command target="meteor.animation" value="play(0,0)" />
<Command target="meteor_1.animation" value="play(0,0)" />
<Command target="meteor_2.animation" value="play(0,0)" />
<!-- 从负一屏或相机界面后界面退出后图标界面复位 -->
<VariableCommand name="move_x1" expression="0" />
<VariableCommand name="move_x2" expression="0" />
<Command target="move_go.animation" value="play" />
<VariableCommand name="img_bg" expression="#hour24*2+int(#minute}=30)" />
</Trigger>
<Trigger action="resume">
<!-- 播放开屏动画 -->
<Command target="bg_play.animation" value="play" />
<Command target="xing_a.animation" value="play" />
<Command target="yun_x.animation" value="play" />
<Command target="meteor.animation" value="play" />
<Command target="meteor_1.animation" value="play" />
<Command target="meteor_2.animation" value="play" />
<VariableCommand name="TORCH" expression="0" />
<!-- Müzik -->
<Command target="music_alpha.animation" value="play(0,0)" condition="eq(#music.music_state,0)" />
<Command target="music_alpha.animation" value="play(300,300)" condition="eq(#music.music_state,1)" />
<VariableCommand name="getLeftCount" expression="0"/>
<!-- 负一屏初始化 -->
<LoopCommand count="5" indexName="__n" >
<!-- 自动排序 -->
<VariableCommand name="getLeftCount" expression="#getLeftCount + 1" condition="#appIsinstall[#__n]"/>
<VariableCommand name="indexLeftCount" index="#__n" expression="ifelse(#appIsinstall[#__n],#getLeftCount - 1,0)" type="number[]"/>
<!-- 初始化负一屏包名类名 -->
<VariableCommand name="appPackage" type="string[]" index="#__n" size="5" expression="ifelse(#__n==0, 'com.xiaomi.smarthome', #__n==1,'com.duokan.phone.remotecontroller', #__n==4, 'com.android.thememanager','com.miui.tsmclient')" />
<VariableCommand name="appClass" type="string[]" index="#__n" size="5" expression="ifelse(#__n==0, 'com.xiaomi.smarthome.SmartHomeMainActivity' , #__n==1 , 'com.xiaomi.mitv.phone.remotecontroller.HoriWidgetMainActivityV2' , #__n==4 , 'com.android.thememanager.ThemeResourceTabActivity' , 'com.miui.tsmclient.ui.quick.DoubleClickActivity')"/>
</LoopCommand>
<!-- <Command target="ani.animation" value="play" delay="500" /> -->
</Trigger>
</ExternalCommands>
<Var name="meteor">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" />
<AniFrame value="0" time="200" />
<AniFrame value="1" time="2200" />
</VariableAnimation>
</Var>
<Var name="meteor_1">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" />
<AniFrame value="0" time="1200" />
<AniFrame value="1" time="3200" />
</VariableAnimation>
</Var>
<Var name="meteor_2">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" />
<AniFrame value="0" time="2200" />
<AniFrame value="1" time="4200" />
</VariableAnimation>
</Var>
<Var name="bg_play">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" />
<AniFrame value="0" time="200" />
<AniFrame value="1" time="1000" />
</VariableAnimation>
</Var>
<Var name="yun_x">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" />
<AniFrame value="0" time="1000" />
<AniFrame value="1.1" time="1400" />
<AniFrame value="1" time="1500" />
</VariableAnimation>
</Var>
<Var name="xing_a">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" />
<AniFrame value="0" time="1500" />
<AniFrame value="1" time="2000" />
</VariableAnimation>
</Var>
<Var name="bg" expression="(ge(#hour24,5)*le(#hour24,7))*0+ge(#hour24,8)*le(#hour24,11)+(ge(#hour24,12)*le(#hour24,17))*2+(ge(#hour24,18)*le(#hour24,23)+le(#hour24,4))*3"/>
<!--百变壁纸-->
<Group >
<Image y="#sh-800" w="#sw" h="#sh-800+#bg_play*300" alignV="bottom" src="bg.jpg" srcid="#bg"/>
<Circle x="200+#bg*170" y="#sh-650-#yun_x*300-#bg*50" r="250" fillColor="#33ffffff" visibility="le(#bg,2)"/>
<Image y="#sh" alignV="bottom" src="sm.png" srcid="#bg"/>
<Image x="1080-#yun_x*380" y="350" src="yue.png" visibility="eq(#bg,3)"/>
<Image x="#sw/2" y="100" align="center" src="xing.png" alpha="#xing_a*255" visibility="eq(#bg,3)"/>
<!--流星-->
<Group x="0" w="1080" h="#sh" pivotX="0" rotation="-60" visibility="eq(#bg,3)">
<Image x="-300" y="150+#meteor*1310" alignV="bottom" src="meteor.png"/>
<Image x="-100" y="50+#meteor_1*1310" alignV="bottom" src="meteor.png"/>
<Image x="0" y="#meteor*1310" alignV="bottom" src="meteor.png"/>
<Image x="120" y="100+#meteor_2*1280" alignV="bottom" src="meteor.png"/>
<Image x="240" y="400+#meteor*820" alignV="bottom" src="meteor.png"/>
<Image x="360" y="600+#meteor_1*600" alignV="bottom" src="meteor.png"/>
</Group>
<!--云-->
<Group visibility="le(#bg,2)">
<Image x="#yun_x*350" y="330" align="right" alignV="center" src="yun_0.png" />
<Image x="1080-#yun_x*330" y="550" alignV="center" src="yun_1.png" />
</Group>
<!--云-->
</Group>
<Rectangle w="#screen_width" h="#screen_height" fillColor="#7f000000" alpha="#defaultScreen_x/1080*255"/>
<!-- 主页 ifelse(#time_format,'HH:mm','h:mm') -->
<Group x="#defaultScreen_x" >
<!-- 时钟 -->
<DateTime name="Time" x="#screen_width/2" y="200" align="center" size="220" color="#ffffff" formatExp="ifelse(#time_format,'HH:mm','hh:mm')" fontFamily="miui-thin" />
<DateTime name="Date" x="#screen_width/2" y="200+#Time.text_height" align="center" size="45" color="#ffffff" formatExp="'M月d日 EEEEaa'" />
<DateTime x="#screen_width/2" y="200+#Time.text_height+#Date.text_height+18" align="center" size="39" color="#ffffff" formatExp="'YY年N月e'" />
<Var name="music_alpha">
<VariableAnimation loop="false" initPause="true">
<AniFrame value="0" time="0" easeType="CubicEaseInOut"/>
<AniFrame value="1" time="300"/>
</VariableAnimation>
</Var>
<MusicControl name="music" y="688" w="1080" h="226" autoShow="true" defAlbumCover="lockscreenMusic_src/default_bg.jpg" enableLyric="true" updateLyricInterval="100" alpha="#music_alpha*255" visibility="#music_alpha!=0" >
<!-- 音乐窗口背景 -->
<Image x="40" y="0" w="1000" h="226" src="lockscreenMusic_src/music_bg.9.png" />
<!-- 专辑图 -->
<Group x="40" w="226" h="226" layered="true">
<Image name="music_album_cover" w="226" h="226" />
<Image w="226" h="226" src="lockscreenMusic_src/music_bg.9.png" xfermode="dst_in" />
</Group>
<!-- 歌曲名、歌手名、播放时间 -->
<Text x="296" y="61" w="674" alignV="center" textExp="ifelse(strIsEmpty(@music.title),'暂无音乐',@music.title)" color="#000000" size="39" marqueeSpeed="30" bold="true"/>
<Text x="296" y="117" w="350" alignV="center" textExp="ifelse(strIsEmpty(@music.artist),'--',@music.artist)" color="#000000" size="36" marqueeSpeed="30" alpha="128" />
<Text x="296" y="169" w="350" alignV="center" textExp="ifelse(strIsEmpty(@music.title),'--:--/--:--',formatDate('mm:ss / ',#music.music_position)+formatDate('mm:ss',#music.music_duration))" color="#000000" size="33" marqueeSpeed="30" alpha="128" />
<!-- 按钮:上一曲、播放、暂停、下一曲 -->
<Button name="music_prev" x="#screen_width - 308" y="76" w="120" h="150" align="right" alignChildren="true">
<Image x="60" y="75" align="center" alignV="center" src="lockscreenMusic_src/prev.png" />
</Button>
<Button name="music_play" x="#screen_width - 188" y="76" w="120" h="150" align="right" alignChildren="true">
<Image x="60" y="75" align="center" alignV="center" src="lockscreenMusic_src/play.png" />
</Button>
<Button name="music_pause" x="#screen_width - 188" y="76" w="120" h="150" align="right" alignChildren="true">
<Image x="60" y="75" align="center" alignV="center" src="lockscreenMusic_src/pause.png" />
</Button>
<Button name="music_next" x="#screen_width - 68" y="76" w="120" h="150" align="right" alignChildren="true">
<Image x="60" y="75" align="center" alignV="center" src="lockscreenMusic_src/next.png" />
</Button>
</MusicControl>
<List name="notice" y="688+#music.visibility*246" w="1080" maxHeight="200*4" data="icon:bitmap,title:string,content:string,time:string,info:string,subtext:string,key:int" visibility="#hasnotifications">
<Item x="0" y="0" w="1080" h="200">
<Button x="0" y="0" w="1080" h="180" >
<Normal>
<Image x="40" y="0" w="1000" h="180" src="lockscreenNotice_src/notice_bg.9.png" />
</Normal>
<Pressed>
<Image x="40" y="0" w="1000" h="180" src="lockscreenNotice_src/notice_bg.9.png" alpha="255*0.95" />
</Pressed>
<Image x="#screen_width - 100" y="90" align="center" alignV="center" src="lockscreenNotice_src/close.png" />
<Image x="130" y="90" w="130" h="130" align="center" alignV="center" name="notice_icon" />
<Text x="220" y="64" w="700 - #notice_time.text_width" h="48" alignV="center" size="42" color="#000000" marqueeSpeed="30" name="notice_title" />
<Text x="220" y="120" w="700" h="42" alignV="center" size="36" color="#000000" marqueeSpeed="30" name="notice_content" alpha="128" />
<Text x="#screen_width - 160" y="64" align="right" alignV="center" size="36" color="#000000" name="notice_time" alpha="128" />
<Triggers>
<Trigger action="up">
<IntentCommand action="com.miui.app.ExtraStatusBarManager.action_remove_keyguard_notification" broadcast="true">
<Extra name="com.miui.app.ExtraStatusBarManager.extra_notification_key" type="int" expression="#notice.key" />
<Extra name="com.miui.app.ExtraStatusBarManager.extra_notification_click" type="int" expression="#touch_begin_x { 920" />
</IntentCommand>
</Trigger>
</Triggers>
</Button>
</Item>
<AttrDataBinders>
<AttrDataBinder target="notice_icon" attr="bitmap" data="icon" />
<AttrDataBinder target="notice_title" attr="text" data="title" />
<AttrDataBinder target="notice_content" attr="text" data="content" />
<AttrDataBinder target="notice_time" attr="text" data="time" />
</AttrDataBinders>
</List>
</Group>
<!-- 充电状态 -->
<Group x="#defaultScreen_x" visibility="#battery_state==1||#battery_state==3" >
<Arc x="540" y="#screen_height-240" w="156" h="156" startAngle="-91.8" sweep="-(99-#battery_level)*3.6" close="false" strokeColor="#ffffff" fillColor="#00ffffff" weight="5" strokeAlign="center" alpha="75" />
<Arc x="540" y="#screen_height-240" w="156" h="156" startAngle="-90" sweep="#battery_level*3.6" close="false" strokeColor="#47C200" fillColor="#00ffffff" weight="5" strokeAlign="center" />
<Text x="540" y="#screen_height-240" align="center" alignV="center" color="#ffffff" size="36" textExp="#battery_level" fontFamily="miui-bold" />
</Group>
<!-- 快捷功能图标 -->
<Group x="#defaultScreen_x" >
<Text x="#screen_width/2" y="#screen_height - 80" align="center" alignV="center" color="#ffffff" size="39" textExp="ifelse(#battery_state==1,'正在充电',#battery_state==3,'充电完成','上滑解锁')" alpha="255*0.7" />
<Image name="leftIcon" x="80" y="#screen_height-80" srcExp="'shortcut/lefticon.png'" align="center" alignV="center" centerX="#leftIcon.bmp_width/2" centerY="#leftIcon.bmp_height/2" scale="1/(1-#defaultScreen_y/40)" alpha="128+#defaultScreen_y*7"/>
<Image name="rightIcon" x="1000" y="#screen_height-80" srcExp="'shortcut/righticon.png'" align="center" alignV="center" centerX="#rightIcon.bmp_width/2" centerY="#rightIcon.bmp_height/2" scale="1/(1-#defaultScreen_y/40)" alpha="128+#defaultScreen_y*7"/>
</Group>
<!-- 右相机页 -->
<Group x="1080+#defaultScreen_x" visibility="#defaultScreen_x{0" >
<Rectangle w="1080" h="#screen_height" fillColor="#000000"/>
<Image y="#screen_height" alignV="bottom" w="1080" srcExp="'shortcut/cam_bg_'+int(#screen_height==1920)+'.png'" />
</Group>
<!-- 左右滑屏按钮 -->
<Group visibility="#defaultScreen_y==0**#miCanderPluginInit==0">
<!-- 左右移动变量,预留100像素判断是向左右滑动还是上下滑动,当滑动距离超过100时#defaultScreen_x变量才不为0-->
<Var name="defaultScreen_x" expression="max(min(ifelse(#touch_x}#touch_begin_x,max(#touch_move-100,0),min(#touch_move+100,0))+#move_go,1080),-1080)" />
<Var name="move_go">
<VariableAnimation initPause="true" loop="false">
<AniFrame value="#move_x1" time="0" easeType="QuintEaseOut" />
<AniFrame value="#move_x2" time="400" />
</VariableAnimation>
</Var>
<Button w="1080" h="#screen_height" >
<Triggers>
<Trigger action="move">
<VariableCommand name="touch_move" expression="#touch_x-#touch_begin_x" />
</Trigger>
<!-- 判断回弹 -->
<Trigger action="up,cancel">
<VariableCommand name="move_x1" expression="#move_x2+ifelse(#touch_x}#touch_begin_x,max(#touch_move-100,0),min(#touch_move+100,0))"/>
<VariableCommand name="move_x2" expression="ifelse(abs(#touch_x-#touch_begin_x)}200,max(min(#move_x2+ifelse(#touch_x}#touch_begin_x,1,-1)*1080,1080),-1080),#move_x2)" />
<Command target="move_go.animation" value="play" />
<VariableCommand name="touch_move" expression="0" />
</Trigger>
<Trigger action="up,cancel" condition="abs(#touch_x-#touch_begin_x)}200">
<!-- 不解锁进入相机界面 -->
<IntentCommand action="android.intent.action.MAIN" package="com.android.camera" class="com.android.camera.Camera" condition="#touch_begin_x-#touch_x}200**#defaultScreen_x{0">
<Extra name="ShowCameraWhenLocked" type="boolean" expression="1"/>
<Extra name="StartActivityWhenLocked" type="boolean" expression="1"/>
</IntentCommand>
</Trigger>
</Triggers>
</Button>
</Group>
<!-- 解锁 -->
<Group visibility="(#defaultScreen_x==0||#defaultScreen_x==1080||#defaultScreen_x==-1080)**#miCanderPluginInit==0">
<!-- 上划位移变量,预留100像素判断是向左右滑动还是向上滑动,当向上滑动距离超过100时#defaultScreen_y变量才不为0 -->
<Var name="defaultScreen_y" expression="min(#touch_y-#touch_begin_y+100,0)*#nameholder_unlock_flag+ifelse(abs(#touch_y-#touch_begin_y)}100**(#touch_begin_y-#touch_y){300,#UnlockBack,0)" />
<!-- 上划解锁未到解锁区域时返回弹动动效 -->
<Var name="UnlockBack">
<VariableAnimation initPause="true" loop="false">
<AniFrame value="min(#touch_y-#touch_begin_y+100,0)" time="0" easeType="QuintEaseOut" />
<AniFrame value="0" time="400" />
</VariableAnimation>
</Var>
<Button w="1080" h="#screen_height" >
<Triggers>
<Trigger action="down">
<VariableCommand name="nameholder_unlock_flag" expression="1"/>
</Trigger>
<Trigger action="up,cancel">
<VariableCommand name="nameholder_unlock_flag" expression="0" />
<Command target="UnlockBack.animation" value="play" />
<ExternCommand command="unlock" condition="ge(#touch_begin_y-#touch_y,300)" />
</Trigger>
</Triggers>
</Button>
</Group>
<!-- 负一屏界面 -->
<Group x="#defaultScreen_x-1080" visibility="#defaultScreen_x}0">
<Array x="0" y="380" count="5" indexName="__f" >
<!-- 列表 -->
<Button x="540" y="200*#indexLeftCount[#__f]" w="1024" h="190" align="center" alignChildren="true" visibility="#appIsinstall[#__f]" >
<Text x="160" y="95" alignV="center" color="#80ffffff" size="40" textExp="ifelse(#__f==0,'米家',#__f==1,'万能遥控器',#__f==2,'MI Pay',#__f==3,'小米公交','个性主题')" />
<Image x="90" y="95" align="center" alignV="center" src="left_screen/icon.png" srcid="#__f"/>
<Normal>
<Rectangle w="1024" h="190" fillColor="#FFFFFF" alpha="20" cornerRadius="20,20" />
</Normal>
<Pressed>
<Rectangle w="1024" h="190" fillColor="#FFFFFF" alpha="40" cornerRadius="20,20" />
</Pressed>
<Triggers>
<Trigger action="up" condition="#defaultScreen_x==1080" >
<IntentCommand action="android.intent.action.MAIN" packageExp="@appPackage[#__f]" classExp="@appClass[#__f]" condition="#__f{3"/>
<IntentCommand action="com.miui.intent.action.DOUBLE_CLICK" packageExp="@appPackage[3]" condition="#__f==3" >
<Extra name="event_source" type="string" expression="'shortcut_of_trans_card'"/>
</IntentCommand>
<IntentCommand action="android.intent.action.VIEW" package="com.android.thememanager" class="com.android.thememanager.activity.ThemeTabActivity" uri="theme://zhuti.xiaomi.com/list?i.REQUEST_DYNAMIC_FRAGMENT_TYPE=0&S.REQUEST_RESOURCE_CODE=theme&S.REQUEST_RELATED_TITLE=深度设计&pageUrl1=&listUrl1=samedesign%3fcategory%3dCompound%26designer%3d深度设计&pageKey1=Designer&miref=Test&miback=true" condition="#__f==4"/>
<ExternCommand command="unlock" delay="100" condition="#__f!=2**#__f!=3"/>
</Trigger>
</Triggers>
</Button>
</Array>
<Button x="540" align="center" alignV="center" y="#screen_height-320+82" w="164" h="164" alignChildren="true" >
<Image src="left_screen/flash.png" srcid="#TORCH" alpha="160" />
<Triggers>
<Trigger action="up" condition="#defaultScreen_x==1080" >
<!-- <VariableCommand name="nameholder_light_switch" expression="!(#nameholder_light_switch)" /> -->
<VariableCommand name="TORCH" expression="int(#TORCH+1)%2" />
<IntentCommand action="miui.intent.action.TOGGLE_TORCH" broadcast="true" >
<Extra name="miui.intent.extra.IS_ENABLE" type="boolean" expression="ifelse(int(@__miui_version_code)==8,#TORCH,1)" />
</IntentCommand>
</Trigger>
</Triggers>
</Button>
</Group>
</Lockscreen>