some improvements to Copy

This commit is contained in:
tibbi 2016-12-06 10:03:43 +01:00
parent 61946abbde
commit 035fde0a8f
2 changed files with 9 additions and 4 deletions

View file

@ -97,10 +97,13 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, val c
updatedFiles.add(destination)
}
context.scanFiles(updatedFiles) {}
context.toast(R.string.moving_success)
dismiss()
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
context.scanFiles(updatedFiles) {
activity.runOnUiThread {
context.toast(R.string.moving_success)
dismiss()
copyMoveListener.copySucceeded(true, files.size * 2 == updatedFiles.size)
}
}
}
}
})

View file

@ -88,7 +88,9 @@ class ItemsFragment : android.support.v4.app.Fragment(), ItemsAdapter.ItemOperat
setOnTouchListener { view, motionEvent -> checkDelete(); false }
}
} else {
val state = (items_list.layoutManager as LinearLayoutManager).onSaveInstanceState()
(currAdapter as ItemsAdapter).updateItems(mItems)
(items_list.layoutManager as LinearLayoutManager).onRestoreInstanceState(state)
}
getRecyclerLayoutManager().onRestoreInstanceState(arguments.getParcelable<Parcelable>(SCROLL_STATE))