Move encrypt decrypt operations in own starter activity

This commit is contained in:
Dominik Schürmann 2015-02-03 18:39:07 +01:00
parent 9e011860c4
commit d6d679997b
20 changed files with 75 additions and 28 deletions

View file

@ -10,8 +10,7 @@ python copy OpenKeychain navigation white refresh 24
# navigation drawer sections
python copy OpenKeychain communication black vpn_key 24
python copy OpenKeychain action black lock_open 24
python copy OpenKeychain action black lock_outline 24
python copy OpenKeychain action black lock 24
python copy OpenKeychain navigation black apps 24
python copy OpenKeychain action black help 24
python copy OpenKeychain action black settings 24

View file

@ -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);

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 883 B

View file

@ -12,7 +12,44 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/section_decrypt_files" />
android:text="@string/section_encrypt" />
<TextView
android:id="@+id/encrypt_files"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:clickable="true"
style="@style/SelectableItem"
android:text="@string/btn_encrypt_files"
android:drawableRight="@drawable/ic_action_collection"
android:drawablePadding="8dp"
android:gravity="center_vertical" />
<TextView
android:id="@+id/encrypt_text"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:clickable="true"
style="@style/SelectableItem"
android:text="@string/btn_encrypt_text"
android:drawableRight="@drawable/ic_action_copy"
android:drawablePadding="8dp"
android:gravity="center_vertical" />
<TextView
style="@style/SectionHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/section_decrypt" />
<TextView
android:id="@+id/decrypt_files"
@ -32,15 +69,7 @@
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"
android:layout_marginBottom="8dp" />
<TextView
style="@style/SectionHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="@string/section_decrypt_text" />
android:background="?android:attr/listDivider" />
<LinearLayout
android:id="@+id/decrypt_from_clipboard"

View file

@ -62,6 +62,8 @@
<string name="section_decrypt_files">"Files"</string>
<string name="section_decrypt_text">"Text"</string>
<string name="section_certs">"Certificates"</string>
<string name="section_encrypt">"Encrypt"</string>
<string name="section_decrypt">"Decrypt"</string>
<!-- button -->
<string name="btn_decrypt_verify_file">"Decrypt, verify, and save file"</string>
@ -82,9 +84,11 @@
<string name="btn_create_key">"Create key"</string>
<string name="btn_add_files">"Add file(s)"</string>
<string name="btn_add_share_decrypted_text">"Share decrypted text"</string>
<string name="btn_decrypt_clipboard">"Decrypt from clipboard"</string>
<string name="btn_decrypt_clipboard">"Decrypt text from clipboard"</string>
<string name="btn_decrypt_and_verify">"and verify signatures"</string>
<string name="btn_decrypt_files">"Decrypt files"</string>
<string name="btn_encrypt_files">"Encrypt files"</string>
<string name="btn_encrypt_text">"Encrypt text"</string>
<!-- menu -->
<string name="menu_preferences">"Settings"</string>
@ -584,9 +588,7 @@
<!-- Navigation Drawer -->
<string name="nav_keys">"Keys"</string>
<string name="nav_encrypt_text">"Encrypt text"</string>
<string name="nav_encrypt_files">"Encrypt files"</string>
<string name="nav_decrypt">"Decrypt"</string>
<string name="nav_encrypt_decrypt">"Encrypt/Decrypt"</string>
<string name="nav_apps">"Apps"</string>
<string name="drawer_open">"Open navigation drawer"</string>
<string name="drawer_close">"Close navigation drawer"</string>