[Android] VideoGridAnimator: add comments

Ludovic Fauvet git at videolan.org
Fri Oct 12 00:53:10 CEST 2012


vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Fri Oct 12 00:52:12 2012 +0200| [047abc0f338f61d5649229fc04cdf612f9ffd931] | committer: Ludovic Fauvet

VideoGridAnimator: add comments

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=047abc0f338f61d5649229fc04cdf612f9ffd931
---

 .../src/org/videolan/vlc/gui/video/VideoGridAnimator.java        |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridAnimator.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridAnimator.java
index a1436bc..13f4f1b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridAnimator.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridAnimator.java
@@ -56,6 +56,10 @@ public class VideoGridAnimator {
         mGridView.post(r);
     }
 
+    /* If animation is running, hide the items as they are added to the grid
+     * so they don't flicker after being laid out and before the animation
+     * starts.
+     */
     OnHierarchyChangeListener mHCL = new OnHierarchyChangeListener() {
         @Override
         public void onChildViewRemoved(View parent, View child) {
@@ -72,7 +76,9 @@ public class VideoGridAnimator {
     final Runnable r = new Runnable() {
         @Override
         public void run() {
+            /* Ensure the number of visible items is stable between two run */
             if (mGridView.getChildCount() != mLastNItems) {
+                /* List not not ready yet: reschedule */
                 mLastNItems = mGridView.getChildCount();
                 Log.e(TAG, "Rescheduling animation: list not ready");
                 mGridView.postDelayed(this, 10);



More information about the Android mailing list