diff --git a/res/menu/headlines_menu.xml b/res/menu/headlines_menu.xml index d9c6b7be..073ecb37 100644 --- a/res/menu/headlines_menu.xml +++ b/res/menu/headlines_menu.xml @@ -1,39 +1,39 @@ - + - - - - - - + - - - - + android:id="@+id/share_article" + android:showAsAction="" + android:title="@string/share_article"/> + + + + - - + \ No newline at end of file diff --git a/res/menu/main_menu.xml b/res/menu/main_menu.xml index 053c9373..23b36521 100644 --- a/res/menu/main_menu.xml +++ b/res/menu/main_menu.xml @@ -127,6 +127,11 @@ android:id="@+id/set_labels" android:icon="@drawable/ic_menu_marked" android:title="@string/article_set_labels"/> + + diff --git a/res/values/strings.xml b/res/values/strings.xml index c686a2a3..266a86e4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -118,4 +118,5 @@ Offline sync in progress Stop syncing Continue + Publish with note \ No newline at end of file diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 58b68e75..66696d63 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -116,6 +116,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, menu.setGroupVisible(R.id.menu_group_single_article, true); } + menu.findItem(R.id.set_labels).setEnabled(m_onlineServices.getApiLevel() >= 1); + menu.findItem(R.id.article_set_note).setEnabled(m_onlineServices.getApiLevel() >= 1); + super.onCreateContextMenu(menu, v, menuInfo); } diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 63f5f0ea..c8215534 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -247,6 +247,24 @@ public class MainActivity extends FragmentActivity implements OnlineServices { req.execute(map); } + @SuppressWarnings({ "unchecked", "serial" }) + public void saveArticleNote(final Article article, final String note) { + ApiRequest req = new ApiRequest(getApplicationContext()); + + HashMap map = new HashMap() { + { + put("sid", m_sessionId); + put("op", "updateArticle"); + put("article_ids", String.valueOf(article.id)); + put("mode", "1"); + put("data", note); + put("field", "3"); + } + }; + + req.execute(map); + } + public static String articlesToIdString(ArticleList articles) { String tmp = ""; @@ -936,6 +954,11 @@ public class MainActivity extends FragmentActivity implements OnlineServices { case R.id.go_offline: switchOffline(); return true; + case R.id.article_set_note: + if (m_selectedArticle != null) { + editArticleNote(m_selectedArticle); + } + return true; case R.id.headlines_select: if (hf != null) { Dialog dialog = new Dialog(this); @@ -1095,74 +1118,7 @@ public class MainActivity extends FragmentActivity implements OnlineServices { return true; case R.id.set_labels: if (m_selectedArticle != null) { - - ApiRequest req = new ApiRequest(getApplicationContext()) { - @Override - protected void onPostExecute(JsonElement result) { - if (result != null) { - Type listType = new TypeToken>() {}.getType(); - final List