protected void onBackPressed() {
if (mShowDetails) {
hideDetails();
- } else if (!switchWithCaptureAnimation(-1)) {
+ } else if (mScreenNail == null
+ || !switchWithCaptureAnimation(-1)) {
super.onBackPressed();
}
}
}
@Override
+ public void moveToFirst() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
public void getImageSize(int offset, PhotoView.Size size) {
if (offset == 0) {
size.width = mItem.getWidth();
public interface Model extends TileImageView.Model {
public void next();
public void previous();
+ public void moveToFirst();
// Returns the size for the specified picture. If the size information is
// not avaiable, width = height = 0.
mModel.previous();
}
+ private void switchToFirstImage() {
+ mModel.moveToFirst();
+ }
+
////////////////////////////////////////////////////////////////////////////
// Opening Animation
////////////////////////////////////////////////////////////////////////////
}
private boolean switchWithCaptureAnimationLocked(int offset) {
- if (mFilmMode) return false;
if (mHolding != 0) return true;
if (offset == 1) {
if (mNextBound <= 0) return false;
mPositionController.startCaptureAnimationSlide(-1);
} else if (offset == -1) {
if (mPrevBound >= 0) return false;
- switchToPrevImage();
+ switchToFirstImage();
mPositionController.startCaptureAnimationSlide(1);
} else {
return false;