diff options
5 files changed, 115 insertions, 103 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java index 13982f57d..0d2d5cfa0 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -12,6 +12,7 @@ import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.IconTextView; import android.widget.ImageView; +import android.widget.RelativeLayout; import android.widget.TextView; import com.squareup.picasso.Picasso; @@ -267,8 +268,12 @@ public class NavListAdapter extends BaseAdapter if(feed.hasLastUpdateFailed()) { + RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) holder.title.getLayoutParams(); + p.addRule(RelativeLayout.LEFT_OF, R.id.itxtvFailure); holder.failure.setVisibility(View.VISIBLE); } else { + RelativeLayout.LayoutParams p = (RelativeLayout.LayoutParams) holder.title.getLayoutParams(); + p.addRule(RelativeLayout.LEFT_OF, R.id.txtvCount); holder.failure.setVisibility(View.GONE); } int feedUnreadItems = itemAccess.getNumberOfUnreadFeedItems(feed.getId()); @@ -277,7 +282,7 @@ public class NavListAdapter extends BaseAdapter holder.count.setText(String.valueOf(feedUnreadItems)); holder.count.setTypeface(holder.title.getTypeface()); } else { - holder.count.setVisibility(View.INVISIBLE); + holder.count.setVisibility(View.GONE); } return convertView; } diff --git a/app/src/main/res/layout/nav_feedlistitem.xml b/app/src/main/res/layout/nav_feedlistitem.xml index 238beff88..b9958257c 100644 --- a/app/src/main/res/layout/nav_feedlistitem.xml +++ b/app/src/main/res/layout/nav_feedlistitem.xml @@ -5,6 +5,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="@dimen/listitem_iconwithtext_height" + android:paddingRight="@dimen/listitem_threeline_verticalpadding" tools:background="@android:color/darker_gray"> <ImageView @@ -24,30 +25,13 @@ tools:background="@android:color/holo_green_dark"/> <TextView - android:id="@+id/txtvTitle" - android:lines="1" - android:ellipsize="end" - android:singleLine="true" - android:layout_centerVertical="true" - android:textColor="?android:attr/textColorPrimary" - android:textSize="@dimen/text_size_navdrawer" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginLeft="@dimen/listitem_iconwithtext_textleftpadding" - android:layout_marginRight="@dimen/listitem_icon_rightpadding" - android:layout_toRightOf="@id/imgvCover" - tools:text="Navigation feed item title" - tools:background="@android:color/holo_green_dark"/> - - <TextView android:id="@+id/txtvCount" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/list_vertical_padding" android:lines="1" android:textColor="?android:attr/textColorTertiary" android:textSize="@dimen/text_size_navdrawer" - android:layout_marginLeft="8dp" - android:layout_marginRight="@dimen/listitem_icon_rightpadding" android:layout_alignParentRight="true" android:layout_centerVertical="true" tools:text="23" @@ -58,13 +42,32 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toLeftOf="@id/txtvCount" + android:layout_marginLeft="@dimen/list_vertical_padding" + android:layout_alignWithParentIfMissing="true" android:lines="1" android:text="{fa-exclamation-circle}" android:textColor="@color/download_failed_red" android:textSize="@dimen/text_size_navdrawer" - android:layout_marginLeft="8dp" android:layout_centerVertical="true" tools:text="!" tools:background="@android:color/holo_green_dark"/> + <TextView + android:id="@+id/txtvTitle" + android:lines="1" + android:ellipsize="end" + android:singleLine="true" + android:layout_centerVertical="true" + android:textColor="?android:attr/textColorPrimary" + android:textSize="@dimen/text_size_navdrawer" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="@dimen/listitem_iconwithtext_textleftpadding" + android:layout_toRightOf="@id/imgvCover" + android:layout_toLeftOf="@id/itxtvFailure" + android:layout_alignWithParentIfMissing="true" + tools:text="Navigation feed item title" + tools:background="@android:color/holo_green_dark"/> + + </RelativeLayout> diff --git a/app/src/main/res/layout/opml_import.xml b/app/src/main/res/layout/opml_import.xml index 5ece4f09f..2a67e7ee1 100644 --- a/app/src/main/res/layout/opml_import.xml +++ b/app/src/main/res/layout/opml_import.xml @@ -1,92 +1,96 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout - 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" - android:orientation="vertical" - android:paddingTop="8dp" - android:paddingLeft="16dp" - android:paddingRight="16dp" - android:paddingBottom="8dp" - tools:background="@android:color/darker_gray"> - - <TextView - android:id="@+id/txtvHeadingExplanation1" +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + <LinearLayout + 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" - style="@style/AntennaPod.TextView.Heading" - android:text="@string/txtvfeedurl_label"/> + android:layout_height="match_parent" + android:orientation="vertical" + android:paddingTop="8dp" + android:paddingLeft="16dp" + android:paddingRight="16dp" + android:paddingBottom="8dp" + tools:background="@android:color/darker_gray"> - <TextView - android:id="@+id/txtvExplanation1" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/opml_import_explanation_1" - android:textSize="@dimen/text_size_medium" - android:layout_marginTop="4dp" - tools:background="@android:color/holo_green_dark" /> + <TextView + android:id="@+id/txtvHeadingExplanation1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/AntennaPod.TextView.Heading" + android:text="@string/txtvfeedurl_label"/> - <Button - android:id="@+id/butChooseFileFromFilesystem" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:layout_marginTop="8dp" - android:text="@string/choose_file_from_filesystem" /> + <TextView + android:id="@+id/txtvExplanation1" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/opml_import_explanation_1" + android:textSize="@dimen/text_size_medium" + android:layout_marginTop="4dp" + tools:background="@android:color/holo_green_dark" /> - <View - android:id="@+id/divider1" - android:layout_width="fill_parent" - android:layout_height="1dp" - android:layout_margin="16dp" - android:background="?android:attr/listDivider"/> + <Button + android:id="@+id/butChooseFileFromFilesystem" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="8dp" + android:text="@string/choose_file_from_filesystem" /> - <TextView - android:id="@+id/txtvHeadingExplanation2" - android:layout_width="match_parent" - android:layout_height="wrap_content" - style="@style/AntennaPod.TextView.Heading" - android:text="@string/txtvfeedurl_label"/> + <View + android:id="@+id/divider1" + android:layout_width="fill_parent" + android:layout_height="1dp" + android:layout_margin="16dp" + android:background="?android:attr/listDivider"/> - <TextView - android:id="@+id/txtvExplanation2" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/opml_import_explanation_2" - android:textSize="@dimen/text_size_medium" - android:layout_marginTop="4dp" - tools:background="@android:color/holo_green_dark" /> + <TextView + android:id="@+id/txtvHeadingExplanation2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/AntennaPod.TextView.Heading" + android:text="@string/txtvfeedurl_label"/> - <Button - android:id="@+id/butChooseFileFromExternal" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_horizontal" - android:layout_marginTop="8dp" - android:text="@string/choose_file_from_external_application" /> + <TextView + android:id="@+id/txtvExplanation2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/opml_import_explanation_2" + android:textSize="@dimen/text_size_medium" + android:layout_marginTop="4dp" + tools:background="@android:color/holo_green_dark" /> - <View - android:id="@+id/divider2" - android:layout_width="fill_parent" - android:layout_height="1dp" - android:layout_margin="16dp" - android:background="?android:attr/listDivider"/> + <Button + android:id="@+id/butChooseFileFromExternal" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginTop="8dp" + android:text="@string/choose_file_from_external_application" /> - <TextView - android:id="@+id/txtvHeadingExplanation3" - android:layout_width="match_parent" - android:layout_height="wrap_content" - style="@style/AntennaPod.TextView.Heading" - android:text="@string/txtvfeedurl_label"/> + <View + android:id="@+id/divider2" + android:layout_width="fill_parent" + android:layout_height="1dp" + android:layout_margin="16dp" + android:background="?android:attr/listDivider"/> - <TextView - android:id="@+id/txtvExplanation3" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:text="@string/opml_import_explanation_3" - android:textSize="@dimen/text_size_medium" - android:layout_marginTop="4dp" - tools:background="@android:color/holo_green_dark" /> + <TextView + android:id="@+id/txtvHeadingExplanation3" + android:layout_width="match_parent" + android:layout_height="wrap_content" + style="@style/AntennaPod.TextView.Heading" + android:text="@string/txtvfeedurl_label"/> + + <TextView + android:id="@+id/txtvExplanation3" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/opml_import_explanation_3" + android:textSize="@dimen/text_size_medium" + android:layout_marginTop="4dp" + tools:background="@android:color/holo_green_dark" /> -</LinearLayout>
\ No newline at end of file + </LinearLayout> +</ScrollView> diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java index 11348953e..1168c60e4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java @@ -403,7 +403,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr return this.hasMedia() && false == this.getMedia().isPlaying() && false == this.getMedia().isDownloaded() && - false == this.isRead() && this.getAutoDownload(); } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java index e570ee709..defce5930 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java @@ -308,10 +308,11 @@ public final class DBTasks { private static void refreshFeed(Context context, Feed feed, boolean loadAllPages) throws DownloadRequestException { Feed f; + Date lastUpdate = feed.hasLastUpdateFailed() ? new Date(0) : feed.getLastUpdate(); if (feed.getPreferences() == null) { - f = new Feed(feed.getDownload_url(), feed.getLastUpdate(), feed.getTitle()); + f = new Feed(feed.getDownload_url(), lastUpdate, feed.getTitle()); } else { - f = new Feed(feed.getDownload_url(), feed.getLastUpdate(), feed.getTitle(), + f = new Feed(feed.getDownload_url(), lastUpdate, feed.getTitle(), feed.getPreferences().getUsername(), feed.getPreferences().getPassword()); } f.setId(feed.getId()); |