Brighter colours.

This commit is contained in:
akwizgran
2014-02-27 00:10:47 +00:00
parent d21ced30ba
commit 094cda8573
15 changed files with 47 additions and 36 deletions

View File

@@ -2,6 +2,7 @@
<resources>
<style name="LightTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarStyle">@style/CustomActionBar</item>
<item name="android:windowBackground">@color/window_background</item>
</style>
<style name="CustomActionBar"
parent="android:Widget.Holo.Light.ActionBar.Solid.Inverse">

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="window_background">#EEEEEE</color>
<color name="action_bar_background">#2D3E50</color>
<color name="home_screen_background">#FFFFFF</color>
<color name="content_background">#FFFFFF</color>
<color name="conversation_background">#DDDDDD</color>
<color name="button_bar_background">#FFFFFF</color>
<color name="private_message_background">#FFFFFF</color>
<color name="private_message_date">#AAAAAA</color>
<color name="unread_background">#FFFFFF</color>
<color name="read_background">#EEEEEE</color>
<color name="compose_background">#FFFFFF</color>
<color name="horizontal_border">#CCCCCC</color>
<color name="no_posts">#AAAAAA</color>
<color name="private_message_date">#AAAAAA</color>
</resources>

View File

@@ -26,6 +26,7 @@ import org.briarproject.api.db.DbException;
import org.briarproject.api.lifecycle.LifecycleManager;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
@@ -155,8 +156,8 @@ public class DashboardActivity extends BriarActivity {
grid.setLayoutParams(matchMatch);
grid.setGravity(CENTER);
grid.setPadding(pad, pad, pad, pad);
grid.setBackgroundColor(getResources().getColor(
R.color.home_screen_background));
Resources res = getResources();
grid.setBackgroundColor(res.getColor(R.color.button_bar_background));
grid.setNumColumns(2);
grid.setAdapter(new BaseAdapter() {

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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);

View File

@@ -1,5 +1,6 @@
package org.briarproject.android.groups;
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;
@@ -8,6 +9,7 @@ import static java.util.logging.Level.INFO;
import static java.util.logging.Level.WARNING;
import static org.briarproject.android.groups.ReadGroupPostActivity.RESULT_PREV_NEXT;
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.ArrayList;
@@ -42,6 +44,7 @@ import org.briarproject.api.messaging.GroupId;
import org.briarproject.api.messaging.MessageId;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
@@ -102,11 +105,17 @@ OnClickListener, OnItemClickListener {
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));
ImageButton composeButton = new ImageButton(this);
composeButton.setBackgroundResource(0);
composeButton.setImageResource(R.drawable.content_new_email);
composeButton.setOnClickListener(this);
layout.addView(composeButton);
footer.addView(composeButton);
layout.addView(footer);
setContentView(layout);
}

View File

@@ -45,10 +45,8 @@ class GroupAdapter extends ArrayAdapter<GroupItem> {
LinearLayout layout = new LinearLayout(ctx);
layout.setOrientation(VERTICAL);
layout.setGravity(CENTER_HORIZONTAL);
int background;
if(header.isRead()) background = res.getColor(R.color.read_background);
else background = res.getColor(R.color.unread_background);
layout.setBackgroundColor(background);
if(!header.isRead())
layout.setBackgroundColor(res.getColor(R.color.unread_background));
LinearLayout headerLayout = new LinearLayout(ctx);
headerLayout.setOrientation(HORIZONTAL);

View File

@@ -45,6 +45,7 @@ import org.briarproject.api.messaging.GroupId;
import org.briarproject.api.messaging.GroupStatus;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
@@ -100,6 +101,8 @@ implements EventListener, OnClickListener, OnItemClickListener {
footer.setLayoutParams(MATCH_WRAP);
footer.setOrientation(HORIZONTAL);
footer.setGravity(CENTER);
Resources res = getResources();
footer.setBackgroundColor(res.getColor(R.color.button_bar_background));
footer.addView(new ElasticHorizontalSpace(this));
newGroupButton = new ImageButton(this);

View File

@@ -76,7 +76,8 @@ class GroupListAdapter extends BaseAdapter {
LinearLayout layout = new LinearLayout(ctx);
layout.setOrientation(HORIZONTAL);
if(item.getUnreadCount() > 0)
int unread = item.getUnreadCount();
if(unread > 0)
layout.setBackgroundColor(res.getColor(R.color.unread_background));
TextView name = new TextView(ctx);
@@ -86,7 +87,6 @@ class GroupListAdapter extends BaseAdapter {
name.setSingleLine();
name.setEllipsize(END);
name.setPadding(pad, pad, pad, pad);
int unread = item.getUnreadCount();
String groupName = item.getGroup().getName();
if(unread > 0) name.setText(groupName + " (" + unread + ")");
else name.setText(groupName);

View File

@@ -107,8 +107,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);
@@ -145,6 +143,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);

View File

@@ -12,8 +12,7 @@ public class HorizontalBorder extends View {
public HorizontalBorder(Context ctx) {
super(ctx);
int width = LayoutUtils.getSeparatorWidth(ctx);
setLayoutParams(new LayoutParams(MATCH_PARENT, width));
setLayoutParams(new LayoutParams(MATCH_PARENT, 1));
setBackgroundColor(getResources().getColor(R.color.horizontal_border));
}
}

View File

@@ -7,12 +7,6 @@ import android.view.WindowManager;
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 - 8);
}
public static int getPadding(Context ctx) {
DisplayMetrics metrics = getDisplayMetrics(ctx);
int percent = Math.max(metrics.widthPixels, metrics.heightPixels) / 100;