diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index a2e1c64b70..8e49386ffd 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -36,6 +36,11 @@
+
+
+
+
+
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 79b9cc1726..4907910180 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -19,6 +19,11 @@
- #ff111111
- #33000000
+ - #ff000000
+ - #a0000000
+ - #ff64a926
+ - #99000000
+
- #ffdddddd
- #eeeeee
- @color/edit_text_light_theme
@@ -77,6 +82,11 @@
- #ffeeeeee
- #44eeeeee
+ - #ffdddddd
+ - #ffcccccc
+ - #ff64a926
+ - #11ffffff
+
- @drawable/conversation_item_received_shape_dark
- @drawable/conversation_item_received_triangle_shape_dark
- @drawable/conversation_item_sent_shape_dark
diff --git a/src/org/thoughtcrime/securesms/PushContactSelectionListFragment.java b/src/org/thoughtcrime/securesms/PushContactSelectionListFragment.java
index 62e624886a..2480358c44 100644
--- a/src/org/thoughtcrime/securesms/PushContactSelectionListFragment.java
+++ b/src/org/thoughtcrime/securesms/PushContactSelectionListFragment.java
@@ -20,6 +20,7 @@ package org.thoughtcrime.securesms;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.res.TypedArray;
import android.database.Cursor;
import android.database.MergeCursor;
import android.os.AsyncTask;
@@ -61,9 +62,15 @@ import java.util.List;
public class PushContactSelectionListFragment extends SherlockListFragment
implements LoaderManager.LoaderCallbacks
{
+ private final int STYLE_ATTRIBUTES[] = new int[]{R.attr.contact_selection_push_user,
+ R.attr.contact_selection_lay_user,
+ R.attr.contact_selection_push_label,
+ R.attr.contact_selection_lay_label};
private final HashMap selectedContacts = new HashMap();
private static LayoutInflater li;
+ private TypedArray drawables;
+
@Override
public void onActivityCreated(Bundle icicle) {
@@ -88,8 +95,12 @@ public class PushContactSelectionListFragment extends SherlockListFragment
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
- case R.id.menu_select_all: handleSelectAll(); return true;
- case R.id.menu_unselect_all: handleUnselectAll(); return true;
+ case R.id.menu_select_all:
+ handleSelectAll();
+ return true;
+ case R.id.menu_unselect_all:
+ handleUnselectAll();
+ return true;
}
super.onOptionsItemSelected(item);
@@ -105,7 +116,7 @@ public class PushContactSelectionListFragment extends SherlockListFragment
private void handleUnselectAll() {
selectedContacts.clear();
- ((CursorAdapter)getListView().getAdapter()).notifyDataSetChanged();
+ ((CursorAdapter) getListView().getAdapter()).notifyDataSetChanged();
}
private void handleSelectAll() {
@@ -119,16 +130,16 @@ public class PushContactSelectionListFragment extends SherlockListFragment
while (cursor != null && cursor.moveToNext()) {
ContactData contactData = ContactAccessor.getInstance().getContactData(getActivity(), cursor);
- if (contactData.numbers.isEmpty()) continue;
+ if (contactData.numbers.isEmpty()) continue;
else if (contactData.numbers.size() == 1) addSingleNumberContact(contactData);
- else addMultipleNumberContact(contactData, null, null);
+ else addMultipleNumberContact(contactData, null, null);
}
} finally {
if (cursor != null)
cursor.close();
}
- ((CursorAdapter)getListView().getAdapter()).notifyDataSetChanged();
+ ((CursorAdapter) getListView().getAdapter()).notifyDataSetChanged();
}
private void addSingleNumberContact(ContactData contactData) {
@@ -162,6 +173,7 @@ public class PushContactSelectionListFragment extends SherlockListFragment
private void initializeResources() {
this.getListView().setFocusable(true);
+ this.drawables = getActivity().obtainStyledAttributes(STYLE_ATTRIBUTES);
}
@Override
@@ -244,13 +256,13 @@ public class PushContactSelectionListFragment extends SherlockListFragment
this.pushSupport = pushContactData.pushSupport;
if (!pushSupport) {
- this.name.setTextColor(0xa0000000);
- this.number.setTextColor(0xa0000000);
- this.pushLabel.setBackgroundColor(0x99000000);
+ this.name.setTextColor(drawables.getColor(1, 0xff000000));
+ this.number.setTextColor(drawables.getColor(1, 0xff000000));
+ this.pushLabel.setBackgroundColor(drawables.getColor(3, 0x99000000));
} else {
- this.name.setTextColor(0xff000000);
- this.number.setTextColor(0xff000000);
- this.pushLabel.setBackgroundColor(0xff64a926);
+ this.name.setTextColor(drawables.getColor(0, 0xa0000000));
+ this.number.setTextColor(drawables.getColor(0, 0xa0000000));
+ this.pushLabel.setBackgroundColor(drawables.getColor(2, 0xff64a926));
}
if (selectedContacts.containsKey(contactData.id))
diff --git a/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java b/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java
index 7b374302d2..67fcccc939 100644
--- a/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java
+++ b/src/org/thoughtcrime/securesms/SingleContactSelectionListFragment.java
@@ -20,6 +20,7 @@ package org.thoughtcrime.securesms;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.res.TypedArray;
import android.database.Cursor;
import android.database.MergeCursor;
import android.os.Bundle;
@@ -55,11 +56,15 @@ import java.util.HashMap;
public class SingleContactSelectionListFragment extends SherlockListFragment
implements LoaderManager.LoaderCallbacks
{
- private final String TAG = SingleContactSelectionListFragment.class.getSimpleName();
+ private final String TAG = SingleContactSelectionListFragment.class.getSimpleName();
+ private final int STYLE_ATTRIBUTES[] = new int[]{R.attr.contact_selection_push_user,
+ R.attr.contact_selection_lay_user,
+ R.attr.contact_selection_push_label,
+ R.attr.contact_selection_lay_label};
- private final HashMap selectedContacts = new HashMap();
- private static LayoutInflater li;
- private OnContactSelectedListener onContactSelectedListener;
+ private static LayoutInflater li;
+ private OnContactSelectedListener onContactSelectedListener;
+ private TypedArray drawables;
@Override
public void onActivityCreated(Bundle icicle) {
@@ -86,7 +91,7 @@ public class SingleContactSelectionListFragment extends SherlockListFragment
private void addMultipleNumberContact(ContactData contactData, TextView textView) {
String[] options = new String[contactData.numbers.size()];
- int i = 0;
+ int i = 0;
for (NumberData option : contactData.numbers) {
options[i++] = option.type + " " + option.number;
@@ -108,6 +113,7 @@ public class SingleContactSelectionListFragment extends SherlockListFragment
private void initializeResources() {
this.getListView().setFocusable(true);
+ this.drawables = getActivity().obtainStyledAttributes(STYLE_ATTRIBUTES);
}
@Override
@@ -181,13 +187,13 @@ public class SingleContactSelectionListFragment extends SherlockListFragment
this.pushSupport = pushContactData.pushSupport;
if (!pushSupport) {
- this.name.setTextColor(0xa0000000);
- this.number.setTextColor(0xa0000000);
- this.pushLabel.setBackgroundColor(0x99000000);
+ this.name.setTextColor(drawables.getColor(1, 0xff000000));
+ this.number.setTextColor(drawables.getColor(1, 0xff000000));
+ this.pushLabel.setBackgroundColor(drawables.getColor(3, 0x99000000));
} else {
- this.name.setTextColor(0xff000000);
- this.number.setTextColor(0xff000000);
- this.pushLabel.setBackgroundColor(0xff64a926);
+ this.name.setTextColor(drawables.getColor(0, 0xa0000000));
+ this.number.setTextColor(drawables.getColor(0, 0xa0000000));
+ this.pushLabel.setBackgroundColor(drawables.getColor(2, 0xff64a926));
}
this.name.setText(contactData.name);