diff --git a/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java
index 9608385aa..25e01ac95 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/keyagreement/ShowQrCodeFragment.java
@@ -15,6 +15,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AlphaAnimation;
import android.widget.ImageView;
+import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;
import android.widget.Toast;
@@ -50,6 +51,7 @@ import javax.inject.Inject;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
+import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.widget.Toast.LENGTH_LONG;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
@@ -81,6 +83,7 @@ public class ShowQrCodeFragment extends BaseEventFragment
private ImageView qrCode;
private TextView mainProgressTitle;
private ViewGroup mainProgressContainer;
+ private boolean fullscreen = false;
private boolean gotRemotePayload;
private volatile boolean gotLocalPayload;
@@ -125,6 +128,25 @@ public class ShowQrCodeFragment extends BaseEventFragment
qrCode = view.findViewById(R.id.qr_code);
mainProgressTitle = view.findViewById(R.id.title_progress_bar);
mainProgressContainer = view.findViewById(R.id.container_progress);
+ ImageView fullscreenButton = view.findViewById(R.id.fullscreen_button);
+ fullscreenButton.setOnClickListener(v -> {
+ View qrCodeContainer = view.findViewById(R.id.qr_code_container);
+ if (fullscreen) {
+ // Shrink the QR code container
+ qrCodeContainer.setLayoutParams(
+ new LayoutParams(MATCH_PARENT, 0, 1f));
+ fullscreenButton.setBackgroundResource(
+ R.drawable.ic_fullscreen_black_48dp);
+ } else {
+ // Grow the QR code container
+ qrCodeContainer.setLayoutParams(
+ new LayoutParams(MATCH_PARENT, MATCH_PARENT, 1f));
+ fullscreenButton.setBackgroundResource(
+ R.drawable.ic_fullscreen_exit_black_48dp);
+ }
+ view.findViewById(R.id.camera_overlay).invalidate();
+ fullscreen = !fullscreen;
+ });
}
@Override
diff --git a/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml b/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml
new file mode 100644
index 000000000..affab0d46
--- /dev/null
+++ b/briar-android/src/main/res/drawable/ic_fullscreen_black_48dp.xml
@@ -0,0 +1,4 @@
+
+
+
diff --git a/briar-android/src/main/res/drawable/ic_fullscreen_exit_black_48dp.xml b/briar-android/src/main/res/drawable/ic_fullscreen_exit_black_48dp.xml
new file mode 100644
index 000000000..5b62d104c
--- /dev/null
+++ b/briar-android/src/main/res/drawable/ic_fullscreen_exit_black_48dp.xml
@@ -0,0 +1,4 @@
+
+
+
diff --git a/briar-android/src/main/res/layout-land/fragment_keyagreement_qr.xml b/briar-android/src/main/res/layout-land/fragment_keyagreement_qr.xml
index e9a174c77..c811b58c8 100644
--- a/briar-android/src/main/res/layout-land/fragment_keyagreement_qr.xml
+++ b/briar-android/src/main/res/layout-land/fragment_keyagreement_qr.xml
@@ -15,39 +15,36 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
- android:weightSum="2">
+ android:weightSum="2"
+ android:baselineAligned="false">
-
+ android:layout_weight="1"
+ android:background="@android:color/background_light"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="@dimen/margin_medium"
+ android:visibility="invisible">
-
+
+
-
-
-
-
-
-
+ android:paddingTop="@dimen/margin_large"
+ tools:text="Connection failed"/>
+
-
+ android:layout_height="match_parent">
+
+
+
+
+
@@ -92,5 +107,4 @@
android:paddingTop="@dimen/margin_large"
tools:text="@string/waiting_for_contact_to_scan"/>
-
diff --git a/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml b/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml
index 1aaf28183..456ffbca1 100644
--- a/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml
+++ b/briar-android/src/main/res/layout/fragment_keyagreement_qr.xml
@@ -15,39 +15,36 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:weightSum="2">
+ android:weightSum="2"
+ android:baselineAligned="false">
-
+ android:layout_weight="1"
+ android:background="@android:color/background_light"
+ android:gravity="center"
+ android:orientation="vertical"
+ android:padding="@dimen/margin_medium"
+ android:visibility="invisible">
-
+
+
-
-
-
-
-
-
+ android:paddingTop="@dimen/margin_large"
+ tools:text="Connection failed"/>
+
-
+ android:layout_height="match_parent">
+
+
+
+
+
@@ -92,5 +107,4 @@
android:paddingTop="@dimen/margin_large"
tools:text="@string/waiting_for_contact_to_scan"/>
-
diff --git a/briar-android/src/main/res/values/strings.xml b/briar-android/src/main/res/values/strings.xml
index 27c158e47..410e39c35 100644
--- a/briar-android/src/main/res/values/strings.xml
+++ b/briar-android/src/main/res/values/strings.xml
@@ -408,5 +408,7 @@
To scan the QR code, Briar needs access to the camera.
You have denied access to the camera, but adding contacts requires using the camera.\n\nPlease consider granting access.
Camera permission was not granted
+ QR code
+ Show QR code fullscreen