OSDN Git Service

send accessibility events on view property invalidation
authorGuang Zhu <guangzhu@google.com>
Fri, 2 May 2014 04:12:55 +0000 (21:12 -0700)
committerGuang Zhu <guangzhu@google.com>
Wed, 7 May 2014 01:23:15 +0000 (18:23 -0700)
from certain call sites of invalidateViewProperty, appropriate
accessibility event needs to be delivered as well.

Below is a list of call references found, ones with "*" are
modified by this change:

package: android.view
View
  *offsetLeftAndRight(int) (4 matches)
  *offsetTopAndBottom(int) (4 matches)
  *setAlpha(float)
  setCameraDistance(float) (2 matches)
  setLayerPaint(Paint)
  setPivotX(float) (2 matches)
  setPivotY(float) (2 matches)
  *setRotation(float) (2 matches)
  *setRotationX(float) (2 matches)
  *setRotationY(float) (2 matches)
  *setScaleX(float) (2 matches)
  *setScaleY(float) (2 matches)
  setTransitionAlpha(float)
  *setTranslationX(float) (2 matches)
  *setTranslationY(float) (2 matches)
ViewGroup
  *offsetChildrenTopAndBottom(int)
ViewOverlay
  OverlayViewGroup
    invalidateViewProperty(boolean, boolean) (2 matches)
ViewPropertyAnimator
  AnimatorEventListener
    onAnimationUpdate(ValueAnimator) (2 matches)

Bug: 14262013

Change-Id: Ibc9ed438f476ad10a6ad8df668142958c5903f55

core/java/android/view/View.java
core/java/android/view/ViewGroup.java

index e6debc1..cf414bb 100644 (file)
@@ -9627,6 +9627,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -9678,6 +9679,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -9729,6 +9731,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -9772,6 +9775,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -9815,6 +9819,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -10000,6 +10005,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 if (mDisplayList != null) {
                     mDisplayList.setAlpha(getFinalAlpha());
                 }
+                notifyViewAccessibilityStateChangedIfNeeded(
+                        AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED);
             }
         }
     }
@@ -10433,6 +10440,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -10474,6 +10482,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 // View was rejected last time it was drawn by its parent; this may have changed
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -10620,6 +10629,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 }
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
@@ -10668,6 +10678,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                 }
                 invalidateParentIfNeeded();
             }
+            notifySubtreeAccessibilityStateChangedIfNeeded();
         }
     }
 
index f346ee8..dda5a60 100644 (file)
@@ -4573,6 +4573,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
         if (invalidate) {
             invalidateViewProperty(false, false);
         }
+        notifySubtreeAccessibilityStateChangedIfNeeded();
     }
 
     /**