From 8e5d0d1682bf0478b2df8e44c6d184a14cbd4ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Sat, 4 Apr 2015 19:01:03 +0200 Subject: Fix nullpointer with Intent API, fix clearing of encrypt file list, notify when adding a range of input uris --- .../org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java') diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java index f85bd707b..ddced7cce 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java @@ -390,8 +390,6 @@ public class EncryptFilesFragment extends CryptoOperationFragment { }); deleteFileDialog.show(getActivity().getSupportFragmentManager(), "deleteDialog"); - - mFilesModels.clear(); } else { if (mShareAfterEncrypt) { // Share encrypted message/file @@ -724,6 +722,7 @@ public class EncryptFilesFragment extends CryptoOperationFragment { public void addAll(ArrayList inputUris) { if (inputUris != null) { + int startIndex = mDataset.size(); for (Uri inputUri : inputUris) { ViewModel newModel = new ViewModel(mActivity, inputUri); if (mDataset.contains(newModel)) { @@ -732,8 +731,8 @@ public class EncryptFilesFragment extends CryptoOperationFragment { mDataset.add(newModel); } } + notifyItemRangeInserted(startIndex, mDataset.size() - startIndex); } - // TODO: notifyItemInserted? } public void remove(ViewModel model) { -- cgit v1.2.3