Add buttons to switch between showing link and code

This commit is contained in:
Torsten Grote
2018-09-26 12:33:23 -03:00
parent c6eb285431
commit 34d3267f26
7 changed files with 91 additions and 32 deletions

View File

@@ -59,4 +59,31 @@
app:layout_constraintStart_toEndOf="@id/copyButton"
app:layout_constraintTop_toTopOf="@id/copyButton"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:text="or"
android:textSize="18sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/copyButton"/>
<Button
android:id="@+id/showCodeButton"
style="@style/BriarButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="16dp"
android:drawableLeft="@drawable/ic_qr_code"
android:drawablePadding="8dp"
android:text="Show QR Code"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2"/>
</android.support.constraint.ConstraintLayout>

View File

@@ -9,30 +9,67 @@
<TextView
android:id="@+id/linkIntro"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_large"
android:text="@string/send_code_instructions"
android:textIsSelectable="true"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@id/qrCodeView"
app:layout_constraintBottom_toTopOf="@+id/qrCodeView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:layout_constraintVertical_chainStyle="packed"
app:layout_constraintVertical_weight="1"
tools:visibility="visible"/>
<org.briarproject.briar.android.view.QrCodeView
android:id="@+id/qrCodeView"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:textIsSelectable="true"
android:textSize="18sp"
android:typeface="monospace"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@+id/textView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/linkIntro"
app:layout_constraintTop_toBottomOf="@+id/linkIntro"
app:layout_constraintVertical_weight="1"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="or"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/showLinkButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/qrCodeView"/>
<Button
android:id="@+id/showLinkButton"
style="@style/BriarButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:drawableLeft="@drawable/ic_link"
android:drawablePadding="8dp"
android:text="Show Link"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView2"
app:layout_constraintVertical_bias="1.0"/>
</android.support.constraint.ConstraintLayout>

View File

@@ -152,9 +152,9 @@
<string name="add_contact_nearby_title">Add Contact Nearby</string>
<string name="open_link_title">Open Link</string>
<string name="open_code_title">Open QR Code</string>
<string name="open_code_title">Open Invite</string>
<string name="send_link_title">Send My Link</string>
<string name="send_code_title">Send My QR Code</string>
<string name="send_code_title">Send My Invite</string>
<string name="show_link">Show Link</string>
<string name="show_code">Show QR code</string>
<string name="contact_name_hint">Contact name</string>
@@ -164,7 +164,7 @@
<string name="share_button">Share</string>
<string name="copy_button">Copy</string>
<string name="send_link_instructions">Send this link to your contact:</string>
<string name="send_code_instructions">Let your contact scan this QR code with Briar:</string>
<string name="send_code_instructions">Let your contact scan this QR code:</string>
<string name="link_clip_label">Briar link</string>
<string name="link_copied_toast">Link copied</string>
<string name="pending_contact_requests_snackbar">"There are pending contact requests"</string>