Commit 6d300649 authored by Chris Wren's avatar Chris Wren
Browse files

flip less often if loading is slow.

Flipping back to a photo we just saw looks like thrashing.
However we don't want to get stuck forever on a single photo.

Change-Id: I1b8f317fbcbe05a3923343c6d3d2c0f6cabefcda
parent 2ccf92a7
......@@ -80,7 +80,8 @@ public class PhotoCarousel extends FrameLayout {
scheduleNext((int) mDropPeriod - elapsed);
} else {
scheduleNext(mDropPeriod);
if (changePhoto() || canFlip()) {
if (changePhoto() ||
(elapsed > (5 * mDropPeriod) && canFlip())) {
flip(1f);
mLastFlipTime = now;
}
......@@ -107,6 +108,7 @@ public class PhotoCarousel extends FrameLayout {
mPanel = new View[2];
mFlipper = new Flipper();
// this is dead code if the dream calls setInteractive(false)
mGestureDetector = new GestureDetector(context,
new GestureDetector.SimpleOnGestureListener() {
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment