mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-07 02:20:10 -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");
|
deleteFileDialog.show(getActivity().getSupportFragmentManager(), "deleteDialog");
|
||||||
|
|
||||||
mFilesModels.clear();
|
|
||||||
} else {
|
} else {
|
||||||
if (mShareAfterEncrypt) {
|
if (mShareAfterEncrypt) {
|
||||||
// Share encrypted message/file
|
// Share encrypted message/file
|
||||||
@ -724,6 +722,7 @@ public class EncryptFilesFragment extends CryptoOperationFragment {
|
|||||||
|
|
||||||
public void addAll(ArrayList<Uri> inputUris) {
|
public void addAll(ArrayList<Uri> inputUris) {
|
||||||
if (inputUris != null) {
|
if (inputUris != null) {
|
||||||
|
int startIndex = mDataset.size();
|
||||||
for (Uri inputUri : inputUris) {
|
for (Uri inputUri : inputUris) {
|
||||||
ViewModel newModel = new ViewModel(mActivity, inputUri);
|
ViewModel newModel = new ViewModel(mActivity, inputUri);
|
||||||
if (mDataset.contains(newModel)) {
|
if (mDataset.contains(newModel)) {
|
||||||
@ -732,8 +731,8 @@ public class EncryptFilesFragment extends CryptoOperationFragment {
|
|||||||
mDataset.add(newModel);
|
mDataset.add(newModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
notifyItemRangeInserted(startIndex, mDataset.size() - startIndex);
|
||||||
}
|
}
|
||||||
// TODO: notifyItemInserted?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove(ViewModel model) {
|
public void remove(ViewModel model) {
|
||||||
|
@ -123,9 +123,6 @@ public class EncryptTextFragment extends CryptoOperationFragment {
|
|||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.encrypt_text_fragment, container, false);
|
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 = (TextView) view.findViewById(R.id.encrypt_text_text);
|
||||||
mText.addTextChangedListener(new TextWatcher() {
|
mText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
@ -144,6 +141,11 @@ public class EncryptTextFragment extends CryptoOperationFragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// set initial text
|
||||||
|
if (mMessage != null) {
|
||||||
|
mText.setText(mMessage);
|
||||||
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user