From ba1ce73dbaa3a60691b223dd7f131e3c05ddc683 Mon Sep 17 00:00:00 2001 From: Mohamed Zenadi Date: Sat, 18 Jul 2015 20:11:18 +0200 Subject: use monospaced font for passwords fix EditText being cast to textview --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/crypto') 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 9c0bc877..2d007618 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -327,17 +327,17 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne if (showPassword) { findViewById(R.id.crypto_container).setVisibility(View.VISIBLE); - Typeface type = Typeface.createFromAsset(getAssets(), "fonts/sourcecodepro.ttf"); + Typeface monoTypeface = Typeface.createFromAsset(getAssets(), "fonts/sourcecodepro.ttf"); String[] passContent = os.toString("UTF-8").split("\n"); ((TextView) findViewById(R.id.crypto_password_show)) - .setTypeface(type); + .setTypeface(monoTypeface); ((TextView) findViewById(R.id.crypto_password_show)) .setText(passContent[0]); String extraContent = os.toString("UTF-8").replaceFirst(".*\n", ""); if (extraContent.length() != 0) { ((TextView) findViewById(R.id.crypto_extra_show)) - .setTypeface(type); + .setTypeface(monoTypeface); ((TextView) findViewById(R.id.crypto_extra_show)) .setText(extraContent); } @@ -499,6 +499,9 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne decryptAndVerify(new Intent()); } else if (extra.getString("Operation").equals("ENCRYPT")) { setContentView(R.layout.encrypt_layout); + Typeface monoTypeface = Typeface.createFromAsset(getAssets(), "fonts/sourcecodepro.ttf"); + ((EditText) findViewById(R.id.crypto_password_edit)).setTypeface(monoTypeface); + ((EditText) findViewById(R.id.crypto_extra_edit)).setTypeface(monoTypeface); String cat = extra.getString("FILE_PATH"); cat = cat.replace(PasswordRepository.getWorkTree().getAbsolutePath(), ""); cat = cat + "/"; -- cgit v1.2.3