add select none to headlines selection menu

This commit is contained in:
Andrew Dolgov 2011-11-30 22:11:56 +03:00
parent 95f6ef2fa2
commit f44bd5e47d
3 changed files with 16 additions and 0 deletions

View File

@ -61,6 +61,12 @@
android:icon="@drawable/ic_menu_rss"
android:showAsAction=""
android:title="@string/selection_toggle_published"/>
<item
android:id="@+id/selection_select_none"
android:icon="@android:drawable/ic_menu_close_clear_cancel"
android:showAsAction=""
android:title="@string/selection_select_none"/>
</group>
<group android:id="@+id/menu_group_article" >

View File

@ -54,6 +54,7 @@
<string name="selection_toggle_marked">(Un)Star</string>
<string name="selection_toggle_published">(Un)Publish</string>
<string name="selection_toggle_unread">(Un)Read</string>
<string name="selection_select_none">Deselect all</string>
<string name="context_selection_toggle_marked">(Un)Star</string>
<string name="context_selection_toggle_published">(Un)Publish</string>
<string name="context_selection_toggle_unread">(Un)Read</string>

View File

@ -619,6 +619,15 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe
updateHeadlines();
}
return true;
case R.id.selection_select_none:
if (hf != null) {
ArticleList selected = hf.getSelectedArticles();
if (selected.size() > 0) {
selected.clear();
hf.notifyUpdated();
}
}
return true;
case R.id.selection_toggle_unread:
if (hf != null) {
ArticleList selected = hf.getSelectedArticles();