Added 'new' indicator to all episodes view + layout improvements

This commit is contained in:
daniel oeh 2014-06-07 13:17:25 +02:00
parent 2629c9ee22
commit d058b47460
7 changed files with 47 additions and 41 deletions

View File

@ -18,7 +18,6 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="4dp"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>
@ -28,7 +27,6 @@
android:layout_height="wrap_content"
android:layout_below="@id/txtvPublished"
android:layout_marginBottom="8dp"
android:layout_marginRight="4dp"
style="@style/AntennaPod.TextView.ListItemPrimaryTitle"/>
@ -59,7 +57,6 @@
android:layout_alignParentLeft="true"
android:layout_below="@id/txtvItemname"
android:maxLines="2"
android:layout_marginBottom="2dp"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>
@ -77,22 +74,11 @@
<TextView
android:id="@+id/statusUnread"
android:contentDescription="@string/status_unread_label"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_height="wrap_content"
style="@style/AntennaPod.TextView.UnreadIndicator"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="8dp"
android:layout_marginBottom="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"/>
android:layout_alignParentTop="true"/>
</RelativeLayout>
<View

View File

@ -6,29 +6,25 @@
android:orientation="horizontal"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginRight="8dp">
<ImageView
android:id="@+id/imgvImage"
android:contentDescription="@string/cover_label"
android:layout_width="@dimen/thumbnail_length_itemlist"
android:layout_height="@dimen/thumbnail_length_itemlist"
android:layout_alignParentLeft="true"
android:scaleType="centerCrop"/>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="4dp">
<TextView
android:id="@+id/txtvPublished"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="4dp"
android:layout_alignParentTop="true"
android:layout_toRightOf="@id/imgvImage"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:maxLines="1"
@ -40,18 +36,24 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_below="@id/txtvPublished"
android:layout_marginLeft="8dp"
android:layout_marginTop="2dp"
android:layout_toRightOf="@id/imgvImage"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
style="@style/AntennaPod.TextView.ListItemPrimaryTitle"/>
<TextView
android:id="@+id/statusUnread"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
style="@style/AntennaPod.TextView.UnreadIndicator"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/imgvImage"
android:layout_alignParentLeft="true"
android:orientation="vertical">
<RelativeLayout
@ -74,7 +76,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/imgvInPlaylist"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentLeft="true"/>
@ -83,8 +84,6 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/imgvInPlaylist"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_alignParentLeft="true"
android:textColor="?android:attr/textColorTertiary"
android:textSize="@dimen/text_size_micro"/>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AntennaPod.TextView.UnreadIndicator" parent="@android:style/TextAppearance.Small">
<item name="android:textSize">@dimen/text_size_micro</item>
<item name="android:textColor">@color/new_indicator_green</item>
<item name="android:text">@string/new_label</item>
<item name="android:textAllCaps">true</item>
</style>
</resources>

View File

@ -9,14 +9,13 @@
<color name="actionbar_gray">#DDDDDD</color>
<color name="download_success_green">#669900</color>
<color name="download_failed_red">#CC0000</color>
<color name="status_unread">#E099CC00</color>
<color name="status_progress">#E033B5E5</color>
<color name="status_playing">#E0EE5F52</color>
<color name="overlay_dark">#262C31</color>
<color name="overlay_light">#DDDDDD</color>
<color name="swipe_refresh_secondary_color_light">#EDEDED</color>
<color name="swipe_refresh_secondary_color_dark">#060708</color>
<color name="new_indicator_green">#669900</color>
<!-- Use Gingerbread-orange -->
<color name="selection_background_color_dark">#FEBB20</color>

View File

@ -11,7 +11,7 @@
<dimen name="text_size_medium">18sp</dimen>
<dimen name="text_size_large">22sp</dimen>
<dimen name="status_indicator_width">32dp</dimen>
<dimen name="thumbnail_length_itemlist">80dp</dimen>
<dimen name="thumbnail_length_itemlist">85dp</dimen>
<dimen name="thumbnail_length_queue_item">70dp</dimen>
<dimen name="thumbnail_length_downloaded_item">70dp</dimen>
<dimen name="thumbnail_length_onlinefeedview">110dp</dimen>

View File

@ -127,7 +127,7 @@
</style>
<style name="AntennaPod.TextView.ListItemPrimaryTitle" parent="@android:style/TextAppearance.Small">
<item name="android:textSize">15sp</item>
<item name="android:textSize">14sp</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:lines">2</item>
<item name="android:ellipsize">end</item>
@ -139,4 +139,10 @@
<item name="android:maxLines">2</item>
<item name="android:ellipsize">end</item>
</style>
<style name="AntennaPod.TextView.UnreadIndicator" parent="@android:style/TextAppearance.Small">
<item name="android:textSize">@dimen/text_size_micro</item>
<item name="android:textColor">@color/new_indicator_green</item>
<item name="android:text">@string/new_label</item>
</style>
</resources>

View File

@ -66,6 +66,7 @@ public class NewEpisodesListAdapter extends BaseAdapter {
holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
holder.pubDate = (TextView) convertView
.findViewById(R.id.txtvPublished);
holder.statusUnread = convertView.findViewById(R.id.statusUnread);
holder.butSecondary = (ImageButton) convertView
.findViewById(R.id.butSecondaryAction);
holder.queueStatus = (ImageView) convertView
@ -81,6 +82,11 @@ public class NewEpisodesListAdapter extends BaseAdapter {
holder.title.setText(item.getTitle());
holder.pubDate.setText(DateUtils.formatDateTime(context, item.getPubDate().getTime(), DateUtils.FORMAT_SHOW_DATE));
if (item.isRead()) {
holder.statusUnread.setVisibility(View.GONE);
} else {
holder.statusUnread.setVisibility(View.VISIBLE);
}
FeedMedia media = item.getMedia();
if (media != null) {
@ -140,6 +146,7 @@ public class NewEpisodesListAdapter extends BaseAdapter {
static class Holder {
TextView title;
TextView pubDate;
View statusUnread;
ImageView queueStatus;
ImageView imageView;
ProgressBar downloadProgress;