fix message and uri from encrypt intent
This commit is contained in:
@@ -83,8 +83,6 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
|
|||||||
// tabs
|
// tabs
|
||||||
Bundle mAsymmetricFragmentBundle = new Bundle();
|
Bundle mAsymmetricFragmentBundle = new Bundle();
|
||||||
Bundle mSymmetricFragmentBundle = new Bundle();
|
Bundle mSymmetricFragmentBundle = new Bundle();
|
||||||
Bundle mMessageFragmentBundle = new Bundle();
|
|
||||||
Bundle mFileFragmentBundle = new Bundle();
|
|
||||||
int mSwitchToMode = PAGER_MODE_ASYMMETRIC;
|
int mSwitchToMode = PAGER_MODE_ASYMMETRIC;
|
||||||
int mSwitchToContent = PAGER_CONTENT_MESSAGE;
|
int mSwitchToContent = PAGER_CONTENT_MESSAGE;
|
||||||
|
|
||||||
@@ -509,10 +507,8 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
|
|||||||
mSymmetricFragmentBundle, getString(R.string.label_symmetric));
|
mSymmetricFragmentBundle, getString(R.string.label_symmetric));
|
||||||
mViewPagerMode.setCurrentItem(mSwitchToMode);
|
mViewPagerMode.setCurrentItem(mSwitchToMode);
|
||||||
|
|
||||||
mTabsAdapterContent.addTab(EncryptMessageFragment.class,
|
mTabsAdapterContent.addTab(EncryptMessageFragment.class, null, getString(R.string.label_message));
|
||||||
mMessageFragmentBundle, getString(R.string.label_message));
|
mTabsAdapterContent.addTab(EncryptFileFragment.class, null, getString(R.string.label_files));
|
||||||
mTabsAdapterContent.addTab(EncryptFileFragment.class,
|
|
||||||
mFileFragmentBundle, getString(R.string.label_files));
|
|
||||||
mViewPagerContent.setCurrentItem(mSwitchToContent);
|
mViewPagerContent.setCurrentItem(mSwitchToContent);
|
||||||
|
|
||||||
mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
|
mUseArmor = Preferences.getPreferences(this).getDefaultAsciiArmor();
|
||||||
@@ -619,11 +615,11 @@ public class EncryptActivity extends DrawerActivity implements EncryptActivityIn
|
|||||||
*/
|
*/
|
||||||
if (ACTION_ENCRYPT.equals(action) && textData != null) {
|
if (ACTION_ENCRYPT.equals(action) && textData != null) {
|
||||||
// encrypt text based on given extra
|
// encrypt text based on given extra
|
||||||
mMessageFragmentBundle.putString(EncryptMessageFragment.ARG_TEXT, textData);
|
mMessage = textData;
|
||||||
mSwitchToContent = PAGER_CONTENT_MESSAGE;
|
mSwitchToContent = PAGER_CONTENT_MESSAGE;
|
||||||
} else if (ACTION_ENCRYPT.equals(action) && uris != null && !uris.isEmpty()) {
|
} else if (ACTION_ENCRYPT.equals(action) && uris != null && !uris.isEmpty()) {
|
||||||
// encrypt file based on Uri
|
// encrypt file based on Uri
|
||||||
mFileFragmentBundle.putParcelableArrayList(EncryptFileFragment.ARG_URIS, uris);
|
mInputUris = uris;
|
||||||
mSwitchToContent = PAGER_CONTENT_FILE;
|
mSwitchToContent = PAGER_CONTENT_FILE;
|
||||||
} else if (ACTION_ENCRYPT.equals(action)) {
|
} else if (ACTION_ENCRYPT.equals(action)) {
|
||||||
Log.e(Constants.TAG,
|
Log.e(Constants.TAG,
|
||||||
|
|||||||
@@ -111,8 +111,6 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
|
|||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
|
|
||||||
addInputUris(getArguments().<Uri>getParcelableArrayList(ARG_URIS));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addInputUri() {
|
private void addInputUri() {
|
||||||
@@ -125,14 +123,6 @@ public class EncryptFileFragment extends Fragment implements EncryptActivityInte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addInputUris(List<Uri> uris) {
|
|
||||||
if (uris != null) {
|
|
||||||
for (Uri uri : uris) {
|
|
||||||
addInputUri(uri);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addInputUri(Uri inputUri) {
|
private void addInputUri(Uri inputUri) {
|
||||||
if (inputUri == null) {
|
if (inputUri == null) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user