mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Brighter colours.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package org.briarproject.android.contact;
|
||||
|
||||
import static android.view.Gravity.CENTER;
|
||||
import static android.view.Gravity.CENTER_HORIZONTAL;
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
@@ -7,6 +8,7 @@ import static android.widget.LinearLayout.VERTICAL;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_MATCH;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_WRAP;
|
||||
import static org.briarproject.android.util.CommonLayoutParams.MATCH_WRAP_1;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -42,6 +44,7 @@ import org.briarproject.api.transport.ConnectionListener;
|
||||
import org.briarproject.api.transport.ConnectionRegistry;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
@@ -92,11 +95,17 @@ ConnectionListener {
|
||||
|
||||
layout.addView(new HorizontalBorder(this));
|
||||
|
||||
LinearLayout footer = new LinearLayout(this);
|
||||
footer.setLayoutParams(MATCH_WRAP);
|
||||
footer.setGravity(CENTER);
|
||||
Resources res = getResources();
|
||||
footer.setBackgroundColor(res.getColor(R.color.button_bar_background));
|
||||
addContactButton = new ImageButton(this);
|
||||
addContactButton.setBackgroundResource(0);
|
||||
addContactButton.setImageResource(R.drawable.social_add_person);
|
||||
addContactButton.setOnClickListener(this);
|
||||
layout.addView(addContactButton);
|
||||
footer.addView(addContactButton);
|
||||
layout.addView(footer);
|
||||
|
||||
setContentView(layout);
|
||||
}
|
||||
|
||||
@@ -35,11 +35,13 @@ class ContactListAdapter extends ArrayAdapter<ContactListItem> {
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
ContactListItem item = getItem(position);
|
||||
Context ctx = getContext();
|
||||
Resources res = ctx.getResources();
|
||||
|
||||
LinearLayout layout = new LinearLayout(ctx);
|
||||
layout.setOrientation(HORIZONTAL);
|
||||
layout.setGravity(CENTER_VERTICAL);
|
||||
Resources res = ctx.getResources();
|
||||
if(item.getUnreadCount() > 0)
|
||||
int unread = item.getUnreadCount();
|
||||
if(unread > 0)
|
||||
layout.setBackgroundColor(res.getColor(R.color.unread_background));
|
||||
|
||||
ImageView bulb = new ImageView(ctx);
|
||||
@@ -56,7 +58,6 @@ class ContactListAdapter extends ArrayAdapter<ContactListItem> {
|
||||
name.setSingleLine();
|
||||
name.setEllipsize(END);
|
||||
name.setPadding(0, pad, pad, pad);
|
||||
int unread = item.getUnreadCount();
|
||||
String contactName = item.getContact().getAuthor().getName();
|
||||
if(unread > 0) name.setText(contactName + " (" + unread + ")");
|
||||
else name.setText(contactName);
|
||||
|
||||
@@ -138,7 +138,7 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
list.setClipToPadding(false);
|
||||
// Make the dividers the same colour as the background
|
||||
Resources res = getResources();
|
||||
int background = res.getColor(R.color.conversation_background);
|
||||
int background = res.getColor(R.color.window_background);
|
||||
list.setBackgroundColor(background);
|
||||
list.setDivider(new ColorDrawable(background));
|
||||
list.setDividerHeight(pad);
|
||||
@@ -158,7 +158,7 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
footer.setOrientation(HORIZONTAL);
|
||||
footer.setGravity(CENTER_VERTICAL);
|
||||
footer.setPadding(pad, 0, 0, 0);
|
||||
footer.setBackgroundColor(res.getColor(R.color.compose_background));
|
||||
footer.setBackgroundColor(res.getColor(R.color.button_bar_background));
|
||||
|
||||
content = new EditText(this);
|
||||
content.setId(1);
|
||||
|
||||
@@ -44,9 +44,7 @@ class ConversationAdapter extends ArrayAdapter<ConversationItem> {
|
||||
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);
|
||||
int background = res.getColor(R.color.private_message_background);
|
||||
|
||||
View content;
|
||||
if(item.getBody() == null) {
|
||||
|
||||
@@ -110,8 +110,6 @@ implements OnClickListener {
|
||||
|
||||
LinearLayout message = new LinearLayout(this);
|
||||
message.setOrientation(VERTICAL);
|
||||
Resources res = getResources();
|
||||
message.setBackgroundColor(res.getColor(R.color.content_background));
|
||||
|
||||
LinearLayout header = new LinearLayout(this);
|
||||
header.setLayoutParams(MATCH_WRAP);
|
||||
@@ -148,6 +146,8 @@ implements OnClickListener {
|
||||
footer.setLayoutParams(MATCH_WRAP);
|
||||
footer.setOrientation(HORIZONTAL);
|
||||
footer.setGravity(CENTER);
|
||||
Resources res = getResources();
|
||||
footer.setBackgroundColor(res.getColor(R.color.button_bar_background));
|
||||
|
||||
readButton = new ImageButton(this);
|
||||
readButton.setBackgroundResource(0);
|
||||
|
||||
Reference in New Issue
Block a user