diff options
author | Zeapo <mohamed@zenadi.com> | 2014-08-06 17:25:47 +0100 |
---|---|---|
committer | Zeapo <mohamed@zenadi.com> | 2014-08-06 17:25:47 +0100 |
commit | b1896c42216b703aee71b83be5e2718fd1f93ec4 (patch) | |
tree | 7cfd01e63bcd5862d1eee3bd05b031109cbe3a2c /app/src | |
parent | 42d22abfbc999699ce8441fc4ffa1af4a6c35ddd (diff) |
some ui improvements (icons and return from pgphandler to top)
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 9 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 16 | ||||
-rw-r--r-- | app/src/main/res/drawable-hdpi/ic_launcher.png | bin | 9397 -> 1021 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-mdpi/ic_launcher.png | bin | 5237 -> 723 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xhdpi/ic_launcher.png | bin | 14383 -> 1389 bytes | |||
-rw-r--r-- | app/src/main/res/drawable-xxhdpi/ic_launcher.png | bin | 19388 -> 2246 bytes | |||
-rw-r--r-- | app/src/main/res/layout/decrypt_layout.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 5 |
8 files changed, 26 insertions, 6 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 6faecf86..c207f382 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -177,7 +177,7 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI intent.putExtra("NAME", item.getName()); intent.putExtra("FILE_PATH", item.getFile().getAbsolutePath()); intent.putExtra("Operation", "DECRYPT"); - startActivity(intent); + startActivityForResult(intent, 0); } catch (IOException e) { e.printStackTrace(); @@ -201,9 +201,16 @@ public class PasswordStore extends Activity implements ToCloneOrNot.OnFragmentI intent.putExtra("NAME", "test.gpg"); intent.putExtra("FILE_PATH", this.currentDir.getAbsolutePath()); intent.putExtra("Operation", "ENCRYPT"); + // TODO Define different operations here startActivityForResult(intent, 0); } catch (Exception e) { e.printStackTrace(); } } + + protected void onActivityResult(int requestCode, int resultCode, + Intent data) { + System.out.println(resultCode); + checkLocalRepository(this.currentDir); + } } diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index 11c2985e..9e44cdf2 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -92,6 +92,11 @@ public class PgpHandler extends Activity { mServiceConnection = new OpenPgpServiceConnection( PgpHandler.this, providerPackageName); mServiceConnection.bindToService(); + + ActionBar actionBar = getActionBar(); +// actionBar.setHomeButtonEnabled(true); +// actionBar.setDisplayShowHomeEnabled(true); + actionBar.setDisplayHomeAsUpEnabled(true); } @@ -108,8 +113,10 @@ public class PgpHandler extends Activity { // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); - if (id == R.id.action_settings) { - return true; + switch (id) { + case android.R.id.home: + finish(); + return true; } return super.onOptionsItemSelected(item); } @@ -123,6 +130,7 @@ public class PgpHandler extends Activity { encrypt(new Intent()); break; case R.id.crypto_cancel_add: + finish(); break; default: // should not happen @@ -257,11 +265,12 @@ public class PgpHandler extends Activity { + ".gpg"; OutputStream outputStream = FileUtils.openOutputStream(new File(path)); outputStream.write(os.toByteArray()); - finishActivity(0); } else { showToast(os.toString()); } + setResult(998); + finish(); } catch (Exception e) { Log.e(Constants.TAG, "UnsupportedEncodingException", e); } @@ -330,6 +339,7 @@ public class PgpHandler extends Activity { public void encrypt(Intent data) { data.setAction(OpenPgpApi.ACTION_ENCRYPT); + // TODO add preference so that the user sets his account name data.putExtra(OpenPgpApi.EXTRA_USER_IDS, new String[] {"default"}); data.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true); diff --git a/app/src/main/res/drawable-hdpi/ic_launcher.png b/app/src/main/res/drawable-hdpi/ic_launcher.png Binary files differindex 96a442e5..0c5c9cdf 100644 --- a/app/src/main/res/drawable-hdpi/ic_launcher.png +++ b/app/src/main/res/drawable-hdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-mdpi/ic_launcher.png b/app/src/main/res/drawable-mdpi/ic_launcher.png Binary files differindex 359047df..bb7da473 100644 --- a/app/src/main/res/drawable-mdpi/ic_launcher.png +++ b/app/src/main/res/drawable-mdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher.png b/app/src/main/res/drawable-xhdpi/ic_launcher.png Binary files differindex 71c6d760..de812f10 100644 --- a/app/src/main/res/drawable-xhdpi/ic_launcher.png +++ b/app/src/main/res/drawable-xhdpi/ic_launcher.png diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxhdpi/ic_launcher.png Binary files differindex 4df18946..84ebf04a 100644 --- a/app/src/main/res/drawable-xxhdpi/ic_launcher.png +++ b/app/src/main/res/drawable-xxhdpi/ic_launcher.png diff --git a/app/src/main/res/layout/decrypt_layout.xml b/app/src/main/res/layout/decrypt_layout.xml index b1f97e7d..f422c439 100644 --- a/app/src/main/res/layout/decrypt_layout.xml +++ b/app/src/main/res/layout/decrypt_layout.xml @@ -32,7 +32,7 @@ android:id="@+id/crypto_show_button" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@android:drawable/ic_input_get" + android:src="@drawable/ic_key" android:background="@android:drawable/screen_background_light_transparent" android:layout_gravity="center_vertical" android:visibility="invisible" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c7e63c85..b12c8f01 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <string name="app_name">PwdStore</string> + <!-- Activity names --> + <string name="app_name">Password Store</string> + <string name="activity_clone_name">Clone a Git repo</string> + <string name="clone_settings">Clone</string> <string name="action_settings">Settings</string> <string name="hello_world">Hello world!</string> |