mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 13:45:35 +03:00
Merge pull request #11919 from PhilLab/move-to-next-image-after-deletion
When deleting image in preview activity, move to the next image
This commit is contained in:
commit
4fc90f3dab
1 changed files with 9 additions and 1 deletions
|
@ -232,7 +232,15 @@ public class PreviewImageActivity extends FileActivity implements
|
|||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue