Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slide to Unlock Animation in Android

I want to create the "slide to unlock" animation that is found on iPhones, on my Android application. Basically have a running wave-like color animation through a textview. Any ideas? Thanks for any help!

like image 494
user3777343 Avatar asked Nov 01 '22 17:11

user3777343


1 Answers

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

Information on how to use it is in the wiki.

But for the sake of completion:

Add a ShimmerTextView to your layout:

<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

like image 98
Display name Avatar answered Nov 11 '22 00:11

Display name