Fix totp elements layout (#367)

* Fix totp elements layout

* Add missing rule

* Make username copy button invisible by default

* Fix totp copy button string

* Don't show username fields if not set
This commit is contained in:
Balasankar C 2018-01-16 20:31:39 +00:00 committed by Mohamed Zenadi
parent 0480e7cb02
commit 7eb866b943
3 changed files with 10 additions and 3 deletions

View file

@ -246,6 +246,11 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound {
crypto_username_show.typeface = monoTypeface crypto_username_show.typeface = monoTypeface
crypto_username_show.text = entry.username crypto_username_show.text = entry.username
} }
else {
crypto_username_show.visibility = View.GONE
crypto_username_show_label.visibility = View.GONE
crypto_copy_username.visibility = View.GONE
}
} }
if (entry.hasTotp()) { if (entry.hasTotp()) {

View file

@ -133,6 +133,7 @@
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:contentDescription="@string/copy_username" android:contentDescription="@string/copy_username"
android:visibility="invisible"
android:background="@color/background" android:background="@color/background"
android:src="@drawable/ic_content_copy"/> android:src="@drawable/ic_content_copy"/>
@ -170,9 +171,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentTop="true" android:layout_below="@id/crypto_username_show"
android:visibility="invisible" android:visibility="invisible"
android:contentDescription="@string/copy_username" android:contentDescription="@string/copy_totp"
android:background="@color/background" android:background="@color/background"
android:src="@drawable/ic_content_copy"/> android:src="@drawable/ic_content_copy"/>
@ -182,9 +183,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@id/crypto_copy_totp" android:layout_toLeftOf="@id/crypto_copy_totp"
android:layout_toStartOf="@id/crypto_copy_totp" android:layout_toStartOf="@id/crypto_copy_totp"
android:layout_below="@id/crypto_username_show"
android:text="@string/totp" android:text="@string/totp"
android:textColor="@android:color/black" android:textColor="@android:color/black"
android:textStyle="bold" /> android:textStyle="bold" />

View file

@ -97,6 +97,7 @@
<string name="edit_password">Edit password</string> <string name="edit_password">Edit password</string>
<string name="copy_password">Copy password</string> <string name="copy_password">Copy password</string>
<string name="copy_username">Copy username</string> <string name="copy_username">Copy username</string>
<string name="copy_totp">Copy OTP code</string>
<string name="share_as_plaintext">Share as plaintext</string> <string name="share_as_plaintext">Share as plaintext</string>
<string name="last_changed">Last changed %s</string> <string name="last_changed">Last changed %s</string>