mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
allow progress message to be set later
This commit is contained in:
parent
90848a2af7
commit
be53c3e564
@ -63,6 +63,11 @@ public abstract class CryptoOperationFragment<T extends Parcelable, S extends Op
|
||||
mOperationHelper = new CryptoOperationHelper<>(this, callback);
|
||||
}
|
||||
|
||||
public void setProgressMessageResource(int id) {
|
||||
mOperationHelper.setProgressMessageResource(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
mOperationHelper.handleActivityResult(requestCode, resultCode, data);
|
||||
|
@ -67,7 +67,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
||||
// otherwise all CryptoOperationHandlers may respond to the same onActivityResult
|
||||
private int mRequestedCode = -1;
|
||||
|
||||
private int mProgressMessageString;
|
||||
private int mProgressMessageResource;
|
||||
|
||||
private FragmentActivity mActivity;
|
||||
private Fragment mFragment;
|
||||
@ -84,7 +84,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
||||
mActivity = activity;
|
||||
mUseFragment = false;
|
||||
mCallback = callback;
|
||||
mProgressMessageString = progressMessageString;
|
||||
mProgressMessageResource = progressMessageString;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,7 +95,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
||||
public CryptoOperationHelper(Fragment fragment, Callback<T, S> callback, int progressMessageString) {
|
||||
mFragment = fragment;
|
||||
mUseFragment = true;
|
||||
mProgressMessageString = progressMessageString;
|
||||
mProgressMessageResource = progressMessageString;
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
@ -107,10 +107,14 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
||||
public CryptoOperationHelper(Fragment fragment, Callback<T, S> callback) {
|
||||
mFragment = fragment;
|
||||
mUseFragment = true;
|
||||
mProgressMessageString = R.string.progress_building_key;
|
||||
mProgressMessageResource = R.string.progress_building_key;
|
||||
mCallback = callback;
|
||||
}
|
||||
|
||||
public void setProgressMessageResource(int id) {
|
||||
mProgressMessageResource = id;
|
||||
}
|
||||
|
||||
private void initiateInputActivity(RequiredInputParcel requiredInput) {
|
||||
|
||||
Activity activity = mUseFragment ? mFragment.getActivity() : mActivity;
|
||||
@ -254,7 +258,7 @@ public class CryptoOperationHelper<T extends Parcelable, S extends OperationResu
|
||||
};
|
||||
|
||||
saveHandler.showProgressDialog(
|
||||
activity.getString(mProgressMessageString),
|
||||
activity.getString(mProgressMessageResource),
|
||||
ProgressDialog.STYLE_HORIZONTAL, false);
|
||||
|
||||
// Create a new Messenger for the communication back
|
||||
|
Loading…
Reference in New Issue
Block a user