diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-02-03 18:39:07 +0100 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-02-03 18:39:07 +0100 |
commit | d6d679997b7bb7d6b10b58c8b1ce0a416ccf9b05 (patch) | |
tree | cdcc198fce59d58e64337d28bbeb5b5150572191 /OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui | |
parent | 9e011860c480d274d9a99bf32947eaea9229dcd8 (diff) | |
download | open-keychain-d6d679997b7bb7d6b10b58c8b1ce0a416ccf9b05.tar.gz open-keychain-d6d679997b7bb7d6b10b58c8b1ce0a416ccf9b05.tar.bz2 open-keychain-d6d679997b7bb7d6b10b58c8b1ce0a416ccf9b05.zip |
Move encrypt decrypt operations in own starter activity
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java (renamed from OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptOverviewFragment.java) | 36 | ||||
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NavDrawerActivity.java | 5 |
2 files changed, 29 insertions, 12 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptOverviewFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java index 8407a8ca7..a498d0763 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptOverviewFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptDecryptOverviewFragment.java @@ -35,10 +35,12 @@ import org.sufficientlysecure.keychain.ui.util.SubtleAttentionSeeker; import java.util.regex.Matcher; -public class DecryptOverviewFragment extends Fragment { +public class EncryptDecryptOverviewFragment extends Fragment { - View mActionFile; - View mActionFromClipboard; + View mEncryptFile; + View mEncryptText; + View mDecryptFile; + View mDecryptFromClipboard; View mClipboardIcon; @Override @@ -49,13 +51,31 @@ public class DecryptOverviewFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { - View view = inflater.inflate(R.layout.decrypt_overview_fragment, container, false); + View view = inflater.inflate(R.layout.encrypt_decrypt_overview_fragment, container, false); - mActionFile = view.findViewById(R.id.decrypt_files); - mActionFromClipboard = view.findViewById(R.id.decrypt_from_clipboard); + mEncryptFile = view.findViewById(R.id.encrypt_files); + mEncryptText = view.findViewById(R.id.encrypt_text); + mDecryptFile = view.findViewById(R.id.decrypt_files); + mDecryptFromClipboard = view.findViewById(R.id.decrypt_from_clipboard); mClipboardIcon = view.findViewById(R.id.clipboard_icon); - mActionFile.setOnClickListener(new View.OnClickListener() { + mEncryptFile.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent encrypt = new Intent(getActivity(), EncryptFilesActivity.class); + startActivity(encrypt); + } + }); + + mEncryptText.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent encrypt = new Intent(getActivity(), EncryptTextActivity.class); + startActivity(encrypt); + } + }); + + mDecryptFile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent filesDecrypt = new Intent(getActivity(), DecryptFilesActivity.class); @@ -64,7 +84,7 @@ public class DecryptOverviewFragment extends Fragment { } }); - mActionFromClipboard.setOnClickListener(new View.OnClickListener() { + mDecryptFromClipboard.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent clipboardDecrypt = new Intent(getActivity(), DecryptTextActivity.class); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NavDrawerActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NavDrawerActivity.java index 035bed412..d82e1c246 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NavDrawerActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/NavDrawerActivity.java @@ -40,10 +40,7 @@ public abstract class NavDrawerActivity extends MaterialNavigationDrawer { // create sections addSection(newSection(getString(R.string.title_keys), R.drawable.ic_vpn_key_black_24dp, new KeyListFragment())); - - addSection(newSection(getString(R.string.title_encrypt_text), R.drawable.ic_lock_outline_black_24dp, new Intent(this, EncryptTextActivity.class))); - addSection(newSection(getString(R.string.title_encrypt_files), R.drawable.ic_lock_outline_black_24dp, new Intent(this, EncryptFilesActivity.class))); - addSection(newSection(getString(R.string.title_decrypt), R.drawable.ic_lock_open_black_24dp, new DecryptOverviewFragment())); + addSection(newSection(getString(R.string.nav_encrypt_decrypt), R.drawable.ic_lock_black_24dp, new EncryptDecryptOverviewFragment())); addSection(newSection(getString(R.string.title_api_registered_apps), R.drawable.ic_apps_black_24dp, new AppsListFragment())); // create bottom section |