android-flip icon indicating copy to clipboard operation
android-flip copied to clipboard

Horizontal flipping occurs when flinging up/down

Open raaspazasu opened this issue 11 years ago • 3 comments

First, awesome library! I have a scrollview inside my fragments and I have it set to horizontal flipping. But I have to be very precise on scrolling through the scrollview or else it will flip to another card. Is there a setting I'm missing to get better control of this?

Thanks!

raaspazasu avatar Apr 17 '13 16:04 raaspazasu

I'm new to Android, but I ended up adding this. to FlipCards.java

case MotionEvent.ACTION_MOVE:
    float HOR_MOVE = 160f;
    float hDelta = lastPosition - event.getX();
    Log.e("hdelta",String.valueOf(hDelta));
    if(Math.abs(hDelta) < HOR_MOVE && !this.movedEnough) {
        return false;
    }
    this.movedEnough = true;

    float delta = orientationVertical ? (lastPosition - event.getY()) : (lastPosition - event.getX());

and then on ACTION_UP I reset this.movedEnough back to False. Any suggestions on how I could improve this? It seems to work okay.

raaspazasu avatar Apr 17 '13 16:04 raaspazasu

I'm sorry ,I am new to Android,too.I need to review the codes carefully,then maybe I can give some suggestions.

At 2013-04-18 00:48:46,"Ramin Mahmoodi" [email protected] wrote:

I'm new to Android, but I ended up adding this. to FlipCards.java

caseMotionEvent.ACTION_MOVE:floatHOR_MOVE=160f;floathDelta=lastPosition-event.getX();Log.e("hdelta",String.valueOf(hDelta));if(Math.abs(hDelta)<HOR_MOVE&&!this.movedEnough){returnfalse;}this.movedEnough=true;floatdelta=orientationVertical?(lastPosition-event.getY()):(lastPosition-event.getX());

and then on ACTION_UP I reset this.movedEnough back to False. Any suggestions on how I could improve this? It seems to work okay.

¡ª Reply to this email directly or view it on GitHub.

Guderian-Tag avatar Apr 18 '13 01:04 Guderian-Tag

I also found out that flipping in Flipboard could also be over sensitive.

I'll try to improve it later

openaphid avatar Apr 30 '13 15:04 openaphid