Fixed several bugs introduced by the new background views.

Also notifications are now limited to 4U again.
Bug: 14880580

Change-Id: I05d19981ad1bb06687bf6c994608e21ac925a759
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
index 061396d..5cb1b78 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableView.java
@@ -20,12 +20,12 @@
 import android.util.AttributeSet;
 import android.view.MotionEvent;
 import android.view.View;
-import android.widget.FrameLayout;
+import android.view.ViewGroup;
 
 /**
  * An abstract view for expandable views.
  */
-public abstract class ExpandableView extends FrameLayout {
+public abstract class ExpandableView extends ViewGroup {
 
     private OnHeightChangedListener mOnHeightChangedListener;
     protected int mActualHeight;
@@ -38,7 +38,17 @@
 
     @Override
     protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
+        for (int i = 0; i < getChildCount(); i++) {
+            View child = getChildAt(i);
+            int height = child.getMeasuredHeight();
+            int width = child.getMeasuredWidth();
+            int center = getWidth() / 2;
+            int childLeft = center - width / 2;
+            child.layout(childLeft,
+                    0,
+                    childLeft + width,
+                    height);
+        }
         if (!mActualHeightInitialized && mActualHeight == 0) {
             mActualHeight = getInitialHeight();
         }