aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorEmmanuel Corrales <emmanuelcorrales22@gmail.com>2019-05-26 17:24:16 +0800
committerHarsh Shandilya <msfjarvis@gmail.com>2019-05-26 14:54:16 +0530
commitc46f50f86febc6d42b4da6c0160fc8fe3d494edf (patch)
tree2a475b202f46d8b24ce035e4922652534d23e5ed /app/src/main/java
parentb06420eb830612898ace3ddab9c73d71d9c76cb8 (diff)
Added a "SHOW EXTRA CONTENT" button under the "SHOW PASSWORD" button. (#510)
* Add 'SHOW EXTRA CONTENT' button. * Show the extra content after clicking the 'SHOW EXTRA CONTENT' button. * Change the regular button to a toggle button and add text for hiding extra contents. * Change the implementaton of showing/hiding extra contents to accomodate using a toggle button. * Add padding to the top of the button.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt20
1 files changed, 18 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
index 81a79d05..f6f0b9a8 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt
@@ -271,11 +271,27 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
}
if (entry.hasExtraContent()) {
- crypto_extra_show_layout.visibility = if (showExtraContent) View.VISIBLE else View.GONE
-
crypto_extra_show.typeface = monoTypeface
crypto_extra_show.text = entry.extraContent
+ if (showExtraContent) {
+ crypto_extra_show_layout.visibility = View.VISIBLE
+ crypto_extra_toggle_show.visibility = View.GONE
+ crypto_extra_show.transformationMethod = null
+ } else {
+ crypto_extra_show_layout.visibility = View.GONE
+ crypto_extra_toggle_show.visibility = View.VISIBLE
+ crypto_extra_toggle_show.setOnCheckedChangeListener { _, _ ->
+ crypto_extra_show.text = entry.extraContent
+ }
+
+ crypto_extra_show.transformationMethod = object : PasswordTransformationMethod() {
+ override fun getTransformation(source: CharSequence, view: View): CharSequence {
+ return if (crypto_extra_toggle_show.isChecked) source else super.getTransformation(source, view)
+ }
+ }
+ }
+
if (entry.hasUsername()) {
crypto_username_show.visibility = View.VISIBLE
crypto_username_show_label.visibility = View.VISIBLE