RevealLayout-实现页面间波纹动画效果切换.zip

时间:2022-10-13 22:00:38
【文件属性】:
文件名称:RevealLayout-实现页面间波纹动画效果切换.zip
文件大小:47KB
文件格式:ZIP
更新时间:2022-10-13 22:00:38
开源项目 实现页面间波纹动画效果切换。可配合Activity或Fragment间切换。如果是Activity间切换,你需要将Activity背景设为透明,否则影响切换效果。而Fragment间就不存在这样的问题,可以实现流畅、无缝切换。项目地址:https://github.com/kyze8439690/RevealLayout 效果图:单击上面的"下载源码"按钮,可下载完整demo。一个是官方的demo,比较复杂, 一个是我简化的。如何使用将被跳转页的根布局改为     ...你的页面的View      2. 得到RevealLayoutmRevealLayout = (RevealLayout)this.findViewById(R.id.reveal_layout);3. 为RevealLayout的ViewTreeObserver添加监听ViewTreeObserver.OnGlobalLayoutListener, 在监听中调用show()来启动进入页面波动动画。mRevealLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {             @Override             public void onGlobalLayout() { //                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { //                    mRevealLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this); //                } else { //                    mRevealLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this); //                }                 mRevealLayout.postDelayed(new Runnable() {//设置了50毫秒的延时                     @Override                     public void run() {                         mRevealLayout.show();                     }                 }, 50);             }         });你可以调用mRevealLayout.hide()来启动关闭页面波动动画。如果是Activity间跳转,你还需要调用finish()才能退出页面。
【文件预览】:
RevealLayout-master
----.travis.yml(95B)
----library()
--------proguard-rules.pro(662B)
--------src()
--------.gitignore(7B)
--------build.gradle(491B)
----LICENSE(11KB)
----app()
--------src()
--------.gitignore(7B)
--------build.gradle(460B)
----sketch()
--------app_icon.sketch(32KB)
----.gitignore(63B)
----README.md(1KB)
----settings.gradle(27B)
----build.gradle(436B)

网友评论