From 788542c874ef368a6eabdff099321e5296a365a9 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 23 Oct 2013 20:45:14 -0700 Subject: [PATCH] When games moved, the destination group is opened and the games that were moved stay selected. --- .../XWords4/src/org/eehouse/android/xw4/GameListAdapter.java | 1 + .../XWords4/src/org/eehouse/android/xw4/GameListItem.java | 4 ---- .../XWords4/src/org/eehouse/android/xw4/GamesList.java | 5 ++++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java index b70bde5f9..4efe62dd0 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java @@ -234,6 +234,7 @@ public class GameListAdapter implements ExpandableListAdapter { GameListItem result = GameListItem.makeForRow( m_context, rowid, m_handler, groupPosition, m_fieldID, m_cb ); + result.setSelected( m_cb.getSelected( result ) ); return result; } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java index 1cf8c3257..bc65afdb2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListItem.java @@ -337,10 +337,6 @@ public class GameListItem extends LinearLayout s_invalRows.remove( m_rowid ); } } - - if ( m_cb.getSelected( GameListItem.this ) && m_selected ) { - toggleSelected(); - } } } // class LoadItemTask 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 5f6170f03..50235adcf 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -301,6 +301,8 @@ public class GamesList extends XWExpandableListActivity for ( long rowid : m_rowids ) { DBUtils.moveGame( GamesList.this, rowid, gid ); } + DBUtils.setGroupExpanded( GamesList.this, gid, + true ); onContentChanged(); } }; @@ -631,7 +633,7 @@ public class GamesList extends XWExpandableListActivity @Override public void onBackPressed() { - if ( 0 == m_selGames.size() ) { + if ( 0 == m_selGames.size() && 0 == m_selGroupIDs.size() ) { super.onBackPressed(); } else { clearSelections(); @@ -796,6 +798,7 @@ public class GamesList extends XWExpandableListActivity // Game menus case R.id.list_item_move: + keepSels = true; if ( 1 >= m_adapter.getGroupCount() ) { showOKOnlyDialog( R.string.no_move_onegroup ); } else {