Skip to content

Commit

Permalink
Merge pull request #11919 from PhilLab/move-to-next-image-after-deletion
Browse files Browse the repository at this point in the history
When deleting image in preview activity, move to the next image
  • Loading branch information
AndyScherzinger authored Sep 25, 2023
2 parents 078296f + e0519e8 commit 4fc90f3
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,15 @@ public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationRe
super.onRemoteOperationFinish(operation, result);

if (operation instanceof RemoveFileOperation) {
finish();
// initialize the pager with the new file list
initViewPager(getUser().get());
if (mViewPager.getAdapter().getCount() > 0) {
// Trigger page reselection, to update the title
onPageSelected(mViewPager.getCurrentItem());
} else {
// Last file has been deleted, so finish the activity
finish();
}
} else if (operation instanceof SynchronizeFileOperation) {
onSynchronizeFileOperationFinish(result);
}
Expand Down

0 comments on commit 4fc90f3

Please sign in to comment.