ui: adapt the share fragment for landscape
In landscape mode, the "infos" textView is layed out to the left of the
QR code.
Also fix the case where the shareURI is empty.
Change-Id: I4999bd80bc8bd791f9296f8fffc76b58459e47a1
Tuleap: #1430
diff --git a/ring-android/app/src/main/res/layout/frag_share.xml b/ring-android/app/src/main/res/layout/frag_share.xml
index 6680f6b..1d246d4 100644
--- a/ring-android/app/src/main/res/layout/frag_share.xml
+++ b/ring-android/app/src/main/res/layout/frag_share.xml
@@ -3,37 +3,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
- <TextView
- android:id="@+id/share_instruction"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_above="@+id/qr_image_panel"
- android:layout_alignEnd="@+id/qr_image_panel"
- android:layout_alignLeft="@+id/qr_image_panel"
- android:layout_alignRight="@+id/qr_image_panel"
- android:layout_alignStart="@+id/qr_image_panel"
- android:paddingBottom="24sp"
- android:paddingTop="16sp"
- android:text="@string/share_message"
- android:textColor="@color/text_color_primary"
- android:textSize="16sp" />
-
- <LinearLayout
- android:id="@+id/qr_image_panel"
- android:layout_width="300dp"
- android:layout_height="300dp"
- android:layout_centerHorizontal="true"
- android:layout_centerInParent="true"
- android:background="@color/black"
- android:padding="10dp">
-
- <ImageView
- android:id="@+id/qr_image"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@null" />
-
- </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
@@ -53,5 +22,33 @@
</LinearLayout>
+ <ImageView
+ android:id="@+id/qr_image"
+ android:layout_width="300dp"
+ android:layout_height="300dp"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+
+ android:gravity="center"
+ android:padding="@dimen/padding_small"
+ android:scaleType="fitCenter" />
+
+ <TextView
+ android:id="@+id/share_instruction"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_above="@+id/qr_image"
+ android:layout_alignEnd="@+id/qr_image"
+ android:layout_alignLeft="@+id/qr_image"
+ android:layout_alignParentTop="true"
+ android:layout_alignRight="@+id/qr_image"
+ android:layout_alignStart="@+id/qr_image"
+ android:gravity="center"
+ android:paddingBottom="24sp"
+ android:paddingTop="16sp"
+ android:text="@string/share_message"
+ android:textColor="@color/text_color_primary"
+ android:textSize="16sp" />
+
</RelativeLayout>
\ No newline at end of file