当前位置:网站首页>launcher切页动画
launcher切页动画
2022-06-21 05:06:00 【纵容_伊人倩影】
launcher切页动画
刚工作的时候,还是launcher4.4,好像有很多切页特效可以选,重写切页特效类可以自己实现切页效果。
太久不搞launcher,忘记在哪实现切页特效了,比如什么外盒子、内盒子、旋转、仿真等等
扯远了,这篇文章简单写一下launcher切页,launcher中左右滑动页面切换动画速度调整。
1、launcher页面切页
launcher切页处理在src/com/android/launcher3/PagedView.java中
public boolean onTouchEvent(MotionEvent ev) {
}
具体就不写啦,小伙伴自己打断点吧。
切页分为2中:
快速滑动抛出:会有一个速度,根据速度衰减计算切页动画时间
protected boolean snapToPageWithVelocity(int whichPage, int velocity)
缓慢拖拽到一定距离松手:根据距离计算当前页面切页进度,判断是返回上一页还是切到下一页。
public static final int PAGE_SNAP_ANIMATION_DURATION = 300;
可以自己修改动画时间,加快切页。
2、负一屏和launcher切页
负一屏和第0页的切换
1、从第0页切到负一屏
PagedView的onTouchEvent还是会走,但是mNextPage都是0,不管切页成功还是滑动太少还在第0页。
那是哪里控制是否切到负一屏呢???
2、从负一屏切到第0页
src/com/android/launcher3/Workspace.java中public void onOverlayScrollChanged(float scroll) {}
打印调用堆栈发现是负一屏主动回调的launcher,切页不受launcher控制,无法修改动画时间。
2022-06-14 16:37:22.993 1837-1837/com.tblenovo.launcher I/OverlayCallbackImpl: onOverlayScrollChanged scroll : 0.0
2022-06-14 16:37:22.993 1837-1837/com.tblenovo.launcher D/Launcher.Workspace: onOverlayScrollChanged scroll : 0.0 call: java.lang.Throwable
at com.android.launcher3.Workspace.onOverlayScrollChanged(Workspace.java:1043)
at com.android.launcher3.Launcher$LauncherOverlayCallbacksImpl.onScrollChanged(Launcher.java:1669)
at com.android.searchlauncher.OverlayCallbackImpl.onOverlayScrollChanged(OverlayCallbackImpl.java:297)
at com.google.android.mediahome.launcheroverlay.client.zzg.handleMessage(com.google.android.mediahome.launcheroverlay:mediahome-[email protected]@1.1.0-eap:20)
边栏推荐
- ESP32 SSL/TLS 双向认证实践
- 带图讲解,深度学习YOLO里面的anchors的进阶理解
- 深入探索创客教育的技术特征
- C # get the native request XML of the WebService interface called by the client
- Super classic MySQL common functions, collect them quickly
- 外星人大战源码
- 1976 international standard atmospheric model_ Matlab
- Une partie importante du plug - in Unity photon (PUN) que les singes peuvent utiliser
- JS 中的 Event Loop 是什么?
- 适配器模式Adapter
猜你喜欢

ESP32 SSL/TLS 双向认证实践

June 6-12, 2022 AI industry weekly (issue 101): start again
![[introduction to UVM== > episode_6] ~ synchronous communication element](/img/aa/1df3397bd4398bb6f7ec03d0e349da.png)
[introduction to UVM== > episode_6] ~ synchronous communication element
![[introduction to UVM== > episode_5] ~ TLM communication](/img/0d/4b3f34b4e6ed8c15a03d4d9c255bc4.png)
[introduction to UVM== > episode_5] ~ TLM communication

Through series voltage division, 12V is changed to 5V, which is too inefficient

【 uvm startup = = > Episode 6】 ~ synchrone communication element

Shell script iterates through the values in the log file to sum and calculate the average, maximum and minimum values

Selenium principle application - simulate selenium driven browser with requests

【UVM入門 ===> Episode_6 】~ 同步通信元件

Improve the efficiency of software R & D team
随机推荐
Cvpr2017/ image translation: image to image translation with conditional adversarial networks
SUSE system settings
Intelligent storage | video DNA, unique security logo
[data warehouse modeling] what is the difference between traditional modeling and wide table modeling? Wide table based modeling practice
VMware disk expansion part presentation
Glycosylated albumin research - abbexa ELISA kit to help!
[database] what causes index invalidation
Idea debug occurs: skipped breakpoint at because it happened inside debugger evaluation
JS 中的 Event Loop 是什么?
What is a multi domain SSL certificate? What is the difference with wildcard certificates?
LeetCode-80
进程间通信-----aidl
Why Chrome browser is multi process rather than multi thread
Q & A: problems related to "micro build low code" data source
Abnova鸡抗棉鼠 IgG (H&L) 二抗 (HRP) 方案
MyBaits-plus
【数仓建模】传统建模与宽表建模有何差异?基于宽表建模实践
The future of Data Analytics: smartbi teaches you how to enhance analytics
迎接创客教育+互联网的黄金时代
The golang regular regexp package uses -03- to find matching strings, find matching string positions, and regular grouping (findsubmatch series methods, findsubmatchindex series methods)