简体   繁体   English

在Android中滑动以解锁动画

[英]Slide to Unlock Animation in Android

I want to create the "slide to unlock" animation that is found on iPhones, on my Android application. 我想在我的Android应用程序上创建iPhone上的“幻灯片解锁”动画。 Basically have a running wave-like color animation through a textview. 基本上通过textview有一个类似于波浪的彩色动画。 Any ideas? 有任何想法吗? Thanks for any help! 谢谢你的帮助!

https://github.com/RomainPiel/Shimmer-android https://github.com/RomainPiel/Shimmer-android

Information on how to use it is in the wiki. 有关如何使用它的信息在wiki中。

But for the sake of completion: 但为了完成:

Add a ShimmerTextView to your layout: 在您的布局中添加ShimmerTextView:

<com.romainpiel.shimmer.ShimmerTextView
    android:id="@+id/shimmer_tv"
    android:text="@string/shimmer"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#444"
    android:textSize="50sp"/>

To start the animation: 要开始动画:

shimmer = new Shimmer();
shimmer.start(myShimmerTextView);

You may want to keep track of the shimmer instance after the animation is started if you want to stop it. 如果要停止动画,可能需要在动画启动后跟踪闪烁实例。

To stop it: 要阻止它:

shimmer.cancel();

Enjoy :D 享受 :D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM