diff options
author | Andrew Dolgov <[email protected]> | 2015-07-12 12:19:24 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-07-12 12:19:24 +0300 |
commit | 32c0691d5d68c7890bb973f6754b57d6541e937a (patch) | |
tree | f4bfce2cc0a365fa8a4702d00c44355528af3175 /org.fox.ttrss/src | |
parent | cbcbebca99cfde2e91197f7eb155ac359d285822 (diff) |
add support for top id checking
Diffstat (limited to 'org.fox.ttrss/src')
3 files changed, 30 insertions, 7 deletions
diff --git a/org.fox.ttrss/src/main/AndroidManifest.xml b/org.fox.ttrss/src/main/AndroidManifest.xml index df9259ef..ecc184d6 100755 --- a/org.fox.ttrss/src/main/AndroidManifest.xml +++ b/org.fox.ttrss/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.fox.ttrss" - android:versionCode="361" - android:versionName="1.134" > + android:versionCode="362" + android:versionName="1.135" > <uses-sdk android:minSdkVersion="15" diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java index da023d64..70fb30e1 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticlePager.java @@ -217,6 +217,16 @@ public class ArticlePager extends Fragment { final int fskip = skip; req.setOffset(skip); + + final int checkTopId; + + if (skip != 0 && m_articles.size() > 1) { + // m_articles[0] is the special spacer (id -2) + //Log.d(TAG, "TOPID:" + m_articles.get(1).id); + checkTopId = m_articles.get(1).id; + } else { + checkTopId = 0; + } HashMap<String,String> map = new HashMap<String,String>() { { @@ -242,10 +252,12 @@ public class ArticlePager extends Fragment { put("search_mode", ""); put("match_on", "both"); } + + if (checkTopId > 0) put("check_top_id", String.valueOf(checkTopId)); } }; - Log.d(TAG, "[AP] request more headlines..."); + Log.d(TAG, "[AP] request more headlines, topId=" + checkTopId); req.execute(map); } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 2a945d9d..8cc9e468 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -602,7 +602,17 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, Log.d(TAG, "allowForceUpdate=" + allowForceUpdate + " userInitiated=" + userInitiated); req.setOffset(skip); - + + final int checkTopId; + + if (skip != 0 && m_articles.size() > 1) { + // m_articles[0] is the special spacer (id -2) + //Log.d(TAG, "TOPID:" + m_articles.get(1).id); + checkTopId = m_articles.get(1).id; + } else { + checkTopId = 0; + } + HashMap<String,String> map = new HashMap<String,String>() { { put("op", "getHeadlines"); @@ -631,11 +641,12 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, put("search_mode", ""); put("match_on", "both"); } - - } + + if (checkTopId > 0) put("check_top_id", String.valueOf(checkTopId)); + } }; - Log.d(TAG, "[HP] request more headlines..."); + Log.d(TAG, "[HP] request more headlines, topId=" + checkTopId); req.execute(map); } |