diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 6faecf86f..c207f3821 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 11c2985eb..9e44cdf27 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 index 96a442e5b..0c5c9cdf4 100644 Binary files a/app/src/main/res/drawable-hdpi/ic_launcher.png and b/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_launcher.png b/app/src/main/res/drawable-mdpi/ic_launcher.png index 359047dfa..bb7da473e 100644 Binary files a/app/src/main/res/drawable-mdpi/ic_launcher.png and b/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_launcher.png b/app/src/main/res/drawable-xhdpi/ic_launcher.png index 71c6d760f..de812f10d 100644 Binary files a/app/src/main/res/drawable-xhdpi/ic_launcher.png and b/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxhdpi/ic_launcher.png index 4df189464..84ebf04ac 100644 Binary files a/app/src/main/res/drawable-xxhdpi/ic_launcher.png and b/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/layout/decrypt_layout.xml b/app/src/main/res/layout/decrypt_layout.xml index b1f97e7df..f422c439f 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 c7e63c85c..b12c8f010 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,10 @@ - PwdStore + + Password Store + Clone a Git repo + Clone Settings Hello world!