aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2011-10-20 01:50:31 -0500
committerAndy Doan <andy.doan@linaro.org>2011-10-20 01:52:47 -0500
commita1a31c4a995837bb7c125b7a51812461d5c303c4 (patch)
tree4072246ca520b41fbd7882efe0aeea7937d975b7
parentf954772e9c44a599730350ec945aaa3e8490267d (diff)
downloadLinaroConnect-a1a31c4a995837bb7c125b7a51812461d5c303c4.tar.gz
fix selection issues in lists
The rounded background used requires us to use list selectors. The problem is that these don't play nicely with the gradient background we had (android requires a solid color and can't be tricked with transparent). This moves to a solid grey background and a selector. The postings view required a wrapper layout to put the selector on
-rw-r--r--res/drawable/connect_bg.jpgbin2346 -> 0 bytes
-rw-r--r--res/drawable/list_selector.xml5
-rw-r--r--res/layout/connect_item.xml4
-rw-r--r--res/layout/main.xml2
-rw-r--r--res/layout/posting_item.xml9
5 files changed, 17 insertions, 3 deletions
diff --git a/res/drawable/connect_bg.jpg b/res/drawable/connect_bg.jpg
deleted file mode 100644
index c1c3671..0000000
--- a/res/drawable/connect_bg.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable/list_selector.xml b/res/drawable/list_selector.xml
new file mode 100644
index 0000000..418e8eb
--- /dev/null
+++ b/res/drawable/list_selector.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true" android:drawable="@color/linaro_green" />
+ <item android:drawable="@color/main_bg" />
+</selector> \ No newline at end of file
diff --git a/res/layout/connect_item.xml b/res/layout/connect_item.xml
index 60f9622..c40755b 100644
--- a/res/layout/connect_item.xml
+++ b/res/layout/connect_item.xml
@@ -4,7 +4,9 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="40px"
- android:paddingRight="40px">
+ android:paddingRight="40px"
+ android:background="@drawable/list_selector"
+>
<TextView android:id="@+id/connect_item_label"
android:layout_height="wrap_content"
diff --git a/res/layout/main.xml b/res/layout/main.xml
index 3236254..3dbcaf1 100644
--- a/res/layout/main.xml
+++ b/res/layout/main.xml
@@ -3,7 +3,7 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
- android:background="@drawable/connect_bg">
+ android:background="@color/main_bg">
<ListView
android:layout_width="fill_parent"
diff --git a/res/layout/posting_item.xml b/res/layout/posting_item.xml
index b92a35f..557de56 100644
--- a/res/layout/posting_item.xml
+++ b/res/layout/posting_item.xml
@@ -3,6 +3,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
+ android:background="@drawable/list_selector">
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
android:background="@drawable/rounded">
<LinearLayout android:id="@+id/posting_authdate"
@@ -39,4 +45,5 @@
android:textSize="10sp"
android:textColor="@color/light_text"
/>
- </LinearLayout> \ No newline at end of file
+</LinearLayout>
+</LinearLayout> \ No newline at end of file