MIUI锁屏完整版拿去就可以使用

<?xml version="1.0" encoding="utf-8"?>
<Lockscreen version="1" frameRate="30" displayDesktop="false" screenWidth="1080">

    <FramerateController name="panel_framerate" initPause="true" loop="false">
        <ControlPoint frameRate="0" time="0"/>
        <ControlPoint frameRate="60" time="1"/>
        <ControlPoint frameRate="60" time="3000"/>
        <ControlPoint frameRate="0" time="3001"/>
    </FramerateController>

    <Group name="i_bg" target="panel_framerate">
        <Wallpaper blur="60">
            <ScaleAnimation loop="false">
                <Item value="1.1" time="0" easeType="ElasticEaseInOut"/>
                <Item value="1.05" time="3000"/>
            </ScaleAnimation>
        </Wallpaper>
        <Wallpaper alpha="255-#unlockMove">
            <ScaleAnimation loop="false">
                <Item value="1.1" time="0" easeType="ElasticEaseInOut"/>
                <Item value="1.05" time="3000"/>
            </ScaleAnimation>
        </Wallpaper>
        <Rectangle alpha="255*0.1" fillColor="#000000" h="#screen_height" w="1080"/>
    </Group>

    <!--resume 开屏时执行的命令,pause 关屏时执行的命令-->
    <ExternalCommands>
        <Trigger action="resume">
            <Command target="i_bg.animation" value="play"/>
        </Trigger>

        <!--<Trigger action="pause">
          <VariableCommand name="pause_time" expression="#time_sys"/>
        </Trigger>-->
    </ExternalCommands>

    <!--锁屏时间日期-->
    <Group x="540" y="400-#unlockMove" alpha="255-#unlockMove" align="center" alignV="center">
        <DateTime y="40" align="center" size="80" color="#ffffff"
                  format="HH:mm:ss" fontFamily="miui-light"/>

        <DateTime y="180" align="center" size="50" color="#ffffff"
                  format="yyyy/MM/dd EEEE" fontFamily="miui-light"/>
    </Group>

    <!--锁屏音乐-->
    <MusicControl name="music" y="300-#unlockMove" w="#screen_width" h="226" align="center" alpha="255-#unlockMove"
                  autoShow="true"
                  defAlbumCover="icon/default_bg.jpg" enableLyric="true"
                  updateLyricInterval="100">

        <!-- 歌曲名、歌手名 -->
        <Text x="#screen_width" y="61" w="400" align="center" alignV="center"
              textExp="ifelse(strIsEmpty(@music.title),'--There is nothing--',@music.title + '  ' + @music.artist)"
              color="#ffffff" size="39" marqueeSpeed="30" bold="true"/>

        <!-- 按钮:上一曲、播放、暂停、下一曲 -->
        <!--播放-->
        <Button name="music_play" x="#screen_width" y="61" w="400" h="100" align="center" alignChildren="true">

        </Button>
        <!--暂停-->
        <Button name="music_pause" x="#screen_width" y="61" w="400" h="100" align="center" alignChildren="true">

        </Button>
    </MusicControl>

    <!--通知消息-->
    <VariableBinders>
        <!-- 查询通知 -->
        <ContentProviderBinder name="data" uri="content://keyguard.notification/notifications"
                               columns="icon,title,content,time,key" countName="hasnotifications">
            <Variable name="notice_icon0" type="blob.bitmap" column="icon" row="0"/>
            <Variable name="notice_icon1" type="blob.bitmap" column="icon" row="1"/>
            <Variable name="notice_icon2" type="blob.bitmap" column="icon" row="2"/>
            <Variable name="notice_icon3" type="blob.bitmap" column="icon" row="3"/>
            <Variable name="notice_title" type="string[]" column="title"/>
            <Variable name="notice_content" type="string[]" column="content"/>
            <Variable name="notice_time" type="string[]" column="time"/>
            <Variable name="notice_key" type="string[]" column="key"/>
            <Trigger>
                <AnimationCommand target="noticeUp" command="play(0,0)"/>
                <AnimationCommand target="_noticeAni" command="play(0,0)"/>
            </Trigger>
        </ContentProviderBinder>
    </VariableBinders>

    <!-- 通知 -->
    <Group y="750-#unlockMove" alpha="255-#unlockMove">
        <Var name="_noticeMove" expression="int(#touch_x-#touch_begin_x)*#noticeMoveDown+#_noticeAni"/>
        <Var name="_noticeAni">
            <VariableAnimation loop="false" initPause="true">
                <Item value="0" time="0"/>
                <Item value="int(#touch_x-#touch_begin_x)" time="100"/>
                <Item value="ifelse(int(#touch_x-#touch_begin_x)}=300,1080,0)" time="300"/>
                <Triggers>
                    <Trigger action="end" condition="#_noticeAni == 1080">
                        <AnimationCommand target="noticeUp" command="play"/>
                    </Trigger>
                </Triggers>
            </VariableAnimation>
        </Var>
        <Var name="noticeUp">
            <VariableAnimation name="noticeUpAni" loop="false" initPause="true">
                <AniFrame value="0" time="0"/>
                <AniFrame value="1" time="300"/>
                <Triggers>
                    <Trigger action="end" condition="#noticeUpAni.current_frame == -1">
                        <MultiCommand>
                            <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[#noticeDown]"/>
                                <Extra name="com.miui.app.ExtraStatusBarManager.extra_notification_click" type="int"
                                       expression="0"/>
                            </IntentCommand>
                        </MultiCommand>
                    </Trigger>
                </Triggers>
            </VariableAnimation>
        </Var>
        <!-- count="4" 最多显示4条消息;size="4" 消息时间,显示几条消息就有几个时间 -->
        <Array count="4" indexName="_notice" visibility="#hasnotifications}0">
            <Button x="ifelse(#noticeDown==#_notice,#_noticeMove,0)"
                    y="#_notice*240 - ifelse(#_notice}#noticeDown,#noticeUp*193,0)" w="1080" h="220"
                    alignChildren="true" alpha="ifelse(#noticeDown==#_notice,255-int(#_noticeMove)/3,255)"
                    visibility="#_notice { #hasnotifications">
                <Normal>
                    <Rectangle x="120" w="840" h="220" fillColor="#ffffff" cornerRadius="60"/>
                </Normal>
                <Pressed>
                    <Rectangle x="120" w="840" h="220" fillColor="#eeeeee" cornerRadius="60"/>
                </Pressed>
                <Text name="noticeTime" x="#screen_width-183" y="70" align="right" alignV="center" color="#BFB7BE"
                      size="32" spacingAdd="1" textExp="@notice_time[#_notice]"/>
                <Text x="300" y="70" w="#screen_width-300-66- ifelse(#time_format,100,150)" alignV="center"
                      color="#000000" size="38" marqueeSpeed="30" textExp="@notice_title[#_notice]" bold="true"/>
                <Text x="300" y="129" w="#screen_width-300-66" alignV="center" color="#606160" size="36"
                      marqueeSpeed="30" textExp="@notice_content[#_notice]" fontFamily="miui-regular"/>
                <Triggers>
                    <Trigger action="down">
                        <VariableCommand name="noticeDown" expression="#_notice"/>
                        <VariableCommand name="noticeMoveDown" expression="1"/>
                    </Trigger>
                    <Trigger action="up,cancel">
                        <VariableCommand name="noticeMoveDown" expression="0"/>
                        <AnimationCommand target="_noticeAni" command="play(100,300)"/>
                        <IntentCommand action="com.miui.app.ExtraStatusBarManager.action_remove_keyguard_notification"
                                       broadcast="true" condition="abs(#touch_x-#touch_begin_x){10">
                            <Extra name="com.miui.app.ExtraStatusBarManager.extra_notification_key" type="int"
                                   expression="@notice_key[#noticeDown]"/>
                            <Extra name="com.miui.app.ExtraStatusBarManager.extra_notification_click" type="int"
                                   expression="1"/>
                        </IntentCommand>
                    </Trigger>
                </Triggers>
            </Button>
        </Array>
        <!-- 头像坐标;50 x坐标,30 y坐标;60 w宽度;60 h高度 -->
        <Var name="noticeIconXYWH" type="number[]" values="60,36,110,110" const="true"/>
        <!-- 通知图标;name 图标名称,从0-3,表示共计四条;visibility,用 hasnotifications 控制是否需要显示头像  -->
        <Image name="notice_icon0" x="#noticeIconXYWH[0]+ifelse(#noticeDown==0,#_noticeMove,0)+100"
               y="#noticeIconXYWH[1]+0*240+8 - ifelse(0}#noticeDown,#noticeUp*193,0)" w="#noticeIconXYWH[2]"
               h="#noticeIconXYWH[3]" alpha="ifelse(#noticeDown==0,255-int(#_noticeMove)/3,255)"
               visibility="#hasnotifications}=1"/>
        <Image name="notice_icon1" x="#noticeIconXYWH[0]+ifelse(#noticeDown==1,#_noticeMove,0)+100"
               y="#noticeIconXYWH[1]+1*240+8 - ifelse(1}#noticeDown,#noticeUp*193,0)" w="#noticeIconXYWH[2]"
               h="#noticeIconXYWH[3]" alpha="ifelse(#noticeDown==1,255-int(#_noticeMove)/3,255)"
               visibility="#hasnotifications}=2"/>
        <Image name="notice_icon2" x="#noticeIconXYWH[0]+ifelse(#noticeDown==2,#_noticeMove,0)+100"
               y="#noticeIconXYWH[1]+2*240+8 - ifelse(2}#noticeDown,#noticeUp*193,0)" w="#noticeIconXYWH[2]"
               h="#noticeIconXYWH[3]" alpha="ifelse(#noticeDown==2,255-int(#_noticeMove)/3,255)"
               visibility="#hasnotifications}=3"/>
        <Image name="notice_icon3" x="#noticeIconXYWH[0]+ifelse(#noticeDown==3,#_noticeMove,0)+100"
               y="#noticeIconXYWH[1]+3*240+8 - ifelse(3}#noticeDown,#noticeUp*193,0)" w="#noticeIconXYWH[2]"
               h="#noticeIconXYWH[3]" alpha="ifelse(#noticeDown==3,255-int(#_noticeMove)/3,255)"
               visibility="#hasnotifications}=4"/>
    </Group>

    <!--解锁文字提示-->
    <Text x="#screen_width/2" y="#screen_height-100-#unlockMove" alpha="255-#unlockMove" align="center" alignV="center"
          color="#ffffff" size="42" text="向上滑动解锁"/>
    <!--解锁相关 变量、动画、按钮-->
    <Group name="Unlock">
        <!--实时变量-->
        <Var name="unlockMove"
             expression="ifelse(#unlockDown==1,max(#touch_begin_y-#touch_y,0),max(#touch_begin_y-#touch_y,0) { 300,max(#touch_begin_y-#touch_y,0)*(1-#unlockBack),0)"/>
        <!--动画-->
        <Var name="unlockBack">
            <VariableAnimation initPause="true" target="panel_framerate" loop="false">
                <AniFrame value="0" time="0" easeType="BounceEaseOut"/>
                <AniFrame value="1" time="1000"/>
            </VariableAnimation>
        </Var>
        <!--解锁按钮-->
        <Button w="#screen_width" h="#screen_height">
            <Triggers>
                <Trigger action="down">
                    <VariableCommand name="unlockDown" expression="1"/>
                </Trigger>
                <Trigger action="up,cancel">
                    <VariableCommand name="unlockDown" expression="0"/>
                    <Command target="unlockBack.animation" value="play"/>
                    <!--condition 执行条件,当 max(#touch_begin_y-#touch_y,0) 大于等于 300px 时 unlock-->
                    <ExternCommand command="unlock" condition="max(#touch_begin_y-#touch_y,0) }= 300"/>
                </Trigger>
            </Triggers>
        </Button>
    </Group>

    <!-- 开启系统充电动画 -->
    <ExternCommand command="disableChargeAnim" numPara="0"/>

</Lockscreen>

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值