0

I wrote a solution for it, it's working perfect but i think that is not the best solution...

private volatile boolean sweepEvent;

@Override
public boolean onTouchEvent(MotionEvent event) {


    if (MotionEvent.ACTION_UP == event.getAction() && !sweepEvent) {
        sweepEvent = false;
        ((View) this.getParent()).performClick();
        return false;
    } else if (MotionEvent.ACTION_MOVE == event.getAction()) {
        sweepEvent = true;
    } else {
        sweepEvent = false;
    }

    return super.onTouchEvent(event);
}

As you can see i also need call parent view (LinearLayout) when user tapping on seekbar but not moving progress. line : ((View) this.getParent()).performClick(); but its not working at all ...

I am thinking to add a new listener for a callback but iti s not a good solution ...

mmBs
  • 8,421
  • 6
  • 38
  • 46
luckybastard
  • 157
  • 1
  • 3
  • 12
  • and what is your intention? what do you actually want to do? – pskink May 21 '14 at 09:14
  • first it is good solution ? second how send click event (ACTION UP) to the parent ?,(children is a list item) – luckybastard May 21 '14 at 09:27
  • its not clear what you want to do... – pskink May 21 '14 at 10:02
  • I have got list and one of it element is seekbar. When i click on seek bar but not change progress i must send that event and call onListItemCLick. So my seek bar can not change progress when user simpcy click on it, but only when user sweep progressbar. – luckybastard May 21 '14 at 10:08
  • use setOnSeekBarChangeListener and add logging (Log.d) in every method of the listener, it should be clear what to do next – pskink May 21 '14 at 10:41

0 Answers0