From ba83290fcd3714adc7628fe9d79cab4643cd4a76 Mon Sep 17 00:00:00 2001
From: akwizgran <michael@briarproject.org>
Date: Mon, 24 Oct 2022 13:29:59 +0100
Subject: [PATCH] Add a hint that both parties need to add each other's links.

---
 .../contact/add/remote/LinkExchangeFragment.java  |  3 +++
 .../main/res/layout/fragment_link_exchange.xml    | 15 +++++++++++----
 briar-android/src/main/res/values/strings.xml     |  1 +
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/briar-android/src/main/java/org/briarproject/briar/android/contact/add/remote/LinkExchangeFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/contact/add/remote/LinkExchangeFragment.java
index 42097e32ad..9acde98b62 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/contact/add/remote/LinkExchangeFragment.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/contact/add/remote/LinkExchangeFragment.java
@@ -122,6 +122,9 @@ public class LinkExchangeFragment extends BaseFragment {
 						.startChooser());
 		shareButton.setEnabled(true);
 
+		TextView infoText = v.findViewById(R.id.info_text);
+		infoText.setText(R.string.info_both_must_enter_links);
+
 		Button continueButton = v.findViewById(R.id.addButton);
 		continueButton.setOnClickListener(view -> onContinueButtonClicked());
 		continueButton.setEnabled(true);
diff --git a/briar-android/src/main/res/layout/fragment_link_exchange.xml b/briar-android/src/main/res/layout/fragment_link_exchange.xml
index 4ebd1a64c6..9b8bab8e6c 100644
--- a/briar-android/src/main/res/layout/fragment_link_exchange.xml
+++ b/briar-android/src/main/res/layout/fragment_link_exchange.xml
@@ -30,8 +30,7 @@
 				app:layout_constraintBottom_toTopOf="@+id/stepOneText"
 				app:layout_constraintEnd_toStartOf="@+id/guideline"
 				app:layout_constraintStart_toStartOf="parent"
-				app:layout_constraintTop_toTopOf="parent"
-				app:layout_constraintVertical_bias="0.0" />
+				app:layout_constraintTop_toTopOf="parent" />
 
 			<TextView
 				android:id="@+id/stepOneText"
@@ -64,7 +63,6 @@
 				app:layout_constraintEnd_toEndOf="parent"
 				app:layout_constraintStart_toStartOf="@+id/guideline"
 				app:layout_constraintTop_toTopOf="@+id/stepOne"
-				app:layout_constraintVertical_bias="0.0"
 				app:layout_constraintVertical_chainStyle="packed" />
 
 			<TextView
@@ -162,7 +160,6 @@
 				app:drawableStartCompat="@drawable/social_share_blue"
 				app:layout_constraintBottom_toBottomOf="@id/copyButton"
 				app:layout_constraintEnd_toEndOf="parent"
-				app:layout_constraintHorizontal_bias="1.0"
 				app:layout_constraintStart_toEndOf="@id/copyButton"
 				app:layout_constraintTop_toTopOf="@id/copyButton" />
 
@@ -226,8 +223,18 @@
 				app:layout_constraintHorizontal_bias="1.0"
 				app:layout_constraintStart_toStartOf="parent"
 				app:layout_constraintTop_toBottomOf="@+id/linkInputLayout"
+				app:layout_constraintBottom_toTopOf="@+id/infoView"
 				app:layout_constraintVertical_bias="0.0" />
 
+			<org.briarproject.briar.android.view.InfoView
+				android:id="@+id/infoView"
+				android:layout_width="match_parent"
+				android:layout_height="wrap_content"
+				android:layout_marginTop="16dp"
+				app:layout_constraintEnd_toEndOf="parent"
+				app:layout_constraintStart_toStartOf="parent"
+				app:layout_constraintTop_toBottomOf="@+id/pasteButton" />
+
 		</androidx.constraintlayout.widget.ConstraintLayout>
 	</ScrollView>
 
diff --git a/briar-android/src/main/res/values/strings.xml b/briar-android/src/main/res/values/strings.xml
index 83a90004c0..dcb578ad2c 100644
--- a/briar-android/src/main/res/values/strings.xml
+++ b/briar-android/src/main/res/values/strings.xml
@@ -318,6 +318,7 @@
 	<string name="different_person_button">Different Person</string>
 	<string name="duplicate_link_dialog_text_3">%1$s and %2$s sent you the same link.\n\nOne of them may be trying to discover who your contacts are.\n\nDon\'t tell them you received the same link from someone else.</string>
 	<string name="pending_contact_updated_toast">Pending contact updated</string>
+	<string name="info_both_must_enter_links">You must both add each other\'s links</string>
 
 	<!-- Peer trust levels -->
 
-- 
GitLab