Add support for Gravity BEFORE and AFTER

- update layouts
- add Callback2 for RTL aware Drawable
- add unit tests

Change-Id: Ic64d0291e262170aff7297c6580b0b422eaa8d89
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 98d07c4..90e780d 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -631,7 +631,7 @@
  *
  * @see android.view.ViewGroup
  */
-public class View implements Drawable.Callback, KeyEvent.Callback, AccessibilityEventSource {
+public class View implements Drawable.Callback2, KeyEvent.Callback, AccessibilityEventSource {
     private static final boolean DBG = false;
 
     /**
@@ -10238,6 +10238,15 @@
         }
     }
 
+     /**
+     * Check if a given Drawable is in RTL layout direction.
+     *
+     * @param who the recipient of the action
+     */
+    public boolean isLayoutRtl(Drawable who) {
+        return (who == mBGDrawable) && isLayoutRtl();
+    }
+
     /**
      * If your view subclass is displaying its own Drawable objects, it should
      * override this function and return true for any Drawable it is