New View.dispatchDisplayHint() API.
Bug #2399147

This new API will be used by scrollable containers to tell children that they
are/are not displayed. This will allow lists to hide their filter popup window
for instance.
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a3d3521..31c9b08 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3789,7 +3789,8 @@
      * ViewGroups should override to route to their children.
      * @param changedView The view whose visibility changed. Could be 'this' or
      * an ancestor view.
-     * @param visibility The new visibility of changedView.
+     * @param visibility The new visibility of changedView: {@link #VISIBLE},
+     * {@link #INVISIBLE} or {@link #GONE}.
      */
     protected void dispatchVisibilityChanged(View changedView, int visibility) {
         onVisibilityChanged(changedView, visibility);
@@ -3799,12 +3800,38 @@
      * Called when the visibility of the view or an ancestor of the view is changed.
      * @param changedView The view whose visibility changed. Could be 'this' or
      * an ancestor view.
-     * @param visibility The new visibility of changedView.
+     * @param visibility The new visibility of changedView: {@link #VISIBLE},
+     * {@link #INVISIBLE} or {@link #GONE}.
      */
     protected void onVisibilityChanged(View changedView, int visibility) {
     }
 
     /**
+     * Dispatch a hint about whether this view is displayed. For instance, when
+     * a View moves out of the screen, it might receives a display hint indicating
+     * the view is not displayed. Applications should not <em>rely</em> on this hint
+     * as there is no guarantee that they will receive one.
+     * 
+     * @param hint A hint about whether or not this view is displayed:
+     * {@link #VISIBLE} or {@link #INVISIBLE}.
+     */
+    public void dispatchDisplayHint(int hint) {
+        onDisplayHint(hint);
+    }
+
+    /**
+     * Gives this view a hint about whether is displayed or not. For instance, when
+     * a View moves out of the screen, it might receives a display hint indicating
+     * the view is not displayed. Applications should not <em>rely</em> on this hint
+     * as there is no guarantee that they will receive one.
+     * 
+     * @param hint A hint about whether or not this view is displayed:
+     * {@link #VISIBLE} or {@link #INVISIBLE}.
+     */
+    protected void onDisplayHint(int hint) {
+    }
+
+    /**
      * Dispatch a window visibility change down the view hierarchy.
      * ViewGroups should override to route to their children.
      *