allow rich notifications in the heads up.

new shouldInterrupt logic: screen on, not locked, not dreaming, and
  priority above HIGH and noisy, or has fullscreen intent
draft of API allowing devs to give hints about head up display

reuse inflateViews()
add an expand helper to the heads up space
move some things into Entry for reuse

don't allow touches in first second
delay decay if touched
make decay time a resource

add a custom viewgroup for notification rows to get view management
out of the NotificationData class.

Change-Id: I36464f110cfa0dabc3f35db7db6c35c27e8ee2ba
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
new file mode 100644
index 0000000..cd6495f
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+
+public class ExpandableNotificationRow extends FrameLayout {
+    private int mRowHeight;
+
+    /** does this row contain layouts that can adapt to row expansion */
+    private boolean mExpandable;
+    /** has the user manually expanded this row */
+    private boolean mUserExpanded;
+    /** is the user touching this row */
+    private boolean mUserLocked;
+
+    public ExpandableNotificationRow(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public int getRowHeight() {
+        return mRowHeight;
+    }
+
+    public void setRowHeight(int rowHeight) {
+        this.mRowHeight = rowHeight;
+    }
+
+    public boolean isExpandable() {
+        return mExpandable;
+    }
+
+    public void setExpandable(boolean expandable) {
+        mExpandable = expandable;
+    }
+
+    public boolean isUserExpanded() {
+        return mUserExpanded;
+    }
+
+    public void setUserExpanded(boolean userExpanded) {
+        mUserExpanded = userExpanded;
+    }
+
+    public boolean isUserLocked() {
+        return mUserLocked;
+    }
+
+    public void setUserLocked(boolean userLocked) {
+        mUserLocked = userLocked;
+    }
+
+    public void setExpanded(boolean expand) {
+        ViewGroup.LayoutParams lp = getLayoutParams();
+        if (expand && mExpandable) {
+            lp.height = ViewGroup.LayoutParams.WRAP_CONTENT;
+        } else {
+            lp.height = mRowHeight;
+        }
+        setLayoutParams(lp);
+    }
+}