2

左から右にスワイプするとコールが配置され、右から左にスワイプするとメッセージが配置されます。

ここに画像の説明を入力

ここに画像の説明を入力

ここに画像の説明を入力

これは swipeListView SwipeListViewDemoを使用して可能ですか、または他の解決策を教えてください

4

2 に答える 2

0

このgitリポジトリを見てください..これはあなたが探しているものかもしれません.. 47Deg

于 2013-06-07T12:10:01.173 に答える
-1

はい、フリングジェスチャを使用して実行でき
ます

 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);
}
};
于 2013-06-07T12:09:05.387 に答える