add support for top id checking

This commit is contained in:
Andrew Dolgov 2015-07-12 12:19:24 +03:00
parent cbcbebca99
commit 32c0691d5d
3 changed files with 30 additions and 7 deletions

View File

@ -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"

View File

@ -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);
}

View File

@ -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);
}