mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
preserve order of groups when removing one by removing it from list
rather than allowing list to be regenerated.
This commit is contained in:
parent
674b6d3e8e
commit
8c4b878e21
2 changed files with 16 additions and 1 deletions
|
@ -88,6 +88,19 @@ public class GameListAdapter implements ExpandableListAdapter {
|
|||
return success;
|
||||
}
|
||||
|
||||
public boolean removeGroup( long groupid )
|
||||
{
|
||||
long[] newArray = new long[m_positions.length - 1];
|
||||
int destIndex = 0;
|
||||
for ( long id : m_positions ) {
|
||||
if ( id != groupid ) {
|
||||
newArray[destIndex++] = id;
|
||||
}
|
||||
}
|
||||
m_positions = newArray;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void expandGroups( ExpandableListView view )
|
||||
{
|
||||
HashMap<Long,GameGroupInfo> info = gameInfo();
|
||||
|
|
|
@ -554,7 +554,9 @@ public class GamesList extends XWExpandableListActivity
|
|||
|
||||
case DELETE_GROUP_ACTION:
|
||||
GameUtils.deleteGroup( this, m_groupid );
|
||||
onContentChanged();
|
||||
if ( m_adapter.removeGroup( m_groupid ) ) {
|
||||
onContentChanged();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
|
|
Loading…
Reference in a new issue