From 95f6ef2fa2ad9bcdef5a54c8a8724d7f70d7de2e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 30 Nov 2011 22:06:11 +0300 Subject: [PATCH] menu-related tweaks, drop duplicate set unread from headline context menu --- res/menu/headlines_menu.xml | 4 ++-- res/values/strings.xml | 1 + src/org/fox/ttrss/MainActivity.java | 31 +++++++++++++++++++---------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/res/menu/headlines_menu.xml b/res/menu/headlines_menu.xml index d4700e68..524004b4 100644 --- a/res/menu/headlines_menu.xml +++ b/res/menu/headlines_menu.xml @@ -23,9 +23,9 @@ android:title="@string/share_article"/> + android:title="@string/article_mark_read_above"/> diff --git a/res/values/strings.xml b/res/values/strings.xml index 05e19f29..9382128f 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -58,6 +58,7 @@ (Un)Publish (Un)Read Set unread + Mark above read Optional. Fill this if your tt-rss installation is protected by HTTP Basic authentication Your tt-rss login. Not needed for single user mode Enable ads diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index aa6eaa8d..c5573c2b 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -693,6 +693,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe return true; */ default: + Log.d(TAG, "onOptionsItemSelected, unhandled id=" + item.getItemId()); return super.onOptionsItemSelected(item); } } @@ -1138,8 +1139,6 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe public boolean onContextItemSelected(MenuItem item) { AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo(); - Log.d(TAG, "onContextItemSelected=" + item.getItemId()); - HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentById(R.id.headlines_fragment); FeedsFragment ff = (FeedsFragment)getSupportFragmentManager().findFragmentById(R.id.feeds_fragment); FeedCategoriesFragment cf = (FeedCategoriesFragment)getSupportFragmentManager().findFragmentById(R.id.cats_fragment); @@ -1153,7 +1152,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe cf.setSelectedCategory(cat); } } - break; + return true; case R.id.browse_feeds: if (cf != null) { FeedCategory cat = cf.getCategoryAtPosition(info.position); @@ -1162,7 +1161,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe cf.setSelectedCategory(cat); } } - break; + return true; case R.id.catchup_category: if (cf != null) { FeedCategory cat = cf.getCategoryAtPosition(info.position); @@ -1170,7 +1169,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe catchupFeed(new Feed(cat.id, cat.title, true)); } } - break; + return true; case R.id.catchup_feed: if (ff != null) { Feed feed = ff.getFeedAtPosition(info.position); @@ -1178,7 +1177,7 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe catchupFeed(feed); } } - break; + return true; case R.id.selection_toggle_marked: if (hf != null) { ArticleList selected = hf.getSelectedArticles(); @@ -1245,8 +1244,17 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe if (article != null) shareArticle(article); } - break; - case R.id.set_unread: + return true; + case R.id.catchup_above: + if (hf != null) { + Article article = hf.getArticleAtPosition(info.position); + if (article != null) { + // TODO implement + + } + } + return true; + /* case R.id.set_unread: if (hf != null) { Article article = hf.getArticleAtPosition(info.position); if (article != null) { @@ -1254,10 +1262,11 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe saveArticleUnread(article); } } - break; + break; */ + default: + Log.d(TAG, "onContextItemSelected, unhandled id=" + item.getItemId()); + return super.onContextItemSelected(item); } - - return true; }