diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2016-01-24 18:32:37 -0500 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2016-01-24 18:32:37 -0500 |
commit | 0eefa8c5412bf15c00fd83f318629377b4805c20 (patch) | |
tree | 2209e743a085de53ae6829bb4436210aa1842681 /app/src/main/res | |
parent | b0f65e1b64a6226de53cec2ad110b4f2cd0c2d92 (diff) | |
parent | 5a077774fcfeb89fc3eac6993c4320d81c5ed157 (diff) | |
download | AntennaPod-0eefa8c5412bf15c00fd83f318629377b4805c20.zip |
Merge pull request #1576 from mfietz/issue/1553-itunes-search
iTunes Search improvement
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/fragment_itunes_search.xml | 86 | ||||
-rw-r--r-- | app/src/main/res/layout/gpodnet_podcast_listitem.xml | 20 | ||||
-rw-r--r-- | app/src/main/res/layout/itunes_podcast_listitem.xml | 86 | ||||
-rw-r--r-- | app/src/main/res/menu/itunes_search.xml | 13 |
4 files changed, 137 insertions, 68 deletions
diff --git a/app/src/main/res/layout/fragment_itunes_search.xml b/app/src/main/res/layout/fragment_itunes_search.xml index e57c59554..0cc13f74c 100644 --- a/app/src/main/res/layout/fragment_itunes_search.xml +++ b/app/src/main/res/layout/fragment_itunes_search.xml @@ -1,26 +1,64 @@ -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" -xmlns:tools="http://schemas.android.com/tools" -android:layout_width="match_parent" -android:layout_height="match_parent" -tools:context="de.danoeh.antennapod.activity.ITunesSearchActivity"> -<android.support.v7.widget.SearchView - android:id="@+id/itunes_search_view" - android:layout_height="wrap_content" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - /> -<GridView - android:id="@+id/gridView" - android:layout_below="@id/itunes_search_view" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:clipToPadding="false" - android:columnWidth="400dp" - android:gravity="center" - android:horizontalSpacing="8dp" - android:numColumns="auto_fit" - android:paddingBottom="@dimen/list_vertical_padding" - android:paddingTop="@dimen/list_vertical_padding" - android:stretchMode="columnWidth" - android:verticalSpacing="8dp" - tools:listitem="@layout/gpodnet_podcast_listitem" /> + android:layout_height="match_parent"> + + <GridView + android:id="@+id/gridView" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:clipToPadding="false" + android:columnWidth="400dp" + android:gravity="center" + android:horizontalSpacing="8dp" + android:numColumns="auto_fit" + android:paddingBottom="@dimen/list_vertical_padding" + android:paddingTop="@dimen/list_vertical_padding" + android:stretchMode="columnWidth" + android:verticalSpacing="8dp" + tools:listitem="@layout/gpodnet_podcast_listitem" /> + + <TextView + android:id="@id/android:empty" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_centerInParent="true" + android:gravity="center" + android:visibility="gone" + android:text="@string/search_status_no_results" /> + + <ProgressBar + android:id="@+id/progressBar" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:indeterminateOnly="true" + android:visibility="gone"/> + + <TextView + android:id="@+id/txtvError" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerInParent="true" + android:layout_margin="16dp" + android:textAlignment="center" + android:textSize="@dimen/text_size_small" + android:visibility="gone" + tools:visibility="visible" + tools:text="Error message" + tools:background="@android:color/holo_red_light" /> + + <Button + android:id="@+id/butRetry" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@id/txtvError" + android:layout_centerHorizontal="true" + android:layout_margin="16dp" + android:text="@string/retry_label" + android:visibility="gone" + tools:visibility="visible" + tools:background="@android:color/holo_red_light" /> + </RelativeLayout> diff --git a/app/src/main/res/layout/gpodnet_podcast_listitem.xml b/app/src/main/res/layout/gpodnet_podcast_listitem.xml index 84c6c280e..bbe8e65d6 100644 --- a/app/src/main/res/layout/gpodnet_podcast_listitem.xml +++ b/app/src/main/res/layout/gpodnet_podcast_listitem.xml @@ -3,7 +3,11 @@ <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="@dimen/listitem_threeline_height" + android:layout_height="wrap_content" + android:paddingTop="8dp" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:paddingBottom="8dp" tools:background="@android:color/darker_gray"> <ImageView @@ -11,11 +15,8 @@ android:layout_width="@dimen/thumbnail_length_itemlist" android:layout_height="@dimen/thumbnail_length_itemlist" android:layout_alignParentLeft="true" - android:layout_centerVertical="true" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" + android:layout_alignParentTop="true" android:layout_marginRight="8dp" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" android:adjustViewBounds="true" android:contentDescription="@string/cover_label" android:cropToPadding="true" @@ -29,7 +30,6 @@ android:layout_height="wrap_content" android:layout_alignTop="@id/txtvTitle" android:layout_alignParentRight="true" - android:layout_marginRight="@dimen/listitem_threeline_horizontalpadding" android:orientation="horizontal"> <ImageView @@ -52,15 +52,14 @@ <TextView android:id="@+id/txtvTitle" - style="@style/AntennaPod.TextView.ListItemPrimaryTitle" + style="@style/AntennaPod.TextView.ListItemPrimaryTitle2" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="@dimen/list_vertical_padding" - android:layout_marginRight="@dimen/listitem_threeline_horizontalpadding" android:layout_toRightOf="@id/imgvCover" android:layout_toLeftOf="@id/subscribers_container" android:layout_alignTop="@id/imgvCover" - android:lines="1" + android:maxLines="2" + android:includeFontPadding="false" tools:text="Title" tools:background="@android:color/holo_green_dark" /> @@ -69,7 +68,6 @@ style="android:style/TextAppearance.Small" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginRight="@dimen/listitem_threeline_horizontalpadding" android:layout_toRightOf="@id/imgvCover" android:layout_below="@id/txtvTitle" android:textSize="14sp" diff --git a/app/src/main/res/layout/itunes_podcast_listitem.xml b/app/src/main/res/layout/itunes_podcast_listitem.xml index 41b1f495f..1e6e5a836 100644 --- a/app/src/main/res/layout/itunes_podcast_listitem.xml +++ b/app/src/main/res/layout/itunes_podcast_listitem.xml @@ -1,38 +1,58 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" -xmlns:tools="http://schemas.android.com/tools" -android:layout_width="match_parent" -android:layout_height="@dimen/listitem_threeline_height" -tools:background="@android:color/darker_gray"> - -<ImageView - android:id="@+id/imgvCover" - android:layout_width="@dimen/thumbnail_length_itemlist" - android:layout_height="@dimen/thumbnail_length_itemlist" - android:layout_alignParentLeft="true" - android:layout_centerVertical="true" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" - android:layout_marginRight="8dp" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" - android:adjustViewBounds="true" - android:contentDescription="@string/cover_label" - android:cropToPadding="true" - android:scaleType="fitXY" - tools:src="@drawable/ic_stat_antenna_default" - tools:background="@android:color/holo_green_dark" /> - -<TextView - android:id="@+id/txtvTitle" - style="@style/AntennaPod.TextView.ListItemPrimaryTitle" +<RelativeLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - android:layout_marginRight="@dimen/listitem_threeline_horizontalpadding" - android:layout_toRightOf="@id/imgvCover" - android:maxLines="1" - tools:text="Podcast title" - tools:background="@android:color/holo_green_dark" /> + android:paddingTop="8dp" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:paddingBottom="8dp" + tools:background="@android:color/darker_gray"> + + <ImageView + android:id="@+id/imgvCover" + android:layout_width="@dimen/thumbnail_length_itemlist" + android:layout_height="@dimen/thumbnail_length_itemlist" + android:layout_alignParentLeft="true" + android:layout_alignParentTop="true" + android:layout_marginRight="8dp" + android:adjustViewBounds="true" + android:contentDescription="@string/cover_label" + android:cropToPadding="true" + android:scaleType="fitXY" + tools:background="@android:color/holo_green_dark" + tools:src="@drawable/ic_stat_antenna_default" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_toRightOf="@id/imgvCover" + android:layout_centerVertical="true" + android:orientation="vertical"> + + <TextView + android:id="@+id/txtvTitle" + style="@style/AntennaPod.TextView.ListItemPrimaryTitle2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:maxLines="2" + tools:background="@android:color/holo_green_dark" + tools:text="Podcast title" /> + + <TextView + android:id="@+id/txtvUrl" + style="android:style/TextAppearance.Small" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textSize="14sp" + android:textColor="?android:attr/textColorSecondary" + android:ellipsize="middle" + android:maxLines="2" + tools:text="http://www.example.com/feed" + tools:background="@android:color/holo_green_dark"/> + + </LinearLayout> + </RelativeLayout> diff --git a/app/src/main/res/menu/itunes_search.xml b/app/src/main/res/menu/itunes_search.xml new file mode 100644 index 000000000..88fa36a4a --- /dev/null +++ b/app/src/main/res/menu/itunes_search.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> + +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:custom="http://schemas.android.com/apk/res-auto"> + + <item + android:id="@+id/action_search" + android:icon="?attr/action_search" + custom:showAsAction="collapseActionView|ifRoom" + custom:actionViewClass="android.support.v7.widget.SearchView" + android:title="@string/search_label"/> + +</menu> |