mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
Removed star icons, added padding around text, renamed boards -> groups.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -5,7 +5,7 @@
|
|||||||
<string name="notification_text">Touch to quit.</string>
|
<string name="notification_text">Touch to quit.</string>
|
||||||
<string name="contact_list_button">Contacts</string>
|
<string name="contact_list_button">Contacts</string>
|
||||||
<string name="messages_button">Messages</string>
|
<string name="messages_button">Messages</string>
|
||||||
<string name="boards_button">Boards</string>
|
<string name="groups_button">Groups</string>
|
||||||
<string name="blogs_button">Blogs</string>
|
<string name="blogs_button">Blogs</string>
|
||||||
<string name="synchronize_button">Synchronize</string>
|
<string name="synchronize_button">Synchronize</string>
|
||||||
<string name="quit_button">Quit</string>
|
<string name="quit_button">Quit</string>
|
||||||
|
|||||||
@@ -80,18 +80,18 @@ public class HomeScreenActivity extends BriarActivity {
|
|||||||
});
|
});
|
||||||
buttons.add(messagesButton);
|
buttons.add(messagesButton);
|
||||||
|
|
||||||
Button boardsButton = new Button(this);
|
Button groupsButton = new Button(this);
|
||||||
boardsButton.setLayoutParams(matchParent);
|
groupsButton.setLayoutParams(matchParent);
|
||||||
boardsButton.setBackgroundResource(0);
|
groupsButton.setBackgroundResource(0);
|
||||||
boardsButton.setCompoundDrawablesWithIntrinsicBounds(0,
|
groupsButton.setCompoundDrawablesWithIntrinsicBounds(0,
|
||||||
R.drawable.social_chat, 0, 0);
|
R.drawable.social_chat, 0, 0);
|
||||||
boardsButton.setText(R.string.boards_button);
|
groupsButton.setText(R.string.groups_button);
|
||||||
boardsButton.setOnClickListener(new OnClickListener() {
|
groupsButton.setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
// FIXME: Hook this button up to an activity
|
// FIXME: Hook this button up to an activity
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttons.add(boardsButton);
|
buttons.add(groupsButton);
|
||||||
|
|
||||||
Button blogsButton = new Button(this);
|
Button blogsButton = new Button(this);
|
||||||
blogsButton.setLayoutParams(matchParent);
|
blogsButton.setLayoutParams(matchParent);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ implements OnItemClickListener {
|
|||||||
layout.setGravity(CENTER_VERTICAL);
|
layout.setGravity(CENTER_VERTICAL);
|
||||||
|
|
||||||
ImageView bulb = new ImageView(ctx);
|
ImageView bulb = new ImageView(ctx);
|
||||||
bulb.setPadding(5, 5, 5, 5);
|
bulb.setPadding(10, 10, 10, 10);
|
||||||
if(item.isConnected()) bulb.setImageResource(R.drawable.green_bulb);
|
if(item.isConnected()) bulb.setImageResource(R.drawable.green_bulb);
|
||||||
else bulb.setImageResource(R.drawable.grey_bulb);
|
else bulb.setImageResource(R.drawable.grey_bulb);
|
||||||
layout.addView(bulb);
|
layout.addView(bulb);
|
||||||
@@ -46,12 +46,13 @@ implements OnItemClickListener {
|
|||||||
// Give me all the unused width
|
// Give me all the unused width
|
||||||
name.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
name.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
||||||
name.setTextSize(18);
|
name.setTextSize(18);
|
||||||
|
name.setPadding(0, 10, 10, 10);
|
||||||
name.setText(item.getName());
|
name.setText(item.getName());
|
||||||
layout.addView(name);
|
layout.addView(name);
|
||||||
|
|
||||||
TextView connected = new TextView(ctx);
|
TextView connected = new TextView(ctx);
|
||||||
connected.setTextSize(14);
|
connected.setTextSize(14);
|
||||||
connected.setPadding(5, 0, 5, 0);
|
connected.setPadding(0, 10, 10, 10);
|
||||||
if(item.isConnected()) {
|
if(item.isConnected()) {
|
||||||
connected.setText(R.string.contact_connected);
|
connected.setText(R.string.contact_connected);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -34,15 +34,9 @@ class ConversationAdapter extends ArrayAdapter<PrivateMessageHeader> {
|
|||||||
layout.setOrientation(HORIZONTAL);
|
layout.setOrientation(HORIZONTAL);
|
||||||
layout.setGravity(CENTER_VERTICAL);
|
layout.setGravity(CENTER_VERTICAL);
|
||||||
|
|
||||||
ImageView star = new ImageView(ctx);
|
|
||||||
star.setPadding(5, 5, 5, 5);
|
|
||||||
if(item.isStarred()) star.setImageResource(R.drawable.rating_important);
|
|
||||||
else star.setImageResource(R.drawable.rating_not_important);
|
|
||||||
layout.addView(star);
|
|
||||||
|
|
||||||
if(!item.getContentType().equals("text/plain")) {
|
if(!item.getContentType().equals("text/plain")) {
|
||||||
ImageView attachment = new ImageView(ctx);
|
ImageView attachment = new ImageView(ctx);
|
||||||
attachment.setPadding(0, 5, 5, 5);
|
attachment.setPadding(10, 10, 10, 10);
|
||||||
attachment.setImageResource(R.drawable.content_attachment);
|
attachment.setImageResource(R.drawable.content_attachment);
|
||||||
layout.addView(attachment);
|
layout.addView(attachment);
|
||||||
}
|
}
|
||||||
@@ -52,13 +46,14 @@ class ConversationAdapter extends ArrayAdapter<PrivateMessageHeader> {
|
|||||||
subject.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
subject.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
||||||
subject.setTextSize(14);
|
subject.setTextSize(14);
|
||||||
subject.setMaxLines(2);
|
subject.setMaxLines(2);
|
||||||
|
subject.setPadding(10, 10, 10, 10);
|
||||||
if(!item.isRead()) subject.setTypeface(null, BOLD);
|
if(!item.isRead()) subject.setTypeface(null, BOLD);
|
||||||
subject.setText(item.getSubject());
|
subject.setText(item.getSubject());
|
||||||
layout.addView(subject);
|
layout.addView(subject);
|
||||||
|
|
||||||
TextView date = new TextView(ctx);
|
TextView date = new TextView(ctx);
|
||||||
date.setTextSize(14);
|
date.setTextSize(14);
|
||||||
date.setPadding(10, 0, 10, 0);
|
date.setPadding(0, 10, 10, 10);
|
||||||
long then = item.getTimestamp(), now = System.currentTimeMillis();
|
long then = item.getTimestamp(), now = System.currentTimeMillis();
|
||||||
date.setText(DateUtils.formatSameDayTime(then, now, SHORT, SHORT));
|
date.setText(DateUtils.formatSameDayTime(then, now, SHORT, SHORT));
|
||||||
layout.addView(date);
|
layout.addView(date);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import static java.text.DateFormat.SHORT;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import net.sf.briar.R;
|
|
||||||
import net.sf.briar.android.widgets.CommonLayoutParams;
|
import net.sf.briar.android.widgets.CommonLayoutParams;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -19,7 +18,6 @@ import android.view.ViewGroup;
|
|||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -39,12 +37,6 @@ implements OnItemClickListener {
|
|||||||
layout.setOrientation(HORIZONTAL);
|
layout.setOrientation(HORIZONTAL);
|
||||||
layout.setGravity(CENTER_VERTICAL);
|
layout.setGravity(CENTER_VERTICAL);
|
||||||
|
|
||||||
ImageView star = new ImageView(ctx);
|
|
||||||
star.setPadding(5, 5, 5, 5);
|
|
||||||
if(item.isStarred()) star.setImageResource(R.drawable.rating_important);
|
|
||||||
else star.setImageResource(R.drawable.rating_not_important);
|
|
||||||
layout.addView(star);
|
|
||||||
|
|
||||||
LinearLayout innerLayout = new LinearLayout(ctx);
|
LinearLayout innerLayout = new LinearLayout(ctx);
|
||||||
// Give me all the unused width
|
// Give me all the unused width
|
||||||
innerLayout.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
innerLayout.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
||||||
@@ -53,12 +45,14 @@ implements OnItemClickListener {
|
|||||||
|
|
||||||
TextView name = new TextView(ctx);
|
TextView name = new TextView(ctx);
|
||||||
name.setTextSize(18);
|
name.setTextSize(18);
|
||||||
|
name.setPadding(10, 10, 10, 0);
|
||||||
name.setText(item.getName() + " (" + item.getLength() + ")");
|
name.setText(item.getName() + " (" + item.getLength() + ")");
|
||||||
innerLayout.addView(name);
|
innerLayout.addView(name);
|
||||||
|
|
||||||
TextView subject = new TextView(ctx);
|
TextView subject = new TextView(ctx);
|
||||||
subject.setTextSize(14);
|
subject.setTextSize(14);
|
||||||
subject.setMaxLines(2);
|
subject.setMaxLines(2);
|
||||||
|
subject.setPadding(10, 0, 10, 10);
|
||||||
if(!item.isRead()) subject.setTypeface(null, BOLD);
|
if(!item.isRead()) subject.setTypeface(null, BOLD);
|
||||||
subject.setText(item.getSubject());
|
subject.setText(item.getSubject());
|
||||||
innerLayout.addView(subject);
|
innerLayout.addView(subject);
|
||||||
@@ -66,7 +60,7 @@ implements OnItemClickListener {
|
|||||||
|
|
||||||
TextView date = new TextView(ctx);
|
TextView date = new TextView(ctx);
|
||||||
date.setTextSize(14);
|
date.setTextSize(14);
|
||||||
date.setPadding(10, 0, 10, 0);
|
date.setPadding(0, 10, 10, 10);
|
||||||
long then = item.getTimestamp(), now = System.currentTimeMillis();
|
long then = item.getTimestamp(), now = System.currentTimeMillis();
|
||||||
date.setText(DateUtils.formatSameDayTime(then, now, SHORT, SHORT));
|
date.setText(DateUtils.formatSameDayTime(then, now, SHORT, SHORT));
|
||||||
layout.addView(date);
|
layout.addView(date);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class ConversationListItem {
|
|||||||
private final String name, subject;
|
private final String name, subject;
|
||||||
private final long timestamp;
|
private final long timestamp;
|
||||||
private final int length;
|
private final int length;
|
||||||
private final boolean read, starred;
|
private final boolean read;
|
||||||
|
|
||||||
ConversationListItem(Contact contact, List<PrivateMessageHeader> headers) {
|
ConversationListItem(Contact contact, List<PrivateMessageHeader> headers) {
|
||||||
if(headers.isEmpty()) throw new IllegalArgumentException();
|
if(headers.isEmpty()) throw new IllegalArgumentException();
|
||||||
@@ -23,13 +23,9 @@ class ConversationListItem {
|
|||||||
subject = headers.get(0).getSubject();
|
subject = headers.get(0).getSubject();
|
||||||
timestamp = headers.get(0).getTimestamp();
|
timestamp = headers.get(0).getTimestamp();
|
||||||
length = headers.size();
|
length = headers.size();
|
||||||
boolean allRead = true, anyStarred = false;
|
boolean allRead = true;
|
||||||
for(PrivateMessageHeader h : headers) {
|
for(PrivateMessageHeader h : headers) allRead &= h.isRead();
|
||||||
allRead &= h.isRead();
|
|
||||||
anyStarred |= h.isStarred();
|
|
||||||
}
|
|
||||||
read = allRead;
|
read = allRead;
|
||||||
starred = anyStarred;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ContactId getContactId() {
|
ContactId getContactId() {
|
||||||
@@ -52,10 +48,6 @@ class ConversationListItem {
|
|||||||
return read;
|
return read;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isStarred() {
|
|
||||||
return starred;
|
|
||||||
}
|
|
||||||
|
|
||||||
int getLength() {
|
int getLength() {
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ implements OnClickListener {
|
|||||||
private String contactName = null;
|
private String contactName = null;
|
||||||
private MessageId messageId = null;
|
private MessageId messageId = null;
|
||||||
private boolean first, last, starred, read;
|
private boolean first, last, starred, read;
|
||||||
private ImageButton starButton = null, readButton = null;
|
private ImageButton readButton = null;
|
||||||
private ImageButton prevButton = null, nextButton = null;
|
private ImageButton prevButton = null, nextButton = null;
|
||||||
private ImageButton replyButton = null;
|
private ImageButton replyButton = null;
|
||||||
private TextView content = null;
|
private TextView content = null;
|
||||||
@@ -132,14 +132,14 @@ implements OnClickListener {
|
|||||||
// Give me all the unused width
|
// Give me all the unused width
|
||||||
name.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
name.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
||||||
name.setTextSize(18);
|
name.setTextSize(18);
|
||||||
name.setPadding(10, 0, 0, 0);
|
name.setPadding(10, 10, 10, 10);
|
||||||
String format = getResources().getString(R.string.message_from);
|
String format = getResources().getString(R.string.message_from);
|
||||||
name.setText(String.format(format, contactName));
|
name.setText(String.format(format, contactName));
|
||||||
header.addView(name);
|
header.addView(name);
|
||||||
|
|
||||||
TextView date = new TextView(this);
|
TextView date = new TextView(this);
|
||||||
date.setTextSize(14);
|
date.setTextSize(14);
|
||||||
date.setPadding(0, 0, 10, 0);
|
date.setPadding(0, 10, 10, 10);
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
date.setText(DateUtils.formatSameDayTime(timestamp, now, SHORT, SHORT));
|
date.setText(DateUtils.formatSameDayTime(timestamp, now, SHORT, SHORT));
|
||||||
header.addView(date);
|
header.addView(date);
|
||||||
@@ -148,7 +148,7 @@ implements OnClickListener {
|
|||||||
if(contentType.equals("text/plain")) {
|
if(contentType.equals("text/plain")) {
|
||||||
// Load and display the message body
|
// Load and display the message body
|
||||||
content = new TextView(this);
|
content = new TextView(this);
|
||||||
content.setPadding(10, 10, 10, 10);
|
content.setPadding(10, 0, 10, 10);
|
||||||
message.addView(content);
|
message.addView(content);
|
||||||
loadMessageBody();
|
loadMessageBody();
|
||||||
}
|
}
|
||||||
@@ -162,15 +162,6 @@ implements OnClickListener {
|
|||||||
footer.setOrientation(HORIZONTAL);
|
footer.setOrientation(HORIZONTAL);
|
||||||
footer.setGravity(CENTER);
|
footer.setGravity(CENTER);
|
||||||
|
|
||||||
starButton = new ImageButton(this);
|
|
||||||
starButton.setPadding(10, 10, 10, 10);
|
|
||||||
starButton.setBackgroundResource(0);
|
|
||||||
if(starred) starButton.setImageResource(R.drawable.rating_important);
|
|
||||||
else starButton.setImageResource(R.drawable.rating_not_important);
|
|
||||||
starButton.setOnClickListener(this);
|
|
||||||
footer.addView(starButton);
|
|
||||||
footer.addView(new HorizontalSpace(this));
|
|
||||||
|
|
||||||
readButton = new ImageButton(this);
|
readButton = new ImageButton(this);
|
||||||
readButton.setPadding(10, 10, 10, 10);
|
readButton.setPadding(10, 10, 10, 10);
|
||||||
readButton.setBackgroundResource(0);
|
readButton.setBackgroundResource(0);
|
||||||
@@ -255,30 +246,7 @@ implements OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if(view == starButton) {
|
if(view == readButton) {
|
||||||
final MessageId messageId = this.messageId;
|
|
||||||
final boolean starred = !this.starred;
|
|
||||||
dbExecutor.execute(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
serviceConnection.waitForStartup();
|
|
||||||
db.setStarredFlag(messageId, starred);
|
|
||||||
runOnUiThread(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
setStarred(starred);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch(DbException e) {
|
|
||||||
if(LOG.isLoggable(WARNING))
|
|
||||||
LOG.log(WARNING, e.toString(), e);
|
|
||||||
} catch(InterruptedException e) {
|
|
||||||
if(LOG.isLoggable(INFO))
|
|
||||||
LOG.info("Interrupted while waiting for service");
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if(view == readButton) {
|
|
||||||
final MessageId messageId = this.messageId;
|
final MessageId messageId = this.messageId;
|
||||||
final boolean read = !this.read;
|
final boolean read = !this.read;
|
||||||
dbExecutor.execute(new Runnable() {
|
dbExecutor.execute(new Runnable() {
|
||||||
@@ -318,12 +286,6 @@ implements OnClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setStarred(boolean starred) {
|
|
||||||
this.starred = starred;
|
|
||||||
if(starred) starButton.setImageResource(R.drawable.rating_important);
|
|
||||||
else starButton.setImageResource(R.drawable.rating_not_important);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setRead(boolean read) {
|
private void setRead(boolean read) {
|
||||||
this.read = read;
|
this.read = read;
|
||||||
if(read) readButton.setImageResource(R.drawable.content_unread);
|
if(read) readButton.setImageResource(R.drawable.content_unread);
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ implements OnClickListener {
|
|||||||
TextView to = new TextView(this);
|
TextView to = new TextView(this);
|
||||||
// Give me all the unused width
|
// Give me all the unused width
|
||||||
to.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
to.setLayoutParams(CommonLayoutParams.WRAP_WRAP_1);
|
||||||
to.setPadding(10, 0, 0, 0);
|
to.setPadding(10, 10, 10, 10);
|
||||||
to.setTextSize(18);
|
to.setTextSize(18);
|
||||||
String format = getResources().getString(R.string.message_to);
|
String format = getResources().getString(R.string.message_to);
|
||||||
to.setText(String.format(format, contactName));
|
to.setText(String.format(format, contactName));
|
||||||
|
|||||||
Reference in New Issue
Block a user