articleList: switch between Show All <-> Show Unread

This commit is contained in:
Kevin Meyer 2014-12-16 18:58:47 +01:00
parent f41a17de50
commit 4f2a4d1399
4 changed files with 20 additions and 5 deletions

View File

@ -59,7 +59,13 @@ public class ListArticles extends BaseActionBarActivity {
return true;
}
@Override
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
menu.findItem(R.id.menuShowAll).setTitle(getString(showAll ? R.string.menuShowUnread : R.string.menuShowAll));
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menuShowAll:
@ -83,7 +89,7 @@ public class ListArticles extends BaseActionBarActivity {
} else {
setupListAdapter();
}
setTitle("wallabag | " + readList.getCount() + " Articles");
setTitle(getString(R.string.app_name) + " | " + getResources().getQuantityString(R.plurals.numberOfArticles, readList.getCount(), readList.getCount()));
}
private void setupListAdapter() {

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/menuShowAll" android:title="@string/menuShowAll"></item>
<item android:id="@+id/menuWipeDb" android:title="@string/menuWipeDb"></item>
<item android:id="@+id/menuShowAll" android:title="@string/menuShowAll" />
<item android:id="@+id/menuWipeDb" android:title="@string/menuWipeDb" />
</menu>

View File

@ -21,4 +21,9 @@
<string name="txtAPIToken"><b><u>Dein Token:</u></b></string>
<string name="error">Fehler</string>
<string name="error_feed">Fehler beim laden des Feeds</string>
<string name="menuShowUnread">Ungelesene anzeigen</string>
<plurals name="numberOfArticles">
<item quantity="one">%d Artikel</item>
<item quantity="other">%d Artikel</item>
</plurals>
</resources>

View File

@ -13,6 +13,7 @@
<string name="btnMarkRead">Mark as Read</string>
<string name="btnSettings">Settings</string>
<string name="menuShowAll">Show All</string>
<string name="menuShowUnread">Show Unread</string>
<string name="menuWipeDb">Wipe Database</string>
<string name="txtSyncDone">Synchronize done !</string>
<string name="txtNetOffline">Check Internet Connectivity !</string>
@ -21,4 +22,8 @@
<string name="txtAPIToken"><b><u>Your Token:</u></b></string>
<string name="error">Error</string>
<string name="error_feed">Error loading feed</string>
<plurals name="numberOfArticles">
<item quantity="one">%d Article</item>
<item quantity="other">%d Articles</item>
</plurals>
</resources>