swipe effect like in samsung phone calling and message [duplicate]
Asked Answered
B

2

2

I need to implement swipe in listview like in samsung android device, in call log, when we swipe left to right call is being placed and right to left then message is being placed

enter image description here

enter image description here

enter image description here

Is this possible using swipeListView SwipeListViewDemo or give me other solution

Bluma answered 7/6, 2013 at 12:6 Comment(2)
@IceMAN: that question answers about swipe gestures not for listview and I need to do that for listview, so this question is not duplicate of that one, I request you to reopen it....Bluma
Couple (three actually) of things here. 1: The question is not closed yet. I have voted to close it though. 2: I accidentally posted the wrong link for marking as duplicate. It was another question here on SO. And 3: Is this possible using swipeListView SwipeListViewDemo or give me other solution pretty much already answers your question. Renders this question almost moot...Go
D
0

Have a look at this git repo.. This may well be what you are searching for.. 47Deg

Drucill answered 7/6, 2013 at 12:10 Comment(0)
A
-1

Yes you can do using fling gesture
Some code to help you

 SimpleOnGestureListener mySimpleGestureListener = new SimpleOnGestureListener()
{

@Override
public boolean onDoubleTap(MotionEvent e) { 
    Logout.debug("onDoubleTap");
    return super.onDoubleTap(e);
}

@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,float velocityY) 
{
    String velocity="onFling: \n" + e1.toString() + "\n" + e2.toString() +"\n"
            + "velocityX= " + String.valueOf(velocityX) + "\n"
            + "velocityY= " + String.valueOf(velocityY) + "\n";
    Logout.debug("onFling velocity="+velocity);
                return super.onFling(e1, e2, velocityX, velocityY);
}

@Override
public void onLongPress(MotionEvent e) {
    Logout.debug("onLongPress: \n" + e.toString());
    super.onLongPress(e);
}

@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
    Logout.debug("onSingleTapConfirmed: \n" + e.toString());
    return super.onSingleTapConfirmed(e);
}

private boolean permissibleYVelocity(float velocityY)
{
    if ((velocityY < -200) || (velocityY > 200))
    {
        return false;
    }
    else
    {
        return true;
    }

}
};

GestureDetector myGestureDetector = new GestureDetector(mSimpleOnGestureListener);

View.OnTouchListener mOnListTouchListener = new  OnTouchListener()
{
@Override
public boolean onTouch(View view, MotionEvent event)
{
    Logout.debug("list onTouch()");
     return myGestureDetector.onTouchEvent(event);
}
};
Adventurism answered 7/6, 2013 at 12:9 Comment(1)
Seems like the exact same answer originally posted here!Go

© 2022 - 2024 — McMap. All rights reserved.