title: OnSwipeListener and ExpandableListView click not recognized
body: <p>I have a problem recognizing onGroup clicks on my expandable list view. I am using a custom swipe listener for my group views for sliding purposes. Now all I want is to expand groups while pressing on them and it seems I can't find the right way to register both OnTouch and onGroupClick on the groups view. I am calling false when I am not swiping so other gestures can be recognizable (such as normal clicks and long clicks), but my group is not responding to clicks and therefore not expanding. </p>
  
  <p>Right now my Swipe listener is working properly but OnGroupClick is not called and not expanding. When I remove my OnSwipeListener from getGroupView() method, the actual expanding is properly working.</p>
  
  <p>My custom on swipe listener:</p>
  
  <pre><code>public class OnSwipeListener implements View.OnTouchListener
  {
      private final GestureDetector gestureDetector = new GestureDetector(new GestureListener());
  
      public boolean onTouch(final View v, final MotionEvent event)
      {
          return gestureDetector.onTouchEvent(event);
      }
  
      private final class GestureListener extends GestureDetector.SimpleOnGestureListener
      {
  
          private static final int SWIPE_THRESHOLD = 70;
          private static final int SWIPE_VELOCITY_THRESHOLD = 70;
  
          @Override
          public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
          {
              boolean result = false;
              try
              {
                  float diffY = e2.getY() - e1.getY();
                  float diffX = e2.getX() - e1.getX();
                  if (Math.abs(diffX) &gt; Math.abs(diffY))
                  {
                      if (Math.abs(diffX) &gt; SWIPE_THRESHOLD &amp;&amp; Math.abs(velocityX) &gt; SWIPE_VELOCITY_THRESHOLD)
                      {
                          if (diffX &gt; 0)
                          {
                              result = onSwipeRight();
                          }
                          else
                          {
                              result = onSwipeLeft();
                          }
                      }
                  }
                  else
                  {
                      if (Math.abs(diffY) &gt; SWIPE_THRESHOLD &amp;&amp; Math.abs(velocityY) &gt; SWIPE_VELOCITY_THRESHOLD)
                      {
                          if (diffY &gt; 0)
                          {
                              result = onSwipeBottom();
                          }
                          else
                          {
                              result = onSwipeTop();
                          }
                      }
                  }
              }
              catch (Exception exception)
              {
                  exception.printStackTrace();
              }
              return result;
          }
      }
  
      public boolean onSwipeRight()
      {
          return false;
      }
  
      public boolean onSwipeLeft()
      {
          return false;
      }
  
      public boolean onSwipeTop()
      {
          return false;
      }
  
      public boolean onSwipeBottom()
      {
          return false;
      }
  }
  </code></pre>
  
  <p>My expandable list view and its on group click listener set up:</p>
  
  <pre><code>expandable_list_view = (ExpandableListView) findViewById(R.id.activity_profile_expandable_listview);
  setGroupParents(); setChildData();
  ExpandableListAdapter adapter = new ExpandableListAdapter(this, parentItems, childItems);
  expandable_list_view.setAdapter(adapter);
  
  expandable_list_view.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener()
  {
      @Override
      public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id)
      {
          parent.smoothScrollToPosition(groupPosition);
  
          if (parent.isGroupExpanded(groupPosition))
          {
              parent.collapseGroup(groupPosition);
          } else {
              parent.expandGroup(groupPosition);
          }
  
          return false;
      }
  });
  </code></pre>
  
  <p>And lastly getGroupView from my custom adapter for expandable list view:</p>
  
  <pre><code>@Override
  public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent)
  {
  
  if (convertView == null)
  {
      convertView = inflater.inflate(R.layout.layout_activity_expandableitem, null);
  }
  
  final View converted_view = convertView;
  
  final LinearLayout front_view = (LinearLayout) converted_view.findViewById(R.id.layout_activity_expandableitem_front_view); front_view.setTag(Position.CENTER);
  final LinearLayout behind_view = (LinearLayout) converted_view.findViewById(R.id.layout_activity_expandableitem_behind_view);
  final View confirmation_view = inflater.inflate(R.layout.slide_profile, null); confirmation_view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
  final View cancel_view = inflater.inflate(R.layout.slide_cancel, null); cancel_view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT));
  
  
  //  Set onTouchListener
  front_view.setOnClickListener(null);
  front_view.setOnTouchListener(new OnSwipeListener()
  {
      @Override
      public boolean onSwipeRight()
      {
          Position position = (Position) front_view.getTag();
          if (position == Position.CENTER)
          {
              behind_view.removeAllViews();
              behind_view.addView(confirmation_view);
              showConfirmation(front_view);
  
              front_view.setTag(Position.RIGHT);
          }
          else if (position == Position.LEFT)
          {
              //behind_view.removeAllViews();
              showCenter(front_view, Position.RIGHT);
  
              front_view.setTag(Position.CENTER);
          }
  
          return true;
      }
  
      @Override
      public boolean onSwipeLeft()
      {
          Position position = (Position) front_view.getTag();
          if (position == Position.CENTER)
          {
              behind_view.removeAllViews();
              behind_view.addView(cancel_view);
              showInfo(front_view);
  
              front_view.setTag(Position.LEFT);
          }
          else if (position == Position.RIGHT)
          {
              //behind_view.removeAllViews();
              showCenter(front_view, Position.LEFT);
  
              front_view.setTag(Position.CENTER);
          }
  
          return true;
      }
  });
  
  //  Return the view
  return converted_view;
  </code></pre>
  
  <p>Thank you for any idea on how to solve this.</p>