diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 94a440cae..70fe5e4a2 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -2166,4 +2166,7 @@ can instead tap the icons at the left to select or deselect games, then act on selected games, e.g. to delete them, using the menu or \"Actionbar.\" + + Games: %d" + Groups: %d" diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index b90227543..536098cfc 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -133,6 +133,7 @@ public class GamesList extends XWExpandableListActivity private boolean m_menuPrepared; private HashSet m_selGames; private HashSet m_selGroupIDs; + private CharSequence m_origTitle; @Override protected Dialog onCreateDialog( int id ) @@ -389,6 +390,8 @@ public class GamesList extends XWExpandableListActivity tryStartsFromIntent( getIntent() ); askDefaultNameIf(); + + m_origTitle = getTitle(); } // onCreate @Override @@ -516,6 +519,7 @@ public class GamesList extends XWExpandableListActivity } } Utils.invalidateOptionsMenuIf( this ); + setTitleBar(); } public boolean getSelected( long rowid ) @@ -868,6 +872,26 @@ public class GamesList extends XWExpandableListActivity } ); } + private void setTitleBar() + { + int fmt = 0; + int nSels = m_selGames.size(); + if ( 0 < nSels ) { + fmt = R.string.sel_gamesf; + } else { + nSels = m_selGroupIDs.size(); + if ( 0 < nSels ) { + fmt = R.string.sel_groupsf; + } + } + + if ( 0 == fmt ) { + setTitle( m_origTitle ); + } else { + setTitle( getString( fmt, nSels ) ); + } + } + private boolean checkWarnNoDict( NetLaunchInfo nli ) { // check that we have the dict required @@ -1125,6 +1149,7 @@ public class GamesList extends XWExpandableListActivity } if ( inval ) { Utils.invalidateOptionsMenuIf( this ); + setTitleBar(); } }