From 7514c46a3f607d9c3f7bfdabf2256f2d0d8768e3 Mon Sep 17 00:00:00 2001 From: akwizgran Date: Fri, 30 Jun 2017 16:22:52 +0100 Subject: [PATCH] Use smaller layout for introduction message screen. --- .../IntroductionMessageFragment.java | 10 - .../main/res/layout/introduction_message.xml | 183 ++++++++---------- briar-android/src/main/res/values/strings.xml | 9 +- 3 files changed, 86 insertions(+), 116 deletions(-) diff --git a/briar-android/src/main/java/org/briarproject/briar/android/introduction/IntroductionMessageFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/introduction/IntroductionMessageFragment.java index e5a624cb0..ddf70e4f2 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/introduction/IntroductionMessageFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/introduction/IntroductionMessageFragment.java @@ -33,7 +33,6 @@ import im.delight.android.identicons.IdenticonDrawable; import static android.app.Activity.RESULT_OK; import static android.view.View.GONE; -import static android.view.View.VISIBLE; import static android.widget.Toast.LENGTH_SHORT; import static java.util.logging.Level.WARNING; import static org.briarproject.briar.api.introduction.IntroductionConstants.MAX_INTRODUCTION_MESSAGE_LENGTH; @@ -94,7 +93,6 @@ public class IntroductionMessageFragment extends BaseFragment View v = inflater.inflate(R.layout.introduction_message, container, false); ui = new ViewHolder(v); - ui.text.setVisibility(GONE); ui.message.setSendButtonEnabled(false); return v; @@ -156,17 +154,11 @@ public class IntroductionMessageFragment extends BaseFragment 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), - c1.getAuthor().getName(), c2.getAuthor().getName())); - // set button action ui.message.setListener(IntroductionMessageFragment.this); // hide progress bar and show views ui.progressBar.setVisibility(GONE); - ui.text.setVisibility(VISIBLE); ui.message.setSendButtonEnabled(true); ui.message.showSoftKeyboard(); } @@ -234,7 +226,6 @@ 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 TextInputView message; private ViewHolder(View v) { @@ -243,7 +234,6 @@ public class IntroductionMessageFragment extends BaseFragment 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 = (TextInputView) v .findViewById(R.id.introductionMessageView); } diff --git a/briar-android/src/main/res/layout/introduction_message.xml b/briar-android/src/main/res/layout/introduction_message.xml index d7c5c9a33..e78e1c639 100644 --- a/briar-android/src/main/res/layout/introduction_message.xml +++ b/briar-android/src/main/res/layout/introduction_message.xml @@ -1,5 +1,5 @@ - - + android:layout_height="wrap_content" + android:orientation="vertical"> + android:gravity="center" + android:orientation="horizontal"> - - - - - - - - - - - - - - - - - - - - - - - + android:gravity="top|center_horizontal" + android:orientation="vertical"> - + + + + + + + + + android:gravity="top|center_horizontal" + android:orientation="vertical"> + + + + + + - + - + - + + \ No newline at end of file diff --git a/briar-android/src/main/res/values/strings.xml b/briar-android/src/main/res/values/strings.xml index 42d6ba9f2..a4088e192 100644 --- a/briar-android/src/main/res/values/strings.xml +++ b/briar-android/src/main/res/values/strings.xml @@ -127,8 +127,7 @@ You can introduce your contacts to each other, so they don\'t need to meet in person to connect on Briar. Select Contact Introduce Contacts - You can compose a message that will be sent to %1$s and %2$s along with your introduction: - Type message (optional) + Add a message (optional) Make Introduction Your introduction has been sent. There was an error making the introduction. @@ -160,7 +159,7 @@ Create Private Group Create Group Send Invitation - Add a name for your private group + Choose a name for your private group Group invitation has been sent Message sent Member List @@ -231,7 +230,7 @@ Choose Contacts It seems that you are new here and have no contacts yet.\n\nPlease come back here after you added your first contact. Forum shared with chosen contacts - You may compose an optional invitation message that will be sent to the selected contacts. + Add a message (optional) There was an error sharing this forum. %1$s has shared the forum \"%2$s\" with you. You have shared the forum \"%1$s\" with %2$s. @@ -270,7 +269,7 @@ Are you sure that you want to remove this blog and all posts?\nNote that this will not remove the blog from other people\'s devices. Remove Blog Blog Removed - Add an optional comment + Add a comment (optional) Reblog