[Android] Add a little easter egg in the about activity

Ludovic Fauvet git at videolan.org
Wed Jun 27 14:16:37 CEST 2012


android | branch: master | Ludovic Fauvet <etix at videolan.org> | Wed Jun 27 11:55:32 2012 +0200| [06b11389f2357412c3067a9496afae51d35e31b3] | committer: Ludovic Fauvet

Add a little easter egg in the about activity

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=06b11389f2357412c3067a9496afae51d35e31b3
---

 vlc-android/res/layout/about_main.xml               |    1 +
 .../src/org/videolan/vlc/gui/AboutMainFragment.java |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/vlc-android/res/layout/about_main.xml b/vlc-android/res/layout/about_main.xml
index e3be6fd..34f2633 100644
--- a/vlc-android/res/layout/about_main.xml
+++ b/vlc-android/res/layout/about_main.xml
@@ -20,6 +20,7 @@
             android:orientation="horizontal" >
 
             <ImageView
+                android:id="@+id/logo"
                 android:layout_width="80dp"
                 android:layout_height="fill_parent"
                 android:contentDescription="@string/info"
diff --git a/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java b/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java
index 32a6084..dedd860 100644
--- a/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/AboutMainFragment.java
@@ -28,7 +28,13 @@ import android.support.v4.app.Fragment;
 import android.text.Html;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.View.OnClickListener;
 import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.AnimationSet;
+import android.view.animation.DecelerateInterpolator;
+import android.view.animation.RotateAnimation;
+import android.widget.ImageView;
 import android.widget.TextView;
 
 public class AboutMainFragment extends Fragment {
@@ -50,6 +56,19 @@ public class AboutMainFragment extends Fragment {
         TextView textview_rev = (TextView) v.findViewById(R.id.main_revision);
         textview_rev.setText(getResources().getString(R.string.revision) + " " + revision + " (" + builddate + ")");
 
+        final ImageView logo = (ImageView) v.findViewById(R.id.logo);
+        logo.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                AnimationSet anim = new AnimationSet(true);
+                RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
+                rotate.setDuration(800);
+                rotate.setInterpolator(new DecelerateInterpolator());
+                anim.addAnimation(rotate);
+                logo.startAnimation(anim);
+            }
+        });
+
         return v;
     }
 }



More information about the Android mailing list