diff --git a/briar-android/res/drawable/bubble_read_left.png b/briar-android/res/drawable/bubble_read_left.png
deleted file mode 100644
index ec9ebc117..000000000
Binary files a/briar-android/res/drawable/bubble_read_left.png and /dev/null differ
diff --git a/briar-android/res/drawable/bubble_read_right.png b/briar-android/res/drawable/bubble_read_right.png
deleted file mode 100644
index 5bacbfa93..000000000
Binary files a/briar-android/res/drawable/bubble_read_right.png and /dev/null differ
diff --git a/briar-android/res/drawable/bubble_unread_left.png b/briar-android/res/drawable/bubble_unread_left.png
deleted file mode 100644
index 1152c1cbe..000000000
Binary files a/briar-android/res/drawable/bubble_unread_left.png and /dev/null differ
diff --git a/briar-android/res/drawable/bubble_unread_right.png b/briar-android/res/drawable/bubble_unread_right.png
deleted file mode 100644
index 29b4a6186..000000000
Binary files a/briar-android/res/drawable/bubble_unread_right.png and /dev/null differ
diff --git a/briar-android/res/values-v11/styles.xml b/briar-android/res/values-v11/styles.xml
index f5476f167..3d35b1d09 100644
--- a/briar-android/res/values-v11/styles.xml
+++ b/briar-android/res/values-v11/styles.xml
@@ -1,4 +1,10 @@
-
+
+
\ No newline at end of file
diff --git a/briar-android/res/values/color.xml b/briar-android/res/values/color.xml
index 384421bf8..c306f6ddb 100644
--- a/briar-android/res/values/color.xml
+++ b/briar-android/res/values/color.xml
@@ -1,11 +1,12 @@
+ #2D3E50
#FFFFFF
#FFFFFF
#DDDDDD
#FFFFFF
#EEEEEE
+ #FFFFFF
#CCCCCC
#AAAAAA
- #AAAAAA
\ No newline at end of file
diff --git a/briar-android/res/values/strings.xml b/briar-android/res/values/strings.xml
index f2cf76982..32bc6f1a9 100644
--- a/briar-android/res/values/strings.xml
+++ b/briar-android/res/values/strings.xml
@@ -45,7 +45,8 @@
Codes do not match
This could mean that someone is trying to interfere with your connection
Contact added
- Done
+ Type message
+ Message sent
From: %s
To: %s
Private Message
@@ -65,6 +66,7 @@
Choose a name for your forum:
Share this forum with all contacts
Share this forum with chosen contacts
+ Done
New Post
New forum\u2026
Available Forums
@@ -77,7 +79,6 @@
You don\'t have any contacts. Add a contact now?
Add
Cancel
- Message sent
Post sent
Not implemented yet!
New private message
diff --git a/briar-android/src/org/briarproject/android/contact/ConversationActivity.java b/briar-android/src/org/briarproject/android/contact/ConversationActivity.java
index d71b8c263..10b3fa463 100644
--- a/briar-android/src/org/briarproject/android/contact/ConversationActivity.java
+++ b/briar-android/src/org/briarproject/android/contact/ConversationActivity.java
@@ -2,6 +2,7 @@ package org.briarproject.android.contact;
import static android.text.InputType.TYPE_CLASS_TEXT;
import static android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
+import static android.view.Gravity.CENTER_VERTICAL;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
import static android.view.inputmethod.InputMethodManager.HIDE_IMPLICIT_ONLY;
@@ -140,7 +141,7 @@ implements EventListener, OnClickListener, OnItemClickListener {
int background = res.getColor(R.color.conversation_background);
list.setBackgroundColor(background);
list.setDivider(new ColorDrawable(background));
- list.setDividerHeight(LayoutUtils.getSeparatorWidth(this));
+ list.setDividerHeight(pad);
list.setAdapter(adapter);
list.setOnItemClickListener(this);
list.setVisibility(GONE);
@@ -155,7 +156,9 @@ implements EventListener, OnClickListener, OnItemClickListener {
LinearLayout footer = new LinearLayout(this);
footer.setLayoutParams(MATCH_WRAP);
footer.setOrientation(HORIZONTAL);
+ footer.setGravity(CENTER_VERTICAL);
footer.setPadding(pad, 0, 0, 0);
+ footer.setBackgroundColor(res.getColor(R.color.compose_background));
content = new EditText(this);
content.setId(1);
@@ -163,14 +166,13 @@ implements EventListener, OnClickListener, OnItemClickListener {
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);
footer.addView(content);
sendButton = new ImageButton(this);
sendButton.setId(2);
sendButton.setBackgroundResource(0);
sendButton.setImageResource(R.drawable.social_send_now);
- sendButton.setScaleX(1.5f);
- sendButton.setScaleY(1.5f);
sendButton.setEnabled(false); // Enabled after loading the group
sendButton.setOnClickListener(this);
footer.addView(sendButton);
@@ -358,6 +360,8 @@ implements EventListener, OnClickListener, OnItemClickListener {
}
public void onClick(View view) {
+ String message = content.getText().toString();
+ if(message.equals("")) return;
// Don't use an earlier timestamp than the newest message
long timestamp = System.currentTimeMillis();
int count = adapter.getCount();
@@ -365,8 +369,7 @@ implements EventListener, OnClickListener, OnItemClickListener {
long time = adapter.getItem(i).getHeader().getTimestamp() + 1;
if(time > timestamp) timestamp = time;
}
- byte[] body = StringUtils.toUtf8(content.getText().toString());
- createMessage(body, timestamp);
+ createMessage(StringUtils.toUtf8(message), timestamp);
Toast.makeText(this, R.string.message_sent_toast, LENGTH_SHORT).show();
content.setText("");
// Hide the soft keyboard
diff --git a/briar-android/src/org/briarproject/android/contact/ConversationAdapter.java b/briar-android/src/org/briarproject/android/contact/ConversationAdapter.java
index af0f6dbdf..3a3ae841e 100644
--- a/briar-android/src/org/briarproject/android/contact/ConversationAdapter.java
+++ b/briar-android/src/org/briarproject/android/contact/ConversationAdapter.java
@@ -2,31 +2,24 @@ package org.briarproject.android.contact;
import static android.view.Gravity.LEFT;
import static android.view.Gravity.RIGHT;
-import static android.widget.RelativeLayout.ALIGN_PARENT_LEFT;
-import static android.widget.RelativeLayout.ALIGN_PARENT_RIGHT;
-import static android.widget.RelativeLayout.ALIGN_PARENT_TOP;
-import static android.widget.RelativeLayout.BELOW;
-import static android.widget.RelativeLayout.LEFT_OF;
-import static android.widget.RelativeLayout.RIGHT_OF;
+import static android.widget.LinearLayout.VERTICAL;
+import static org.briarproject.android.util.CommonLayoutParams.MATCH_WRAP;
import java.util.ArrayList;
import org.briarproject.R;
-import org.briarproject.android.util.CommonLayoutParams;
import org.briarproject.android.util.LayoutUtils;
import org.briarproject.api.db.MessageHeader;
import org.briarproject.util.StringUtils;
import android.content.Context;
import android.content.res.Resources;
-import android.graphics.drawable.Drawable;
import android.text.format.DateUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
-import android.widget.ImageView;
-import android.widget.RelativeLayout;
+import android.widget.LinearLayout;
import android.widget.TextView;
class ConversationAdapter extends ArrayAdapter {
@@ -46,17 +39,26 @@ class ConversationAdapter extends ArrayAdapter {
Context ctx = getContext();
Resources res = ctx.getResources();
+ LinearLayout layout = new LinearLayout(ctx);
+ layout.setOrientation(VERTICAL);
+ if(header.isLocal()) layout.setPadding(3 * pad, 0, 0, 0);
+ else layout.setPadding(0, 0, 3 * pad, 0);
+
int background;
if(header.isRead()) background = res.getColor(R.color.read_background);
else background = res.getColor(R.color.unread_background);
TextView date = new TextView(ctx);
date.setId(1);
+ date.setLayoutParams(MATCH_WRAP);
+ if(header.isLocal()) date.setGravity(RIGHT);
+ else date.setGravity(LEFT);
date.setTextSize(14);
date.setBackgroundColor(background);
date.setPadding(pad, pad, pad, 0);
long timestamp = header.getTimestamp();
date.setText(DateUtils.getRelativeTimeSpanString(ctx, timestamp));
+ layout.addView(date);
View content;
if(item.getBody() == null) {
@@ -73,61 +75,11 @@ class ConversationAdapter extends ArrayAdapter {
content = attachment;
}
content.setId(2);
+ content.setLayoutParams(MATCH_WRAP);
content.setBackgroundColor(background);
content.setPadding(pad, 0, pad, pad);
+ layout.addView(content);
- ImageView bubble = new ImageView(ctx);
- bubble.setId(3);
-
- RelativeLayout layout = new RelativeLayout(ctx);
- if(header.isLocal()) {
- Drawable d;
- if(header.isRead())
- d = res.getDrawable(R.drawable.bubble_read_right);
- else d = res.getDrawable(R.drawable.bubble_unread_right);
- bubble.setImageDrawable(d);
- layout.setPadding(d.getIntrinsicWidth(), 0, 0, 0);
- // Bubble tip and date at the top right, content below
- date.setGravity(RIGHT);
- RelativeLayout.LayoutParams topRight =
- CommonLayoutParams.relative();
- topRight.addRule(ALIGN_PARENT_TOP);
- topRight.addRule(ALIGN_PARENT_RIGHT);
- layout.addView(bubble, topRight);
- RelativeLayout.LayoutParams leftOf = CommonLayoutParams.relative();
- leftOf.addRule(ALIGN_PARENT_TOP);
- leftOf.addRule(ALIGN_PARENT_LEFT);
- leftOf.addRule(LEFT_OF, 3);
- layout.addView(date, leftOf);
- RelativeLayout.LayoutParams below = CommonLayoutParams.relative();
- below.addRule(ALIGN_PARENT_LEFT);
- below.addRule(LEFT_OF, 3);
- below.addRule(BELOW, 1);
- layout.addView(content, below);
- } else {
- Drawable d;
- if(header.isRead())
- d = res.getDrawable(R.drawable.bubble_read_left);
- else d = res.getDrawable(R.drawable.bubble_unread_left);
- bubble.setImageDrawable(d);
- layout.setPadding(0, 0, d.getIntrinsicWidth(), 0);
- // Bubble tip and date at the top left, content below
- date.setGravity(LEFT);
- RelativeLayout.LayoutParams topLeft = CommonLayoutParams.relative();
- topLeft.addRule(ALIGN_PARENT_TOP);
- topLeft.addRule(ALIGN_PARENT_LEFT);
- layout.addView(bubble, topLeft);
- RelativeLayout.LayoutParams rightOf = CommonLayoutParams.relative();
- rightOf.addRule(ALIGN_PARENT_TOP);
- rightOf.addRule(ALIGN_PARENT_RIGHT);
- rightOf.addRule(RIGHT_OF, 3);
- layout.addView(date, rightOf);
- RelativeLayout.LayoutParams below = CommonLayoutParams.relative();
- below.addRule(ALIGN_PARENT_RIGHT);
- below.addRule(RIGHT_OF, 3);
- below.addRule(BELOW, 1);
- layout.addView(content, below);
- }
return layout;
}
}
\ No newline at end of file
diff --git a/briar-android/src/org/briarproject/android/contact/WritePrivateMessageActivity.java b/briar-android/src/org/briarproject/android/contact/WritePrivateMessageActivity.java
index d0b526906..d802d6f64 100644
--- a/briar-android/src/org/briarproject/android/contact/WritePrivateMessageActivity.java
+++ b/briar-android/src/org/briarproject/android/contact/WritePrivateMessageActivity.java
@@ -119,8 +119,6 @@ implements OnClickListener {
sendButton.setId(2);
sendButton.setBackgroundResource(0);
sendButton.setImageResource(R.drawable.social_send_now);
- sendButton.setScaleX(1.5f);
- sendButton.setScaleY(1.5f);
sendButton.setEnabled(false); // Enabled after loading the group
sendButton.setOnClickListener(this);
RelativeLayout.LayoutParams right = CommonLayoutParams.relative();
@@ -194,7 +192,9 @@ implements OnClickListener {
}
public void onClick(View view) {
- createMessage(StringUtils.toUtf8(content.getText().toString()));
+ String message = content.getText().toString();
+ if(message.equals("")) return;
+ createMessage(StringUtils.toUtf8(message));
Toast.makeText(this, R.string.message_sent_toast, LENGTH_LONG).show();
finish();
}
diff --git a/briar-android/src/org/briarproject/android/groups/WriteGroupPostActivity.java b/briar-android/src/org/briarproject/android/groups/WriteGroupPostActivity.java
index af6fc08c4..a15793694 100644
--- a/briar-android/src/org/briarproject/android/groups/WriteGroupPostActivity.java
+++ b/briar-android/src/org/briarproject/android/groups/WriteGroupPostActivity.java
@@ -140,8 +140,6 @@ implements OnItemSelectedListener, OnClickListener {
sendButton.setId(3);
sendButton.setBackgroundResource(0);
sendButton.setImageResource(R.drawable.social_send_now);
- sendButton.setScaleX(1.5f);
- sendButton.setScaleY(1.5f);
sendButton.setEnabled(false); // Enabled after loading the group
sendButton.setOnClickListener(this);
RelativeLayout.LayoutParams right = CommonLayoutParams.relative();
@@ -270,7 +268,9 @@ implements OnItemSelectedListener, OnClickListener {
public void onClick(View view) {
if(group == null) throw new IllegalStateException();
- createMessage(StringUtils.toUtf8(content.getText().toString()));
+ String message = content.getText().toString();
+ if(message.equals("")) return;
+ createMessage(StringUtils.toUtf8(message));
Toast.makeText(this, R.string.post_sent_toast, LENGTH_LONG).show();
finish();
}
diff --git a/briar-android/src/org/briarproject/android/util/LayoutUtils.java b/briar-android/src/org/briarproject/android/util/LayoutUtils.java
index 52b1ed994..f23fd9ab8 100644
--- a/briar-android/src/org/briarproject/android/util/LayoutUtils.java
+++ b/briar-android/src/org/briarproject/android/util/LayoutUtils.java
@@ -10,7 +10,7 @@ public class LayoutUtils {
public static int getSeparatorWidth(Context ctx) {
DisplayMetrics metrics = getDisplayMetrics(ctx);
int percent = Math.max(metrics.widthPixels, metrics.heightPixels) / 100;
- return Math.max(2, percent - 7);
+ return Math.max(2, percent - 8);
}
public static int getPadding(Context ctx) {