diff options
26 files changed, 34 insertions, 155 deletions
diff --git a/res/drawable-hdpi/list_activated_holo.9.png b/res/drawable-hdpi/list_activated_holo.9.png Binary files differdeleted file mode 100644 index 2d0348653..000000000 --- a/res/drawable-hdpi/list_activated_holo.9.png +++ /dev/null diff --git a/res/drawable-hdpi/list_checked_holo.9.png b/res/drawable-hdpi/list_checked_holo.9.png Binary files differdeleted file mode 100644 index 705f97c1e..000000000 --- a/res/drawable-hdpi/list_checked_holo.9.png +++ /dev/null diff --git a/res/drawable-mdpi/list_activated_holo.9.png b/res/drawable-mdpi/list_activated_holo.9.png Binary files differdeleted file mode 100644 index c253d9415..000000000 --- a/res/drawable-mdpi/list_activated_holo.9.png +++ /dev/null diff --git a/res/drawable-mdpi/list_checked_holo.9.png b/res/drawable-mdpi/list_checked_holo.9.png Binary files differdeleted file mode 100644 index 63c7a63e7..000000000 --- a/res/drawable-mdpi/list_checked_holo.9.png +++ /dev/null diff --git a/res/drawable-v19/conversation_unread_selector.xml b/res/drawable-v19/conversation_unread_selector.xml deleted file mode 100644 index a454f8a62..000000000 --- a/res/drawable-v19/conversation_unread_selector.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2011 Google Inc. - Licensed to The Android Open Source Project. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/list_pressed_holo" /> - <item android:state_selected="true" - android:drawable="@drawable/list_checked_holo" /> - <item android:state_activated="true" - android:drawable="@drawable/list_activated_holo" /> - <item android:state_focused="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:drawable="@drawable/list_unread_holo" /> -</selector> diff --git a/res/drawable-xhdpi/list_activated_holo.9.png b/res/drawable-xhdpi/list_activated_holo.9.png Binary files differdeleted file mode 100644 index c67e6759d..000000000 --- a/res/drawable-xhdpi/list_activated_holo.9.png +++ /dev/null diff --git a/res/drawable-xhdpi/list_checked_holo.9.png b/res/drawable-xhdpi/list_checked_holo.9.png Binary files differdeleted file mode 100644 index 455bf2a18..000000000 --- a/res/drawable-xhdpi/list_checked_holo.9.png +++ /dev/null diff --git a/res/drawable-xxhdpi/list_activated_holo.9.png b/res/drawable-xxhdpi/list_activated_holo.9.png Binary files differdeleted file mode 100644 index 40cdfd682..000000000 --- a/res/drawable-xxhdpi/list_activated_holo.9.png +++ /dev/null diff --git a/res/drawable-xxhdpi/list_checked_holo.9.png b/res/drawable-xxhdpi/list_checked_holo.9.png Binary files differdeleted file mode 100644 index 615e8c081..000000000 --- a/res/drawable-xxhdpi/list_checked_holo.9.png +++ /dev/null diff --git a/res/drawable-v19/conversation_read_selector.xml b/res/drawable/conversation_item_background_selector.xml index 3fcf5e63d..2765ae535 100644 --- a/res/drawable-v19/conversation_read_selector.xml +++ b/res/drawable/conversation_item_background_selector.xml @@ -17,12 +17,12 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" - android:drawable="@drawable/list_pressed_holo" /> + android:drawable="@color/conversation_item_blue_background" /> <item android:state_selected="true" - android:drawable="@drawable/list_checked_holo" /> + android:drawable="@color/conversation_item_blue_background" /> <item android:state_activated="true" - android:drawable="@drawable/list_activated_holo" /> + android:drawable="@color/conversation_item_blue_background" /> <item android:state_focused="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:drawable="@drawable/list_read_holo" /> + android:drawable="@android:color/white" /> + <item android:drawable="@android:color/white" /> </selector> diff --git a/res/drawable/conversation_read_selector.xml b/res/drawable/conversation_read_selector.xml deleted file mode 100644 index a1ca64a30..000000000 --- a/res/drawable/conversation_read_selector.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2011 Google Inc. - Licensed to The Android Open Source Project. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/list_activated_holo" /> - <item android:state_selected="true" - android:drawable="@drawable/list_checked_holo" /> - <item android:state_activated="true" - android:drawable="@drawable/list_activated_holo" /> - <item android:state_focused="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:drawable="@drawable/list_read_holo" /> -</selector> diff --git a/res/drawable/conversation_unread_selector.xml b/res/drawable/conversation_unread_selector.xml deleted file mode 100644 index e69b57c4e..000000000 --- a/res/drawable/conversation_unread_selector.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2011 Google Inc. - Licensed to The Android Open Source Project. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/list_activated_holo" /> - <item android:state_selected="true" - android:drawable="@drawable/list_checked_holo" /> - <item android:state_activated="true" - android:drawable="@drawable/list_activated_holo" /> - <item android:state_focused="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:drawable="@drawable/list_unread_holo" /> -</selector> diff --git a/res/drawable/widget_conversation_read_selector.xml b/res/drawable/widget_conversation_read_selector.xml deleted file mode 100644 index 78eb9c7b8..000000000 --- a/res/drawable/widget_conversation_read_selector.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 Google Inc. - Licensed to The Android Open Source Project. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/list_pressed_holo" /> - <item android:state_focused="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:state_selected="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:drawable="@drawable/list_read_holo" /> -</selector> diff --git a/res/drawable/widget_conversation_unread_selector.xml b/res/drawable/widget_conversation_unread_selector.xml deleted file mode 100644 index 56f4d16cc..000000000 --- a/res/drawable/widget_conversation_unread_selector.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2012 Google Inc. - Licensed to The Android Open Source Project. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" - android:drawable="@drawable/list_pressed_holo" /> - <item android:state_focused="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:state_selected="true" - android:drawable="@drawable/list_focused_holo" /> - <item android:drawable="@drawable/list_unread_holo" /> -</selector> diff --git a/res/layout/conversation_long_press_to_select_tip_view.xml b/res/layout/conversation_long_press_to_select_tip_view.xml index 4ee8fc603..59b17ff12 100644 --- a/res/layout/conversation_long_press_to_select_tip_view.xml +++ b/res/layout/conversation_long_press_to_select_tip_view.xml @@ -10,7 +10,7 @@ android:id="@+id/swipeable_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/conversation_read_selector" + android:background="@drawable/conversation_item_background_selector" android:orientation="horizontal" > <TextView diff --git a/res/layout/conversation_outbox_tip_view.xml b/res/layout/conversation_outbox_tip_view.xml index 8e66409f6..6277c300f 100644 --- a/res/layout/conversation_outbox_tip_view.xml +++ b/res/layout/conversation_outbox_tip_view.xml @@ -10,7 +10,7 @@ android:id="@+id/swipeable_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/conversation_read_selector" + android:background="@drawable/conversation_item_background_selector" android:orientation="horizontal" > <TextView diff --git a/res/layout/conversation_photo_teaser_view.xml b/res/layout/conversation_photo_teaser_view.xml index 0a38aba87..6aac4d8a4 100644 --- a/res/layout/conversation_photo_teaser_view.xml +++ b/res/layout/conversation_photo_teaser_view.xml @@ -10,7 +10,7 @@ android:id="@+id/swipeable_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/conversation_read_selector" + android:background="@drawable/conversation_item_background_selector" android:orientation="horizontal" > <ImageView diff --git a/res/layout/conversation_sync_disabled_tip_view.xml b/res/layout/conversation_sync_disabled_tip_view.xml index 02de42cce..1ed63a739 100644 --- a/res/layout/conversation_sync_disabled_tip_view.xml +++ b/res/layout/conversation_sync_disabled_tip_view.xml @@ -10,7 +10,7 @@ android:id="@+id/swipeable_content" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@drawable/conversation_read_selector" + android:background="@drawable/conversation_item_background_selector" android:orientation="horizontal" > <LinearLayout diff --git a/res/layout/nested_folder_teaser_view.xml b/res/layout/nested_folder_teaser_view.xml index c85ed0a05..9e71f61c0 100644 --- a/res/layout/nested_folder_teaser_view.xml +++ b/res/layout/nested_folder_teaser_view.xml @@ -24,7 +24,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:background="@drawable/conversation_unread_selector" + android:background="@drawable/conversation_item_background_selector" android:orientation="vertical" > <LinearLayout diff --git a/res/layout/widget_conversation_list_item.xml b/res/layout/widget_conversation_list_item.xml index 8d6cbb239..92ebe50bf 100644 --- a/res/layout/widget_conversation_list_item.xml +++ b/res/layout/widget_conversation_list_item.xml @@ -29,12 +29,12 @@ android:id="@+id/widget_unread_background" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/widget_conversation_unread_selector" /> + android:background="@drawable/conversation_item_background_selector" /> <ImageView android:id="@+id/widget_read_background" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/widget_conversation_read_selector" /> + android:background="@drawable/conversation_item_background_selector" /> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" diff --git a/res/layout/widget_loading.xml b/res/layout/widget_loading.xml index c0f03e384..0d116a2f7 100644 --- a/res/layout/widget_loading.xml +++ b/res/layout/widget_loading.xml @@ -20,7 +20,7 @@ android:id="@+id/widget_loading" android:layout_width="match_parent" android:layout_height="64sp" - android:background="@drawable/conversation_read_selector"> + android:background="@drawable/conversation_item_background_selector"> <TextView android:id="@+id/loading_text" android:layout_height="match_parent" diff --git a/res/values/colors.xml b/res/values/colors.xml index 19a389503..87b4542fa 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -176,4 +176,7 @@ <color name="snack_bar_background_color">#323232</color> <color name="snack_bar_action_text_color">#f4b400</color> + + <color name="conversation_item_blue_background">#e5f8fb</color> + <color name="conversation_list_divider_color">#b2b2b2</color> </resources> diff --git a/res/values/dimen.xml b/res/values/dimen.xml index 8e6baccff..63f5aafa5 100644 --- a/res/values/dimen.xml +++ b/res/values/dimen.xml @@ -170,6 +170,7 @@ <dimen name="conv_list_wide_personal_indicator_padding_end">8dip</dimen> <dimen name="conv_list_wide_star_padding_start">32dip</dimen> <dimen name="conv_list_wide_color_block_padding_end">64dip</dimen> + <dimen name="conv_list_divider_inset">72dp</dimen> <dimen name="conv_list_spacious_padding_start">22dip</dimen> <dimen name="conv_list_spacious_padding_end">16dip</dimen> diff --git a/res/values/styles.xml b/res/values/styles.xml index 590038f3f..dbc863d08 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -226,8 +226,7 @@ <!-- Browse list item styles --> <style name="ConversationListFadeBase" parent="android:Widget.Holo.Light.ListView" /> <style name="ConversationListFade" parent="@style/ConversationListFadeBase"> - <item name="android:divider">@android:color/transparent</item> - <item name="android:dividerHeight">0dip</item> + <item name="android:divider">@null</item> </style> <!-- End browse list item styles --> diff --git a/src/com/android/mail/browse/ConversationItemView.java b/src/com/android/mail/browse/ConversationItemView.java index 82cc8616e..1381d948b 100644 --- a/src/com/android/mail/browse/ConversationItemView.java +++ b/src/com/android/mail/browse/ConversationItemView.java @@ -148,11 +148,16 @@ public class ConversationItemView extends View private static int sBadgePaddingExtraWidth; private static int sBadgeRoundedCornerRadius; private static int sFolderRoundedCornerRadius; + private static int sDividerColor; // Static paints. private static final TextPaint sPaint = new TextPaint(); private static final TextPaint sFoldersPaint = new TextPaint(); private static final Paint sCheckBackgroundPaint = new Paint(); + private static final Paint sDividerPaint = new Paint(); + + private static int sDividerInset; + private static int sDividerHeight; private static BroadcastReceiver sConfigurationChangedReceiver; @@ -481,6 +486,9 @@ public class ConversationItemView extends View res.getDimensionPixelSize(R.dimen.badge_rounded_corner_radius); sFolderRoundedCornerRadius = res.getDimensionPixelOffset(R.dimen.folder_rounded_corner_radius); + sDividerColor = res.getColor(R.color.conversation_list_divider_color); + sDividerInset = res.getDimensionPixelSize(R.dimen.conv_list_divider_inset); + sDividerHeight = res.getDimensionPixelSize(R.dimen.divider_height); } } @@ -1302,6 +1310,12 @@ public class ConversationItemView extends View VISIBLE_CONVERSATION_HIGHLIGHT.draw(canvas); } } + + // draw the inset divider + sDividerPaint.setColor(sDividerColor); + final int dividerBottomY = getHeight(); + final int dividerTopY = dividerBottomY - sDividerHeight; + canvas.drawRect(sDividerInset, dividerTopY, getWidth(), dividerBottomY, sDividerPaint); Utils.traceEndSection(); } @@ -1357,10 +1371,8 @@ public class ConversationItemView extends View final int background; if (mBackgroundOverrideResId > 0) { background = mBackgroundOverrideResId; - } else if (mHeader.unread) { - background = R.drawable.conversation_unread_selector; } else { - background = R.drawable.conversation_read_selector; + background = R.drawable.conversation_item_background_selector; } setBackgroundResource(background); } diff --git a/src/com/android/mail/browse/ConversationListFooterView.java b/src/com/android/mail/browse/ConversationListFooterView.java index 38ae225b9..53ec81c3d 100644 --- a/src/com/android/mail/browse/ConversationListFooterView.java +++ b/src/com/android/mail/browse/ConversationListFooterView.java @@ -200,7 +200,7 @@ public final class ConversationListFooterView extends LinearLayout implements Vi private Drawable getNormalBackground() { if (sNormalBackground == null) { - sNormalBackground = getBackground(R.drawable.conversation_unread_selector); + sNormalBackground = getBackground(R.drawable.conversation_item_background_selector); } return sNormalBackground; } |