for deletes, don't clear selection until after it's confirmed and

finished.
This commit is contained in:
Eric House 2013-10-23 19:29:32 -07:00
parent e6860a734c
commit 0a5e891d5e
2 changed files with 9 additions and 2 deletions

View file

@ -400,8 +400,10 @@ public class GameListAdapter implements ExpandableListAdapter {
for ( Iterator<Long>iter = groupids.iterator(); for ( Iterator<Long>iter = groupids.iterator();
iter.hasNext(); ) { iter.hasNext(); ) {
int pos = getGroupPosition( iter.next() ); int pos = getGroupPosition( iter.next() );
GameListGroup group = getGroupItemFor( pos ); if ( 0 <= pos ) { // still exists?
group.setSelected( false ); GameListGroup group = getGroupItemFor( pos );
group.setSelected( false );
}
} }
} }

View file

@ -605,6 +605,7 @@ public class GamesList extends XWExpandableListActivity
for ( long groupID : groupIDs ) { for ( long groupID : groupIDs ) {
GameUtils.deleteGroup( this, groupID ); GameUtils.deleteGroup( this, groupID );
} }
clearSelections();
onContentChanged(); onContentChanged();
break; break;
case DELETE_GAMES: case DELETE_GAMES:
@ -752,6 +753,7 @@ public class GamesList extends XWExpandableListActivity
break; break;
case R.id.gamel_menu_delete: case R.id.gamel_menu_delete:
keepSels = true;
String msg = Utils.format( this, R.string.confirm_seldeletesf, String msg = Utils.format( this, R.string.confirm_seldeletesf,
selRowIDs.length ); selRowIDs.length );
showConfirmThen( msg, R.string.button_delete, showConfirmThen( msg, R.string.button_delete,
@ -831,6 +833,7 @@ public class GamesList extends XWExpandableListActivity
// Group menus // Group menus
case R.id.list_group_delete: case R.id.list_group_delete:
keepSels = true;
if ( m_selGroupIDs if ( m_selGroupIDs
.contains( XWPrefs.getDefaultNewGameGroup( this ) ) ) { .contains( XWPrefs.getDefaultNewGameGroup( this ) ) ) {
showOKOnlyDialog( R.string.cannot_delete_default_group ); showOKOnlyDialog( R.string.cannot_delete_default_group );
@ -854,6 +857,7 @@ public class GamesList extends XWExpandableListActivity
break; break;
case R.id.list_group_default: case R.id.list_group_default:
XWPrefs.setDefaultNewGameGroup( this, groupID ); XWPrefs.setDefaultNewGameGroup( this, groupID );
keepSels = true;
break; break;
case R.id.list_group_rename: case R.id.list_group_rename:
m_groupid = groupID; m_groupid = groupID;
@ -1155,6 +1159,7 @@ public class GamesList extends XWExpandableListActivity
} }
NetUtils.informOfDeaths( this ); NetUtils.informOfDeaths( this );
clearSelections();
} }
private boolean makeNewNetGameIf() private boolean makeNewNetGameIf()