mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +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;
|
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 )
|
public void expandGroups( ExpandableListView view )
|
||||||
{
|
{
|
||||||
HashMap<Long,GameGroupInfo> info = gameInfo();
|
HashMap<Long,GameGroupInfo> info = gameInfo();
|
||||||
|
|
|
@ -554,7 +554,9 @@ public class GamesList extends XWExpandableListActivity
|
||||||
|
|
||||||
case DELETE_GROUP_ACTION:
|
case DELETE_GROUP_ACTION:
|
||||||
GameUtils.deleteGroup( this, m_groupid );
|
GameUtils.deleteGroup( this, m_groupid );
|
||||||
|
if ( m_adapter.removeGroup( m_groupid ) ) {
|
||||||
onContentChanged();
|
onContentChanged();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
|
|
Loading…
Reference in a new issue