mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-01-30 22:50:19 -05:00
Fix nullpointer with Intent API, fix clearing of encrypt file list, notify when adding a range of input uris
This commit is contained in:
parent
ac3efb8b58
commit
8e5d0d1682
@ -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<Uri> 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) {
|
||||
|
@ -123,9 +123,6 @@ public class EncryptTextFragment extends CryptoOperationFragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.encrypt_text_fragment, container, false);
|
||||
|
||||
if (mMessage != null) {
|
||||
mText.setText(mMessage);
|
||||
}
|
||||
mText = (TextView) view.findViewById(R.id.encrypt_text_text);
|
||||
mText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
@ -144,6 +141,11 @@ public class EncryptTextFragment extends CryptoOperationFragment {
|
||||
}
|
||||
});
|
||||
|
||||
// set initial text
|
||||
if (mMessage != null) {
|
||||
mText.setText(mMessage);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user