Cleaned up composition screen layouts.

This commit is contained in:
akwizgran
2014-02-27 15:34:52 +00:00
parent de5dac6ce3
commit 8619f89890
3 changed files with 13 additions and 35 deletions

View File

@@ -22,7 +22,6 @@
<string name="forums_button">Forums</string>
<string name="synchronize_button">Synchronize</string>
<string name="sign_out_button">Sign Out</string>
<string name="new_identity_item">New identity\u2026</string>
<string name="contact_list_title">Contacts</string>
<string name="contact_connected">Connected</string>
<string name="format_last_connected">Last connected &lt;br /&gt; %s</string>
@@ -47,13 +46,9 @@
<string name="contact_added_toast">Contact added</string>
<string name="private_message_hint">Type message</string>
<string name="message_sent_toast">Message sent</string>
<string name="format_from">From: %s</string>
<string name="format_to">To: %s</string>
<string name="read_message_title">Private Message</string>
<string name="write_message_title">New Private Message</string>
<string name="from">From:</string>
<string name="to">To:</string>
<string name="anonymous">Anonymous</string>
<string name="format_from">From: %s</string>
<string name="new_contact_item">New contact\u2026</string>
<string name="forums_title">Forums</string>
<plurals name="forums_available">
@@ -68,7 +63,10 @@
<string name="forum_visible_to_some">Share this forum with chosen contacts</string>
<string name="done_button">Done</string>
<string name="new_post_title">New Post</string>
<string name="new_forum_item">New forum\u2026</string>
<string name="from">From:</string>
<string name="anonymous">Anonymous</string>
<string name="new_identity_item">New identity\u2026</string>
<string name="group_post_hint">Type forum post</string>
<string name="manage_subscriptions_title">Available Forums</string>
<string name="no_forums_available">No forums available from contacts</string>
<string name="subscribed_all">Subscribed, shared with all contacts</string>

View File

@@ -60,7 +60,7 @@ implements OnClickListener {
Logger.getLogger(WritePrivateMessageActivity.class.getName());
@Inject @CryptoExecutor private Executor cryptoExecutor;
private TextView from = null, to = null;
private TextView from = null;
private ImageButton sendButton = null;
private EditText content = null;
@@ -84,6 +84,7 @@ implements OnClickListener {
Intent i = getIntent();
contactName = i.getStringExtra("briar.CONTACT_NAME");
if(contactName == null) throw new IllegalStateException();
setTitle(contactName);
byte[] b = i.getByteArrayExtra("briar.GROUP_ID");
if(b == null) throw new IllegalStateException();
groupId = new GroupId(b);
@@ -98,7 +99,7 @@ implements OnClickListener {
layout.setLayoutParams(MATCH_WRAP);
layout.setOrientation(VERTICAL);
int pad = LayoutUtils.getPadding(this);
layout.setPadding(pad, pad, pad, pad);
layout.setPadding(pad, 0, pad, pad);
RelativeLayout header = new RelativeLayout(this);
@@ -107,7 +108,7 @@ implements OnClickListener {
from.setTextSize(18);
from.setSingleLine();
from.setEllipsize(END);
from.setPadding(0, 0, pad, pad);
from.setPadding(0, 0, pad, 0);
from.setText(R.string.from);
RelativeLayout.LayoutParams leftOf = CommonLayoutParams.relative();
leftOf.addRule(ALIGN_PARENT_LEFT);
@@ -127,20 +128,12 @@ implements OnClickListener {
header.addView(sendButton, right);
layout.addView(header);
to = new TextView(this);
to.setTextSize(18);
to.setSingleLine();
to.setEllipsize(END);
to.setPadding(0, 0, pad, pad);
String format = getResources().getString(R.string.format_to);
to.setText(String.format(format, contactName));
layout.addView(to);
content = new EditText(this);
content.setId(3);
int inputType = TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE
| TYPE_TEXT_FLAG_CAP_SENTENCES;
content.setInputType(inputType);
content.setHint(R.string.private_message_hint);
layout.addView(content);
setContentView(layout);

View File

@@ -2,7 +2,6 @@ package org.briarproject.android.groups;
import static android.text.InputType.TYPE_CLASS_TEXT;
import static android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
import static android.text.TextUtils.TruncateAt.END;
import static android.widget.LinearLayout.VERTICAL;
import static android.widget.RelativeLayout.ALIGN_PARENT_LEFT;
import static android.widget.RelativeLayout.ALIGN_PARENT_RIGHT;
@@ -48,7 +47,6 @@ import org.briarproject.api.messaging.MessageId;
import org.briarproject.util.StringUtils;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.InputType;
import android.view.View;
@@ -73,7 +71,6 @@ implements OnItemSelectedListener, OnClickListener {
private LocalAuthorSpinnerAdapter adapter = null;
private Spinner spinner = null;
private ImageButton sendButton = null;
private TextView to = null;
private EditText content = null;
private AuthorId localAuthorId = null;
private GroupId groupId = null;
@@ -111,14 +108,13 @@ implements OnItemSelectedListener, OnClickListener {
layout.setLayoutParams(MATCH_WRAP);
layout.setOrientation(VERTICAL);
int pad = LayoutUtils.getPadding(this);
layout.setPadding(pad, pad, pad, pad);
layout.setPadding(pad, 0, pad, pad);
RelativeLayout header = new RelativeLayout(this);
TextView from = new TextView(this);
from.setId(1);
from.setTextSize(18);
from.setPadding(0, 0, 0, pad);
from.setText(R.string.from);
RelativeLayout.LayoutParams left = CommonLayoutParams.relative();
left.addRule(ALIGN_PARENT_LEFT);
@@ -148,19 +144,12 @@ implements OnItemSelectedListener, OnClickListener {
header.addView(sendButton, right);
layout.addView(header);
to = new TextView(this);
to.setTextSize(18);
to.setSingleLine();
to.setEllipsize(END);
to.setPadding(0, 0, pad, pad);
to.setText(R.string.to);
layout.addView(to);
content = new EditText(this);
content.setId(4);
int inputType = TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE
| TYPE_TEXT_FLAG_CAP_SENTENCES;
content.setInputType(inputType);
content.setHint(R.string.group_post_hint);
layout.addView(content);
setContentView(layout);
@@ -216,9 +205,7 @@ implements OnItemSelectedListener, OnClickListener {
break;
}
}
Resources res = getResources();
String format = res.getString(R.string.format_to);
to.setText(String.format(format, group.getName()));
setTitle(group.getName());
sendButton.setEnabled(true);
}
});