import com.android.internal.widget.SizeAdaptiveLayout;
import com.android.systemui.R;
-public class ExpandableNotificationRow extends FrameLayout {
+public class ExpandableNotificationRow extends FrameLayout
+ implements LatestItemView.OnActivatedListener {
private int mRowMinHeight;
private int mRowMaxHeight;
private SizeAdaptiveLayout mPrivateLayout;
private int mMaxExpandHeight;
private boolean mMaxHeightNeedsUpdate;
+ private NotificationActivator mActivator;
+ private LatestItemView.OnActivatedListener mOnActivatedListener;
public ExpandableNotificationRow(Context context, AttributeSet attrs) {
super(context, attrs);
mPublicLayout = (SizeAdaptiveLayout) findViewById(R.id.expandedPublic);
mPrivateLayout = (SizeAdaptiveLayout) findViewById(R.id.expanded);
mLatestItemView = (LatestItemView) findViewById(R.id.container);
- }
+ mActivator = new NotificationActivator(this);
+ mLatestItemView.setOnActivatedListener(this);
+ }
public void setHeightRange(int rowMinHeight, int rowMaxHeight) {
mRowMinHeight = rowMinHeight;
*/
public void setDimmed(boolean dimmed) {
mLatestItemView.setDimmed(dimmed);
+ mActivator.setDimmed(dimmed);
}
public int getMaxExpandHeight() {
public void setLocked(boolean locked) {
mLatestItemView.setLocked(locked);
}
+
+ public void setOnActivatedListener(LatestItemView.OnActivatedListener listener) {
+ mOnActivatedListener = listener;
+ }
+
+ public NotificationActivator getActivator() {
+ return mActivator;
+ }
+
+ @Override
+ public void onActivated(View view) {
+ if (mOnActivatedListener != null) {
+ mOnActivatedListener.onActivated(this);
+ }
+ }
+
+ @Override
+ public void onReset(View view) {
+ if (mOnActivatedListener != null) {
+ mOnActivatedListener.onReset(this);
+ }
+ }
+
+ /**
+ * Sets the resource id for the background of this notification.
+ *
+ * @param bgResId The background resource to use in normal state.
+ * @param dimmedBgResId The background resource to use in dimmed state.
+ */
+ public void setBackgroundResourceIds(int bgResId, int dimmedBgResId) {
+ mLatestItemView.setBackgroundResourceIds(bgResId, dimmedBgResId);
+ }
}