From b7ac444be0961a0175c7eae975cff7ae791332cb Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Fri, 8 Feb 2019 20:28:10 +0000 Subject: [PATCH] Fixing atom format very annoying urls problem, by setting them manually just after parsing --- .../java/com/readrops/app/ItemActivity.java | 2 +- .../readrops/app/database/entities/Feed.java | 2 +- .../readropslibrary/localfeed/RSSNetwork.java | 5 +++- .../localfeed/atom/ATOMFeed.java | 24 +++++++++++++++++-- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/readrops/app/ItemActivity.java b/app/src/main/java/com/readrops/app/ItemActivity.java index 7afb6bd5..b5599415 100644 --- a/app/src/main/java/com/readrops/app/ItemActivity.java +++ b/app/src/main/java/com/readrops/app/ItemActivity.java @@ -103,6 +103,6 @@ public class ItemActivity extends AppCompatActivity { readTimeLayout.setVisibility(View.VISIBLE); } - webView.setItem(itemWithFeed); + webView.setItem(itemWithFeed, Utils.getDeviceWidth(this)); } } diff --git a/app/src/main/java/com/readrops/app/database/entities/Feed.java b/app/src/main/java/com/readrops/app/database/entities/Feed.java index 7026a942..6b420020 100644 --- a/app/src/main/java/com/readrops/app/database/entities/Feed.java +++ b/app/src/main/java/com/readrops/app/database/entities/Feed.java @@ -150,7 +150,7 @@ public class Feed { feed.setName(atomFeed.getTitle()); feed.setDescription(atomFeed.getSubtitle()); feed.setUrl(atomFeed.getUrl()); - feed.setSiteUrl(atomFeed.getWebSiteUrl()); + feed.setSiteUrl(atomFeed.getWebsiteUrl()); feed.setDescription(atomFeed.getSubtitle()); feed.setLastUpdated(atomFeed.getUpdated()); diff --git a/readropslibrary/src/main/java/com/readrops/readropslibrary/localfeed/RSSNetwork.java b/readropslibrary/src/main/java/com/readrops/readropslibrary/localfeed/RSSNetwork.java index dbdf558e..1f56e8c6 100644 --- a/readropslibrary/src/main/java/com/readrops/readropslibrary/localfeed/RSSNetwork.java +++ b/readropslibrary/src/main/java/com/readrops/readropslibrary/localfeed/RSSNetwork.java @@ -89,7 +89,7 @@ public class RSSNetwork { if (type == RSSType.RSS_UNKNOWN) { if (Pattern.compile(RSS_2_REGEX).matcher(xml).find()) type = RSSType.RSS_2; - else if (xml.contains("")) + else if (xml.contains(" links; + private String url; + + private String websiteUrl; + @Element(required = false) private String id; @@ -88,7 +92,23 @@ public class ATOMFeed extends AFeed { this.id = id; } - public String getWebSiteUrl() { + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getWebsiteUrl() { + return websiteUrl; + } + + public void setWebsiteUrl(String websiteUrl) { + this.websiteUrl = websiteUrl; + } + + /*public String getWebSiteUrl() { return id; } @@ -104,5 +124,5 @@ public class ATOMFeed extends AFeed { } } else return null; - } + }*/ }