diff options
author | Wilhelm Fitzpatrick <rafial@cyngn.com> | 2014-09-18 19:50:28 -0700 |
---|---|---|
committer | linus_lee <llee@cyngn.com> | 2014-11-20 12:03:03 -0800 |
commit | 6998457ade55dfa358c0737ca7081c2837c08ea1 (patch) | |
tree | a6532c780053d411a35688a03bbbf07405f29494 | |
parent | e45f89f9521fb203474d85b8ee0675a6fbd4a91c (diff) | |
download | android_packages_apps_Eleven-6998457ade55dfa358c0737ca7081c2837c08ea1.tar.gz android_packages_apps_Eleven-6998457ade55dfa358c0737ca7081c2837c08ea1.tar.bz2 android_packages_apps_Eleven-6998457ade55dfa358c0737ca7081c2837c08ea1.zip |
Eleven: fix lists so padding/margins are inside the ListView
https://cyanogen.atlassian.net/browse/MUSIC-48
Change-Id: Iaea93f4d97ddb24cf61a5678802fc8bd453a4cd7
-rw-r--r-- | res/drawable/dnd_list_divider.xml | 26 | ||||
-rw-r--r-- | res/drawable/inset_list_divider.xml | 2 | ||||
-rw-r--r-- | res/layout/artist_detail_song.xml | 3 | ||||
-rw-r--r-- | res/layout/edit_queue_list_item.xml | 3 | ||||
-rw-r--r-- | res/layout/edit_track_list_item.xml | 21 | ||||
-rw-r--r-- | res/layout/list_base.xml | 8 | ||||
-rw-r--r-- | res/layout/list_base_nopadding.xml | 2 | ||||
-rw-r--r-- | res/layout/list_header.xml | 2 | ||||
-rw-r--r-- | res/layout/list_item_common.xml | 40 | ||||
-rw-r--r-- | res/layout/list_item_normal.xml | 41 |
10 files changed, 93 insertions, 55 deletions
diff --git a/res/drawable/dnd_list_divider.xml b/res/drawable/dnd_list_divider.xml new file mode 100644 index 0000000..ea3c262 --- /dev/null +++ b/res/drawable/dnd_list_divider.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Copyright (C) 2014 The CyanogenMod 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. +--> +<inset xmlns:android="http://schemas.android.com/apk/res/android" + android:insetLeft="@dimen/drag_and_drop_width" + android:insetRight="@dimen/list_preferred_item_padding" > + + <shape> + <solid android:color="@color/list_item_divider_color" /> + <corners android:radius="1.0dip" /> + </shape> + +</inset>
\ No newline at end of file diff --git a/res/drawable/inset_list_divider.xml b/res/drawable/inset_list_divider.xml index ea3c262..5bff56a 100644 --- a/res/drawable/inset_list_divider.xml +++ b/res/drawable/inset_list_divider.xml @@ -15,7 +15,7 @@ limitations under the License. --> <inset xmlns:android="http://schemas.android.com/apk/res/android" - android:insetLeft="@dimen/drag_and_drop_width" + android:insetLeft="@dimen/list_preferred_item_padding" android:insetRight="@dimen/list_preferred_item_padding" > <shape> diff --git a/res/layout/artist_detail_song.xml b/res/layout/artist_detail_song.xml index 4973ae3..bf71460 100644 --- a/res/layout/artist_detail_song.xml +++ b/res/layout/artist_detail_song.xml @@ -29,7 +29,8 @@ android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_toLeftOf="@id/overflow" - android:layout_toRightOf="@id/album_art" /> + android:layout_toRightOf="@id/album_art" + android:layout_marginTop="16dp" /> <TextView android:id="@+id/album" diff --git a/res/layout/edit_queue_list_item.xml b/res/layout/edit_queue_list_item.xml index 57603c6..599a6a2 100644 --- a/res/layout/edit_queue_list_item.xml +++ b/res/layout/edit_queue_list_item.xml @@ -17,7 +17,8 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/edit_track_list_parent" android:layout_width="match_parent" - android:layout_height="@dimen/item_normal_height" > + android:layout_height="@dimen/item_normal_height" + android:paddingRight="@dimen/list_preferred_item_padding" > <ImageView android:id="@+id/edit_track_list_item_handle" diff --git a/res/layout/edit_track_list_item.xml b/res/layout/edit_track_list_item.xml index 6612370..e3e907f 100644 --- a/res/layout/edit_track_list_item.xml +++ b/res/layout/edit_track_list_item.xml @@ -18,7 +18,7 @@ android:id="@+id/edit_track_list_parent" android:layout_width="match_parent" android:layout_height="@dimen/item_normal_height" - android:paddingRight="@dimen/list_preferred_item_padding"> + android:paddingRight="@dimen/list_preferred_item_padding" > <ImageView android:id="@+id/edit_track_list_item_handle" @@ -28,14 +28,17 @@ android:scaleType="fitXY" android:src="@drawable/gripper" /> - <FrameLayout - android:id="@+id/edit_track_list_container" - android:layout_width="match_parent" - android:layout_height="@dimen/item_normal_height" - android:layout_toRightOf="@+id/edit_track_list_item_handle" - android:gravity="center_vertical" > + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="@dimen/item_normal_height" + android:layout_toRightOf="@+id/edit_track_list_item_handle" + android:gravity="center_vertical" + android:minHeight="@dimen/item_normal_height" + android:paddingTop="@dimen/list_item_padding_top" + android:paddingBottom="@dimen/list_item_padding_bottom" > - <include layout="@layout/list_item_normal" /> - </FrameLayout> + <include layout="@layout/list_item_common" /> + + </RelativeLayout> </RelativeLayout>
\ No newline at end of file diff --git a/res/layout/list_base.xml b/res/layout/list_base.xml index 03e5e13..bb70e39 100644 --- a/res/layout/list_base.xml +++ b/res/layout/list_base.xml @@ -17,9 +17,7 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/list_base_container" android:layout_width="match_parent" - android:layout_height="match_parent" - android:paddingLeft="@dimen/list_preferred_item_padding" - android:paddingRight="@dimen/list_preferred_item_padding"> + android:layout_height="match_parent"> <include layout="@layout/no_results_message" /> @@ -31,5 +29,7 @@ android:cacheColorHint="@color/transparent" android:drawSelectorOnTop="false" android:fadingEdge="vertical" - android:fastScrollEnabled="true" /> + android:fastScrollEnabled="true" + android:dividerHeight="1dp" + android:divider="@drawable/inset_list_divider" /> </FrameLayout>
\ No newline at end of file diff --git a/res/layout/list_base_nopadding.xml b/res/layout/list_base_nopadding.xml index 37d49de..0ba5af1 100644 --- a/res/layout/list_base_nopadding.xml +++ b/res/layout/list_base_nopadding.xml @@ -31,5 +31,5 @@ android:fadingEdge="vertical" android:fastScrollEnabled="true" android:dividerHeight="1dp" - android:divider="@drawable/inset_list_divider"/> + android:divider="@drawable/dnd_list_divider"/> </FrameLayout>
\ No newline at end of file diff --git a/res/layout/list_header.xml b/res/layout/list_header.xml index aff83b4..085fa93 100644 --- a/res/layout/list_header.xml +++ b/res/layout/list_header.xml @@ -18,6 +18,8 @@ android:id="@+id/header" android:layout_width="match_parent" android:layout_height="@dimen/list_item_header_height" + android:paddingLeft="@dimen/list_preferred_item_padding" + android:paddingRight="@dimen/list_preferred_item_padding" android:background="@null" android:gravity="center_vertical" android:textColor="@color/list_item_header_text_color" diff --git a/res/layout/list_item_common.xml b/res/layout/list_item_common.xml new file mode 100644 index 0000000..6f025ce --- /dev/null +++ b/res/layout/list_item_common.xml @@ -0,0 +1,40 @@ +<merge xmlns:android="http://schemas.android.com/apk/res/android"> + <com.cyngn.eleven.widgets.SquareImageView + android:id="@+id/image" + android:layout_width="@dimen/list_item_image_width" + android:layout_height="@dimen/list_item_image_height" + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:scaleType="centerCrop" /> + + <RelativeLayout + android:layout_width="match_parent" + android:layout_height="@dimen/list_item_image_height" + android:layout_toRightOf="@+id/image" + android:layout_toLeftOf="@+id/line_one_right" + android:gravity="center_vertical" + android:minHeight="@dimen/item_normal_height" + android:paddingLeft="@dimen/list_preferred_item_padding" > + + <TextView + android:id="@+id/line_one" + style="@style/ListItemMainText.Single" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <TextView + android:id="@+id/line_two" + style="@style/ListItemSecondaryText.Single" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@+id/line_one" /> + </RelativeLayout> + + <TextView + android:id="@+id/line_one_right" + style="@style/ListItemSecondaryText.Single" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_centerVertical="true" /> +</merge>
\ No newline at end of file diff --git a/res/layout/list_item_normal.xml b/res/layout/list_item_normal.xml index a8acdff..4a2af51 100644 --- a/res/layout/list_item_normal.xml +++ b/res/layout/list_item_normal.xml @@ -22,45 +22,10 @@ android:minHeight="@dimen/item_normal_height" android:paddingTop="@dimen/list_item_padding_top" android:paddingBottom="@dimen/list_item_padding_bottom" + android:paddingLeft="@dimen/list_preferred_item_padding" + android:paddingRight="@dimen/list_preferred_item_padding" tools:ignore="ContentDescription" > - <com.cyngn.eleven.widgets.SquareImageView - android:id="@+id/image" - android:layout_width="@dimen/list_item_image_width" - android:layout_height="@dimen/list_item_image_height" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:scaleType="centerCrop" /> - - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="@dimen/list_item_image_height" - android:layout_toRightOf="@+id/image" - android:layout_toLeftOf="@+id/line_one_right" - android:gravity="center_vertical" - android:minHeight="@dimen/item_normal_height" - android:paddingLeft="@dimen/list_preferred_item_padding" > - - <TextView - android:id="@+id/line_one" - style="@style/ListItemMainText.Single" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> - - <TextView - android:id="@+id/line_two" - style="@style/ListItemSecondaryText.Single" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@+id/line_one" /> - </RelativeLayout> - - <TextView - android:id="@+id/line_one_right" - style="@style/ListItemSecondaryText.Single" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_centerVertical="true" /> + <include layout="@layout/list_item_common" /> </RelativeLayout>
\ No newline at end of file |