diff --git a/briar-android/res/layout/introduction_message.xml b/briar-android/res/layout/introduction_message.xml index 9438479911e0a38ccd4f867f605a3ecd0505da5c..a557059f14e3e5bac83394f247c3b8218ab17712 100644 --- a/briar-android/res/layout/introduction_message.xml +++ b/briar-android/res/layout/introduction_message.xml @@ -1,38 +1,51 @@ <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <LinearLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="@dimen/margin_activity_horizontal" - android:orientation="vertical"> + android:orientation="vertical" + android:padding="@dimen/margin_activity_horizontal"> <RelativeLayout - android:id="@+id/introductionHeader" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:padding="@dimen/margin_medium"> + android:layout_height="wrap_content"> - <de.hdodenhof.circleimageview.CircleImageView - android:id="@+id/avatarContact1" - style="@style/BriarAvatar" - android:layout_width="@dimen/listitem_picture_size" - android:layout_height="@dimen/listitem_picture_size" - android:layout_centerHorizontal="true" - android:layout_marginEnd="@dimen/listitem_horizontal_margin" - android:layout_marginRight="@dimen/listitem_horizontal_margin" + <LinearLayout + android:id="@+id/layoutContact1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_toLeftOf="@+id/introductionIcon" - android:layout_toStartOf="@+id/introductionIcon" - tools:src="@drawable/ic_launcher"/> + android:gravity="top|center_horizontal" + android:orientation="vertical"> + + <de.hdodenhof.circleimageview.CircleImageView + android:id="@+id/avatarContact1" + style="@style/BriarAvatar" + android:layout_width="@dimen/listitem_picture_size" + android:layout_height="@dimen/listitem_picture_size" + android:layout_marginEnd="@dimen/listitem_horizontal_margin" + android:layout_marginLeft="@dimen/listitem_horizontal_margin" + android:layout_marginRight="@dimen/listitem_horizontal_margin" + android:layout_marginStart="@dimen/listitem_horizontal_margin" + tools:src="@drawable/ic_launcher"/> + + <TextView + android:id="@+id/nameContact1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/margin_small" + android:gravity="center" + android:textColor="@color/briar_text_primary" + android:textSize="@dimen/text_size_tiny" + tools:text="Contact 1"/> + + </LinearLayout> <ImageView android:id="@+id/introductionIcon" @@ -42,18 +55,38 @@ android:src="@drawable/ic_contact_introduction" tools:ignore="ContentDescription"/> - <de.hdodenhof.circleimageview.CircleImageView - android:id="@+id/avatarContact2" - style="@style/BriarAvatar" - android:layout_width="@dimen/listitem_picture_size" - android:layout_height="@dimen/listitem_picture_size" - android:layout_centerHorizontal="true" - android:layout_marginLeft="@dimen/listitem_horizontal_margin" - android:layout_marginStart="@dimen/listitem_horizontal_margin" + <LinearLayout + android:id="@+id/layoutContact2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_toEndOf="@+id/introductionIcon" android:layout_toRightOf="@+id/introductionIcon" - android:transitionName="avatar" - tools:src="@drawable/ic_launcher"/> + android:gravity="top|center_horizontal" + android:orientation="vertical"> + + <de.hdodenhof.circleimageview.CircleImageView + android:id="@+id/avatarContact2" + style="@style/BriarAvatar" + android:layout_width="@dimen/listitem_picture_size" + android:layout_height="@dimen/listitem_picture_size" + android:layout_marginEnd="@dimen/listitem_horizontal_margin" + android:layout_marginLeft="@dimen/listitem_horizontal_margin" + android:layout_marginRight="@dimen/listitem_horizontal_margin" + android:layout_marginStart="@dimen/listitem_horizontal_margin" + android:transitionName="avatar" + tools:src="@drawable/ic_launcher"/> + + <TextView + android:id="@+id/nameContact2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="@dimen/margin_small" + android:gravity="center" + android:textColor="@color/briar_text_primary" + android:textSize="@dimen/text_size_tiny" + tools:text="Contact 2"/> + + </LinearLayout> </RelativeLayout> @@ -72,8 +105,8 @@ android:layout_marginTop="@dimen/margin_medium" android:layout_weight="1" android:gravity="top" + android:textColor="@color/briar_text_secondary" android:textSize="@dimen/text_size_medium" - android:textColor="@color/briar_text_primary" tools:text="@string/introduction_message_text"/> <EditText @@ -83,7 +116,9 @@ android:layout_marginTop="@dimen/margin_medium" android:gravity="bottom" android:hint="@string/introduction_message_hint" - android:inputType="text|textMultiLine|textCapSentences"/> + android:inputType="text|textMultiLine|textCapSentences" + android:textColor="@color/briar_text_primary" + android:textColorHint="@color/briar_text_tertiary"/> <Button android:id="@+id/makeIntroductionButton" diff --git a/briar-android/src/org/briarproject/android/introduction/IntroductionMessageFragment.java b/briar-android/src/org/briarproject/android/introduction/IntroductionMessageFragment.java index 7b277fb738f33a967918cb8d351c6981fdaf29b8..50570a84bfec4a97ff7db04954903109702bae41 100644 --- a/briar-android/src/org/briarproject/android/introduction/IntroductionMessageFragment.java +++ b/briar-android/src/org/briarproject/android/introduction/IntroductionMessageFragment.java @@ -150,6 +150,10 @@ public class IntroductionMessageFragment extends BaseFragment { ui.avatar2.setImageDrawable(new IdenticonDrawable( c2.getAuthor().getId().getBytes())); + // set contact names + ui.contactName1.setText(c1.getAuthor().getName()); + ui.contactName2.setText(c2.getAuthor().getName()); + // set introduction text ui.text.setText(String.format( getString(R.string.introduction_message_text), @@ -217,6 +221,7 @@ public class IntroductionMessageFragment extends BaseFragment { private final ProgressBar progressBar; private final CircleImageView avatar1, avatar2; + private final TextView contactName1, contactName2; private final TextView text; private final EditText message; private final Button button; @@ -225,6 +230,8 @@ public class IntroductionMessageFragment extends BaseFragment { progressBar = (ProgressBar) v.findViewById(R.id.progressBar); avatar1 = (CircleImageView) v.findViewById(R.id.avatarContact1); avatar2 = (CircleImageView) v.findViewById(R.id.avatarContact2); + contactName1 = (TextView) v.findViewById(R.id.nameContact1); + contactName2 = (TextView) v.findViewById(R.id.nameContact2); text = (TextView) v.findViewById(R.id.introductionText); message = (EditText) v.findViewById(R.id.introductionMessageView); button = (Button) v.findViewById(R.id.makeIntroductionButton);