diff options
author | Andrew Dolgov <[email protected]> | 2011-11-24 15:16:07 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-24 15:16:07 +0300 |
commit | fb86971ca88b47d24f83de1f2d495ba8b1815a44 (patch) | |
tree | 94835639ee6391a1b2ec327b880f6500174f1843 | |
parent | 4776a5d439731fca488ef7a06432e2b858d49e69 (diff) |
mark articles as read when reading
-rw-r--r-- | res/layout/main.xml | 10 | ||||
-rw-r--r-- | src/org/fox/ttrss/HeadlinesFragment.java | 19 |
2 files changed, 24 insertions, 5 deletions
diff --git a/res/layout/main.xml b/res/layout/main.xml index da5de56f..97a9e9c8 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -1,17 +1,17 @@ <ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/main_flipper"> - <LinearLayout android:layout_height="fill_parent" android:orientation="horizontal" android:id="@+id/main" android:layout_width="fill_parent"> - <FrameLayout android:layout_height="match_parent" android:layout_width="300dp" android:layout_weight="0" android:id="@+id/feeds_fragment"></FrameLayout> - <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="0.5" android:id="@+id/headlines_fragment"></FrameLayout> - <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="0.5" android:id="@+id/article_fragment"></FrameLayout> - </LinearLayout> <FrameLayout android:layout_gravity="center_vertical" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/sync_splash"> <LinearLayout android:layout_width="match_parent" android:gravity="center" android:layout_height="match_parent" android:id="@+id/linearLayout1"> <ProgressBar android:layout_height="wrap_content" android:layout_width="wrap_content" style="?android:attr/progressBarStyleLarge" android:id="@+id/loading_progress"></ProgressBar> <TextView android:id="@+id/loading_message" android:text="@string/loading_message" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_height="wrap_content" android:layout_width="wrap_content"></TextView> </LinearLayout> </FrameLayout> + <LinearLayout android:layout_height="fill_parent" android:orientation="horizontal" android:id="@+id/main" android:layout_width="fill_parent"> + <FrameLayout android:layout_height="match_parent" android:layout_width="300dp" android:layout_weight="0" android:id="@+id/feeds_fragment"></FrameLayout> + <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="0.5" android:id="@+id/headlines_fragment"></FrameLayout> + <FrameLayout android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="0.5" android:id="@+id/article_fragment"></FrameLayout> + </LinearLayout> </ViewFlipper>
\ No newline at end of file diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 953bed54..d2c019ad 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -108,6 +108,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { article.unread = false;
m_selectedArticleId = article.id;
m_adapter.notifyDataSetChanged();
+
+ catchupArticle(article);
}
}
@@ -206,6 +208,23 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener { }
}
+ public void catchupArticle(final Article article) {
+ ApiRequest ar = new ApiRequest();
+ ar.setApi(m_prefs.getString("ttrss_url", null));
+
+ HashMap<String,String> map = new HashMap<String,String>() {
+ {
+ put("sid", m_sessionId);
+ put("op", "updateArticle");
+ put("article_ids", String.valueOf(article.id));
+ put("mode", "0");
+ put("field", "2");
+ }
+ };
+
+ ar.execute(map);
+ }
+
private class ArticleListAdapter extends ArrayAdapter<Article> {
private ArrayList<Article> items;
|