@Override
 protected void onAttachedToWindow() {
   super.onAttachedToWindow();
   latestItems = (NotificationRowLayout) findViewById(R.id.content);
   int minHeight = getResources().getDimensionPixelSize(R.dimen.notification_row_min_height);
   int maxHeight = getResources().getDimensionPixelSize(R.dimen.notification_row_max_height);
   mExpandHelper = new ExpandHelper(mContext, latestItems, minHeight, maxHeight);
   mExpandHelper.setEventSource(this);
   mExpandHelper.setGravity(Gravity.BOTTOM);
 }
  @Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    MotionEvent cancellation = MotionEvent.obtain(ev);
    cancellation.setAction(MotionEvent.ACTION_CANCEL);

    boolean intercept = mExpandHelper.onInterceptTouchEvent(ev) || super.onInterceptTouchEvent(ev);
    if (intercept) {
      latestItems.onInterceptTouchEvent(cancellation);
    }
    return intercept;
  }
 @Override
 public boolean onTouchEvent(MotionEvent ev) {
   boolean handled = mExpandHelper.onTouchEvent(ev) || super.onTouchEvent(ev);
   return handled;
 }