Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41b3cff6 authored by Bobby Georgescu's avatar Bobby Georgescu Committed by Android (Google) Code Review
Browse files

Fix delete and undo behavior on filmstrip

Bug: 7353749
Change-Id: Ib0abd3f71783c01b1df418dd76e674bf05e65ce7
parent 3926a685
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1070,7 +1070,11 @@ public class PhotoDataAdapter implements PhotoPage.Model {
                // case the index needs to be limited to [0, mSize).
                if (index == MediaSet.INDEX_NOT_FOUND) {
                    index = info.indexHint;
                    if (mFocusHintDirection == FOCUS_HINT_PREVIOUS
                    int focusHintDirection = mFocusHintDirection;
                    if (index == (mCameraIndex + 1)) {
                        focusHintDirection = FOCUS_HINT_NEXT;
                    }
                    if (focusHintDirection == FOCUS_HINT_PREVIOUS
                            && index > 0) {
                        index--;
                    }
+1 −1
Original line number Diff line number Diff line
@@ -345,7 +345,7 @@ public class PhotoPage extends ActivityState implements
                                mMediaSet.getMediaItemCount() > 1) {
                            mPhotoView.switchToImage(1);
                        } else {
                            mPhotoView.setFilmMode(mPhotoView.canUndo());
                            mPhotoView.setFilmMode(false);
                            stayedOnCamera = true;
                        }

+3 −2
Original line number Diff line number Diff line
@@ -1304,7 +1304,8 @@ public class PhotoView extends GLView {
        mFilmMode = enabled;
        mPositionController.setFilmMode(mFilmMode);
        mModel.setNeedFullImage(!enabled);
        mModel.setFocusHintDirection(Model.FOCUS_HINT_NEXT);
        mModel.setFocusHintDirection(
                mFilmMode ? Model.FOCUS_HINT_PREVIOUS : Model.FOCUS_HINT_NEXT);
        updateActionBar();
        mListener.onFilmModeChanged(enabled);
    }
@@ -1381,7 +1382,7 @@ public class PhotoView extends GLView {
        boolean touched = (mUndoBarState & UNDO_BAR_TOUCHED) != 0;
        boolean fullCamera = (mUndoBarState & UNDO_BAR_FULL_CAMERA) != 0;
        boolean deleteLast = (mUndoBarState & UNDO_BAR_DELETE_LAST) != 0;
        if ((timeout && (touched || deleteLast)) || fullCamera) {
        if ((timeout && deleteLast) || fullCamera || touched) {
            hideUndoBar();
        }
    }