Skip to content

Commit 035fde0

Browse files
committed
some improvements to Copy
1 parent 61946ab commit 035fde0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
9797
updatedFiles.add(destination)
9898
}
9999

100-
context.scanFiles(updatedFiles) {}
101-
context.toast(R.string.moving_success)
102-
dismiss()
103-
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
100+
context.scanFiles(updatedFiles) {
101+
activity.runOnUiThread {
102+
context.toast(R.string.moving_success)
103+
dismiss()
104+
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
105+
}
106+
}
104107
}
105108
}
106109
})

app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ class ItemsFragment : android.support.v4.app.Fragment(), ItemsAdapter.ItemOperat
8888
setOnTouchListener { view, motionEvent -> checkDelete(); false }
8989
}
9090
} else {
91+
val state = (items_list.layoutManager as LinearLayoutManager).onSaveInstanceState()
9192
(currAdapter as ItemsAdapter).updateItems(mItems)
93+
(items_list.layoutManager as LinearLayoutManager).onRestoreInstanceState(state)
9294
}
9395

9496
getRecyclerLayoutManager().onRestoreInstanceState(arguments.getParcelable<Parcelable>(SCROLL_STATE))

0 commit comments

Comments
 (0)