锁屏的一些动画
紧急呼救或者锁屏相机按返回键返回锁屏时,播放的动画是wallpaper_open_exit,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | private boolean setKeyguardOccludedLw( boolean isOccluded) { boolean wasOccluded = mKeyguardOccluded; boolean showing = mKeyguardDelegate.isShowing(); if (wasOccluded && !isOccluded && showing) { mKeyguardOccluded = false ; mKeyguardDelegate.setOccluded( false , true /* animate */ ); mStatusBar.getAttrs().privateFlags |= PRIVATE_FLAG_KEYGUARD; if (!mKeyguardDelegate.hasLockscreenWallpaper()) { mStatusBar.getAttrs().flags |= FLAG_SHOW_WALLPAPER; } Animation anim = AnimationUtils.loadAnimation(mContext, com.android.internal.R.anim.wallpaper_open_exit); mWindowManagerFuncs.overridePlayingAppAnimationsLw(anim); return true ; } else if (!wasOccluded && isOccluded && showing) { mKeyguardOccluded = true ; mKeyguardDelegate.setOccluded( true , false /* animate */ ); mStatusBar.getAttrs().privateFlags &= ~PRIVATE_FLAG_KEYGUARD; mStatusBar.getAttrs().flags &= ~FLAG_SHOW_WALLPAPER; return true ; } else { return false ; } } |
如果返回过程中会闪现桌面壁纸,可更改该动画,如下:将位移动画注释掉
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <set xmlns:android= "http://schemas.android.com/apk/res/android" android:shareInterpolator= "false" android:zAdjustment= "top" > <!--gome add by jwb--> <alpha android:fromAlpha= "1.0" android:toAlpha= "1.0" android:fillEnabled= "true" android:fillBefore= "true" android:fillAfter= "true" android:interpolator= "@interpolator/accelerate_quad" android:startOffset= "250" android:duration= "500" /> <!--<translate android:fromYDelta= "0" android:toYDelta= "110%" android:fillEnabled= "true" android:fillBefore= "true" android:fillAfter= "true" android:interpolator= "@interpolator/fast_out_linear_in" android:duration= "225" /> <scale android:fromXScale= "1.0" android:toXScale= "1.0" android:fromYScale= "1.0" android:toYScale= "1.0" android:fillEnabled= "true" android:fillBefore= "true" android:fillAfter= "true" android:pivotX= "50%p" android:pivotY= "50%p" android:interpolator= "@interpolator/fast_out_slow_in" android:duration= "225" />--> </set> |
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从二进制到误差:逐行拆解C语言浮点运算中的4008175468544之谜
· .NET制作智能桌面机器人:结合BotSharp智能体框架开发语音交互
· 软件产品开发中常见的10个问题及处理方法
· .NET 原生驾驭 AI 新基建实战系列:向量数据库的应用与畅想
· 从问题排查到源码分析:ActiveMQ消费端频繁日志刷屏的秘密
· C# 13 中的新增功能实操
· Vue3封装支持Base64导出的电子签名组件
· 万字长文详解Text-to-SQL
· Ollama本地部署大模型总结
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(4)