diff options
author | Andy Doan <andy.doan@linaro.org> | 2012-02-21 17:03:40 -0600 |
---|---|---|
committer | Andy Doan <andy.doan@linaro.org> | 2012-02-21 17:42:35 -0600 |
commit | 47dd1672acd9b0b5ec38adabb4939344d05558e5 (patch) | |
tree | 2a159032773d52599ac01a1dfbc81d97f8ae726e | |
parent | 61e2cc10e4ccf641b17c43ca83f1a6f53024908d (diff) | |
download | LinaroConnect-master.tar.gz |
This moves the styling of the GUI components into the
styles.xml file. This allows a more central place to be
able to update branding of the app from
-rw-r--r-- | AndroidManifest.xml | 2 | ||||
-rw-r--r-- | res/layout/connect_item.xml | 7 | ||||
-rw-r--r-- | res/layout/main.xml | 8 | ||||
-rw-r--r-- | res/layout/my_schedule_unconfigured.xml | 1 | ||||
-rw-r--r-- | res/layout/posting_item.xml | 25 | ||||
-rw-r--r-- | res/layout/schedule_item.xml | 16 | ||||
-rw-r--r-- | res/layout/schedule_item_activity.xml | 20 | ||||
-rw-r--r-- | res/values/styles.xml | 55 | ||||
-rw-r--r-- | res/values/themes.xml | 9 |
9 files changed, 84 insertions, 59 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1098d38..65b6787 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -6,7 +6,7 @@ <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.INTERNET"></uses-permission> - <application android:icon="@drawable/icon" android:label="@string/app_name"> + <application android:icon="@drawable/icon" android:label="@string/app_name" android:theme="@style/Linaro"> <activity android:name=".LinaroConnectActivity" android:label="@string/app_name"> <intent-filter> diff --git a/res/layout/connect_item.xml b/res/layout/connect_item.xml index 323a8d1..3050a74 100644 --- a/res/layout/connect_item.xml +++ b/res/layout/connect_item.xml @@ -11,11 +11,6 @@ <TextView android:id="@+id/connect_item_label" android:layout_height="wrap_content" android:layout_width="match_parent" - android:textStyle="bold" - android:background="@drawable/rounded" - android:textColor="@color/linaro_green" - android:gravity="center" - android:paddingTop="15dp" - android:paddingBottom="15dp" + style="@style/connect_item_text_view" /> </LinearLayout>
\ No newline at end of file diff --git a/res/layout/main.xml b/res/layout/main.xml index 3dbcaf1..b41ad96 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -3,13 +3,11 @@ android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@color/main_bg"> +> <ListView android:layout_width="fill_parent" - android:layout_height="wrap_content" + android:layout_height="wrap_content" android:id="@+id/connect_items" - android:paddingTop="10.0sp" - android:divider="@android:color/transparent" - android:dividerHeight="10.0sp"/> +/> </LinearLayout> diff --git a/res/layout/my_schedule_unconfigured.xml b/res/layout/my_schedule_unconfigured.xml index 047f633..afddcce 100644 --- a/res/layout/my_schedule_unconfigured.xml +++ b/res/layout/my_schedule_unconfigured.xml @@ -2,7 +2,6 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" - android:background="@color/main_bg" android:paddingLeft="5dp" > diff --git a/res/layout/posting_item.xml b/res/layout/posting_item.xml index 3372c44..d60d3da 100644 --- a/res/layout/posting_item.xml +++ b/res/layout/posting_item.xml @@ -3,13 +3,8 @@ 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"> + style="@style/posting_item" +> <LinearLayout android:id="@+id/posting_authdate" android:layout_height="wrap_content" @@ -19,31 +14,23 @@ <TextView android:id="@+id/posting_author" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:paddingLeft = "6dp" - android:textColor="@color/light_text" - android:textSize="8dp"/> + style="@style/item_info"/> <TextView android:id="@+id/posting_date" android:layout_height="wrap_content" android:layout_width="fill_parent" android:paddingRight="5dp" android:gravity="right" - android:textColor="@color/light_text" - android:textSize="8dp"/> + style="@style/item_info"/> </LinearLayout> <TextView android:id="@+id/posting_item_title" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingLeft = "6dp" - android:textColor="@color/linaro_green" - android:textSize="12dp" + style="@style/item_title" /> <TextView android:id="@+id/posting_item_summary" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingLeft = "12dp" - android:textSize="10dp" - android:textColor="@color/light_text" + style="@style/item_summary" /> -</LinearLayout> </LinearLayout>
\ No newline at end of file diff --git a/res/layout/schedule_item.xml b/res/layout/schedule_item.xml index 6f8ce25..8f4af03 100644 --- a/res/layout/schedule_item.xml +++ b/res/layout/schedule_item.xml @@ -3,27 +3,15 @@ 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"> <TextView android:id="@+id/schedule_summary" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingLeft = "6dp" - android:textColor="@color/linaro_green" - android:textSize="12dp" + style="@style/item_title" /> <TextView android:id="@+id/schedule_time" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingLeft = "12dp" - android:textSize="10dp" - android:textColor="@color/light_text" - /> -</LinearLayout> + style="@style/item_summary"/> </LinearLayout>
\ No newline at end of file diff --git a/res/layout/schedule_item_activity.xml b/res/layout/schedule_item_activity.xml index 6390f58..6793d11 100644 --- a/res/layout/schedule_item_activity.xml +++ b/res/layout/schedule_item_activity.xml @@ -6,7 +6,6 @@ android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:background="@color/main_bg" android:paddingLeft="5dp" > @@ -19,8 +18,7 @@ <TextView android:id="@+id/schedule_item_summary" android:layout_height="wrap_content" android:layout_width="match_parent" - android:textColor="@color/linaro_green" - android:textSize="12dp" + style="@style/schedule_activity_title" /> <LinearLayout @@ -31,36 +29,32 @@ <TextView android:id="@+id/schedule_item_room" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="10dp" + style="@style/schedule_activity_detail" /> <TextView android:id="@+id/schedule_item_time" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="right" - android:textSize="10dp" + style="@style/schedule_activity_detail" /> </LinearLayout> </LinearLayout> <TextView android:id="@+id/schedule_item_categories" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="10dp" + style="@style/schedule_activity_detail" /> <TextView android:id="@+id/schedule_item_desc" android:layout_height="wrap_content" android:layout_width="fill_parent" - android:textSize="10sp" - android:paddingLeft="10dp" - android:paddingRight="10dp" - android:background="@drawable/rounded" - android:textColor="@color/dark_text" + style="@style/schedule_activity_desc" /> <Button android:id="@+id/schedule_item_add" android:layout_height="wrap_content" android:layout_width="wrap_content" - android:textSize="10sp" android:layout_gravity="right" android:layout_marginTop="15dp" - android:text="@string/schedule_item_add"/> + android:text="@string/schedule_item_add" + style="@style/schedule_activity_addbtn"/> </LinearLayout> </ScrollView>
\ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml new file mode 100644 index 0000000..0c6b8a0 --- /dev/null +++ b/res/values/styles.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <style name="list_view"> + <item name="android:layout_width">fill_parent</item> + <item name="android:divider">@android:color/transparent</item> + <item name="android:dividerHeight">10.0sp</item> + <item name="android:paddingTop">10.0sp</item> + </style> + + <style name="connect_item_text_view"> + <item name="android:textStyle">bold</item> + <item name="android:background">@drawable/rounded</item> + <item name="android:textColor">@color/linaro_green</item> + <item name="android:gravity">center</item> + <item name="android:paddingTop">15dp</item> + <item name="android:paddingBottom">15dp</item> + </style> + + <style name="posting_item"> + <item name="android:background">@drawable/rounded</item> + </style> + <style name="item_title"> + <item name="android:paddingLeft">6dp</item> + <item name="android:textColor">@color/linaro_green</item> + <item name="android:textSize">12dp</item> + </style> + <style name="item_summary"> + <item name="android:paddingLeft">12dp</item> + <item name="android:textSize">10dp</item> + <item name="android:textColor">@color/light_text</item> + </style> + <style name="item_info"> + <item name="android:paddingLeft">6dp</item> + <item name="android:textColor">@color/light_text</item> + <item name="android:textSize">8dp</item> + </style> + + <style name="schedule_activity_title" parent="item_title"> + <item name="android:paddingLeft">0dp</item> + </style> + <style name="schedule_activity_detail"> + <item name="android:textSize">10dp</item> + </style> + <style name="schedule_activity_desc" parent="schedule_activity_detail"> + <item name="android:textColor">@color/dark_text</item> + <item name="android:paddingLeft">10dp</item> + <item name="android:paddingRight">10dp</item> + <item name="android:background">@drawable/rounded</item> + </style> + <style name="schedule_activity_addbtn"> + <item name="android:textSize">10dp</item> + </style> + +</resources>
\ No newline at end of file diff --git a/res/values/themes.xml b/res/values/themes.xml new file mode 100644 index 0000000..ba52053 --- /dev/null +++ b/res/values/themes.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + + <style name="Linaro" parent="android:Theme"> + <item name="android:background">@color/main_bg</item> + + <item name="android:listViewStyle">@style/list_view</item> + </style> +</resources>
\ No newline at end of file |