diff options
author | mar-v-in <github@rvin.mooo.com> | 2014-06-22 16:31:28 +0200 |
---|---|---|
committer | mar-v-in <github@rvin.mooo.com> | 2014-06-22 16:31:28 +0200 |
commit | 79fb23b095fba273d77066204ee44d2b8d1edf8d (patch) | |
tree | 69aa452c547cb6bc6b882abf6d8e22836bfb2303 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java | |
parent | 313e571a61e22a7152e32366d747114233d25b6e (diff) | |
download | open-keychain-79fb23b095fba273d77066204ee44d2b8d1edf8d.tar.gz open-keychain-79fb23b095fba273d77066204ee44d2b8d1edf8d.tar.bz2 open-keychain-79fb23b095fba273d77066204ee44d2b8d1edf8d.zip |
Improve file more, Part 1
- Use Uris where it makes sense, Use File class to clarify it's a file (and not whatever else a string could be)
- Show sdcard in side menu in storage API #665
- Propose filename with gpg ending when storing it using the storage API #665
- Don't show output dialog on Android 4.4 #665
- Only show filename on Android < 4.4 #665
TODO:
- File deletion for Android < 4.4
- Testing (especially with Android < 4.4)
- Batch-encryption
- UI
- Temporary content provider (see #665 discussion)
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java index 39d4a09bc..e93a63cc8 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptActivity.java @@ -23,11 +23,9 @@ import android.net.Uri; import android.os.Bundle; import android.support.v4.view.PagerTabStrip; import android.support.v4.view.ViewPager; -import android.widget.Toast; import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; -import org.sufficientlysecure.keychain.helper.FileHelper; import org.sufficientlysecure.keychain.ui.adapter.PagerTabStripAdapter; import org.sufficientlysecure.keychain.util.Log; @@ -98,11 +96,7 @@ public class EncryptActivity extends DrawerActivity implements @Override public boolean isModeSymmetric() { - if (PAGER_MODE_SYMMETRIC == mViewPagerMode.getCurrentItem()) { - return true; - } else { - return false; - } + return PAGER_MODE_SYMMETRIC == mViewPagerMode.getCurrentItem(); } @Override @@ -201,7 +195,7 @@ public class EncryptActivity extends DrawerActivity implements } } else { // Files via content provider, override uri and action - uri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); + uri = intent.getParcelableExtra(Intent.EXTRA_STREAM); action = ACTION_ENCRYPT; } } @@ -232,23 +226,8 @@ public class EncryptActivity extends DrawerActivity implements mSwitchToContent = PAGER_CONTENT_MESSAGE; } else if (ACTION_ENCRYPT.equals(action) && uri != null) { // encrypt file based on Uri - - // get file path from uri - String path = FileHelper.getPath(this, uri); - - if (path != null) { - mFileFragmentBundle.putString(EncryptFileFragment.ARG_FILENAME, path); - mSwitchToContent = PAGER_CONTENT_FILE; - } else { - Log.e(Constants.TAG, - "Direct binary data without actual file in filesystem is not supported " + - "by Intents. Please use the Remote Service API!" - ); - Toast.makeText(this, R.string.error_only_files_are_supported, - Toast.LENGTH_LONG).show(); - // end activity - finish(); - } + mFileFragmentBundle.putParcelable(EncryptFileFragment.ARG_URI, uri); + mSwitchToContent = PAGER_CONTENT_FILE; } else { Log.e(Constants.TAG, "Include the extra 'text' or an Uri with setData() in your Intent!"); |