summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--res/layout/feeditemlist_item.xml235
-rw-r--r--res/values/colors.xml2
-rw-r--r--src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java40
3 files changed, 160 insertions, 117 deletions
diff --git a/res/layout/feeditemlist_item.xml b/res/layout/feeditemlist_item.xml
index 1b9ebaaab..2cc7ee703 100644
--- a/res/layout/feeditemlist_item.xml
+++ b/res/layout/feeditemlist_item.xml
@@ -1,114 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="0dip"
android:layout_height="match_parent"
+ android:layout_weight="1"
android:paddingLeft="4dp" >
- <View
- android:id="@+id/vStatusLabel"
- android:layout_width="5dip"
- android:layout_height="match_parent"
- android:background="@color/status_unread"
- android:visibility="invisible" />
+ <TextView
+ android:id="@+id/txtvItemname"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="4dp"
+ android:layout_marginRight="4dp"
+ android:layout_marginTop="4dp"
+ android:layout_toLeftOf="@+id/butAction"
+ android:ellipsize="end"
+ android:maxLines="2"
+ android:textColor="?android:attr/textColorPrimary"
+ android:textSize="@dimen/text_size_medium" />
- <RelativeLayout
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:paddingLeft="4dp" >
+ <TextView
+ android:id="@+id/txtvFeedname"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/txtvItemname"
+ android:layout_marginBottom="4dp"
+ android:layout_toLeftOf="@id/butAction"
+ android:textColor="?android:attr/textColorSecondary"
+ android:textSize="@dimen/text_size_micro"
+ android:visibility="gone" />
- <TextView
- android:id="@+id/txtvItemname"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="4dp"
- android:layout_marginTop="4dp"
- android:maxLines="2"
- android:ellipsize="end"
- android:layout_toLeftOf="@+id/butAction"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="@dimen/text_size_medium" />
+ <TextView
+ android:id="@+id/txtvPublished"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/txtvFeedname"
+ android:layout_marginBottom="4dp"
+ android:layout_toLeftOf="@id/butAction"
+ android:textColor="?android:attr/textColorTertiary"
+ android:textSize="@dimen/text_size_micro" />
- <TextView
- android:id="@+id/txtvFeedname"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/txtvItemname"
- android:layout_marginBottom="4dp"
- android:layout_toLeftOf="@id/butAction"
- android:textColor="?android:attr/textColorSecondary"
- android:textSize="@dimen/text_size_micro"
- android:visibility="gone" />
+ <ImageView
+ android:id="@+id/imgvType"
+ android:layout_width="@dimen/enc_icons_size"
+ android:layout_height="@dimen/enc_icons_size"
+ android:layout_below="@id/txtvPublished"
+ android:layout_toLeftOf="@+id/imgvInPlaylist"
+ android:padding="2dp" />
- <TextView
- android:id="@+id/txtvPublished"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_below="@id/txtvFeedname"
- android:layout_marginBottom="4dp"
- android:layout_toLeftOf="@id/butAction"
- android:textColor="?android:attr/textColorTertiary"
- android:textSize="@dimen/text_size_micro" />
+ <ImageView
+ android:id="@id/imgvInPlaylist"
+ android:layout_width="@dimen/enc_icons_size"
+ android:layout_height="@dimen/enc_icons_size"
+ android:layout_below="@id/txtvPublished"
+ android:layout_toLeftOf="@+id/imgvDownloaded"
+ android:padding="2dp"
+ android:src="?attr/stat_playlist"
+ android:visibility="visible" />
- <ImageView
- android:id="@+id/imgvType"
- android:layout_width="@dimen/enc_icons_size"
- android:layout_height="@dimen/enc_icons_size"
- android:layout_below="@id/txtvPublished"
- android:layout_toLeftOf="@+id/imgvInPlaylist" />
+ <ImageView
+ android:id="@id/imgvDownloaded"
+ android:layout_width="@dimen/enc_icons_size"
+ android:layout_height="@dimen/enc_icons_size"
+ android:layout_below="@id/txtvPublished"
+ android:layout_toLeftOf="@+id/imgvDownloading"
+ android:padding="2dp"
+ android:src="?attr/av_download"
+ android:visibility="visible" />
- <ImageView
- android:id="@id/imgvInPlaylist"
- android:layout_width="@dimen/enc_icons_size"
- android:layout_height="@dimen/enc_icons_size"
- android:layout_below="@id/txtvPublished"
- android:layout_toLeftOf="@+id/imgvDownloaded"
- android:src="?attr/stat_playlist"
- android:visibility="visible" />
+ <ImageView
+ android:id="@id/imgvDownloading"
+ android:layout_width="@dimen/enc_icons_size"
+ android:layout_height="@dimen/enc_icons_size"
+ android:layout_below="@id/txtvPublished"
+ android:layout_toLeftOf="@id/butAction"
+ android:padding="2dp"
+ android:src="?attr/navigation_refresh"
+ android:visibility="visible" />
- <ImageView
- android:id="@id/imgvDownloaded"
- android:layout_width="@dimen/enc_icons_size"
- android:layout_height="@dimen/enc_icons_size"
- android:layout_below="@id/txtvPublished"
- android:layout_toLeftOf="@+id/imgvDownloading"
- android:src="?attr/av_download"
- android:visibility="visible" />
+ <TextView
+ android:id="@+id/txtvLenSize"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/txtvPublished"
+ android:maxLines="2"
+ android:textColor="?android:attr/textColorTertiary"
+ android:textSize="@dimen/text_size_micro" />
- <ImageView
- android:id="@id/imgvDownloading"
- android:layout_width="@dimen/enc_icons_size"
- android:layout_height="@dimen/enc_icons_size"
- android:layout_below="@id/txtvPublished"
- android:layout_toLeftOf="@id/butAction"
- android:src="?attr/navigation_refresh"
- android:visibility="visible" />
+ <ImageButton
+ android:id="@id/butAction"
+ android:layout_width="48dp"
+ android:layout_height="match_parent"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:background="?attr/borderless_button"
+ android:clickable="false"
+ android:focusable="false"
+ android:focusableInTouchMode="false"
+ android:paddingLeft="24dp"
+ android:paddingRight="8dp"
+ android:paddingTop="16dp"
+ android:scaleType="fitEnd"
+ android:src="?attr/spinner_button" />
+
+ <TextView
+ android:id="@+id/statusUnread"
+ android:layout_width="wrap_content"
+ android:layout_height="18dp"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:layout_margin="8dp"
+ android:background="@color/status_unread"
+ android:gravity="center"
+ android:minWidth="@dimen/status_indicator_width"
+ android:text="@string/new_label"
+ android:textAlignment="center"
+ android:textColor="@color/white"
+ android:textSize="@dimen/text_size_micro"
+ android:textStyle="bold" />
- <TextView
- android:id="@+id/txtvLenSize"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentLeft="true"
- android:layout_below="@id/txtvPublished"
- android:maxLines="2"
- android:textColor="?android:attr/textColorTertiary"
- android:textSize="@dimen/text_size_micro" />
+ <ImageView
+ android:id="@+id/statusPlaying"
+ android:layout_width="@dimen/status_indicator_width"
+ android:layout_height="18dp"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:layout_margin="8dp"
+ android:background="@color/status_playing"
+ android:gravity="center"
+ android:padding="2dp"
+ android:src="@drawable/av_play_dark" />
- <ImageButton
- android:id="@id/butAction"
- android:layout_width="48dp"
- android:layout_height="match_parent"
- android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true"
- android:background="?attr/borderless_button"
- android:clickable="false"
- android:focusable="false"
- android:focusableInTouchMode="false"
- android:paddingLeft="24dp"
- android:paddingRight="8dp"
- android:paddingTop="16dp"
- android:scaleType="fitEnd"
- android:src="?attr/spinner_button" />
- </RelativeLayout>
+ <TextView
+ android:id="@+id/statusInProgress"
+ android:layout_width="wrap_content"
+ android:layout_height="18dp"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentTop="true"
+ android:layout_margin="8dp"
+ android:background="@color/status_progress"
+ android:gravity="center"
+ android:minWidth="@dimen/status_indicator_width"
+ android:paddingLeft="2dp"
+ android:paddingRight="2dp"
+ android:textAlignment="center"
+ android:textColor="@color/white"
+ android:textSize="@dimen/text_size_micro"
+ android:textStyle="bold" />
-</LinearLayout> \ No newline at end of file
+</RelativeLayout> \ No newline at end of file
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 98aebe3b3..5cf84ec4a 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -25,7 +25,7 @@
<color name="download_failed_red">#CC0000</color>
<color name="status_unread">#E099CC00</color>
<color name="status_progress">#E033B5E5</color>
- <color name="status_playing">#EE5F52</color>
+ <color name="status_playing">#E0EE5F52</color>
<color name="overlay_dark">#262C31</color>
<color name="overlay_light">#DDDDDD</color>
diff --git a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
index 3ca63e97f..5941d52ea 100644
--- a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
+++ b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
@@ -68,8 +68,12 @@ public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter {
holder.feedtitle = (TextView) convertView
.findViewById(R.id.txtvFeedname);
}
- holder.statusLabel = (View) convertView
- .findViewById(R.id.vStatusLabel);
+ holder.statusPlaying = (View) convertView
+ .findViewById(R.id.statusPlaying);
+ holder.statusUnread = (View) convertView
+ .findViewById(R.id.statusUnread);
+ holder.statusInProgress = (TextView) convertView
+ .findViewById(R.id.statusInProgress);
convertView.setTag(holder);
} else {
@@ -93,26 +97,26 @@ public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter {
FeedItem.State state = item.getState();
switch (state) {
case PLAYING:
- holder.title.setTypeface(Typeface.DEFAULT_BOLD);
- holder.statusLabel.setBackgroundColor(convertView
- .getResources().getColor(R.color.status_playing));
- holder.statusLabel.setVisibility(View.VISIBLE);
+ holder.statusPlaying.setVisibility(View.VISIBLE);
+ holder.statusUnread.setVisibility(View.GONE);
+ holder.statusInProgress.setVisibility(View.GONE);
break;
case IN_PROGRESS:
- holder.title.setTypeface(Typeface.DEFAULT_BOLD);
- holder.statusLabel.setBackgroundColor(convertView
- .getResources().getColor(R.color.status_progress));
- holder.statusLabel.setVisibility(View.VISIBLE);
+ holder.statusPlaying.setVisibility(View.GONE);
+ holder.statusUnread.setVisibility(View.GONE);
+ holder.statusInProgress.setVisibility(View.VISIBLE);
+ holder.statusInProgress.setText(Converter
+ .getDurationStringLong(item.getMedia().getPosition()));
break;
case NEW:
- holder.title.setTypeface(Typeface.DEFAULT_BOLD);
- holder.statusLabel.setBackgroundColor(convertView
- .getResources().getColor(R.color.status_unread));
- holder.statusLabel.setVisibility(View.VISIBLE);
+ holder.statusPlaying.setVisibility(View.GONE);
+ holder.statusUnread.setVisibility(View.VISIBLE);
+ holder.statusInProgress.setVisibility(View.GONE);
break;
default:
- holder.title.setTypeface(Typeface.DEFAULT);
- holder.statusLabel.setVisibility(View.INVISIBLE);
+ holder.statusPlaying.setVisibility(View.GONE);
+ holder.statusUnread.setVisibility(View.GONE);
+ holder.statusInProgress.setVisibility(View.GONE);
break;
}
@@ -198,7 +202,9 @@ public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter {
ImageView type;
ImageView downloading;
ImageButton butAction;
- View statusLabel;
+ View statusUnread;
+ View statusPlaying;
+ TextView statusInProgress;
}
public int getSelectedItemIndex() {