mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
more of the (conflicted) merge from android_branch. These may be
changes I need to make to get what git produced to compile and so not what it included in the previous commit.
This commit is contained in:
parent
8a58492389
commit
3a1b39f827
4 changed files with 33 additions and 34 deletions
|
@ -1401,23 +1401,6 @@ public class DBUtils {
|
|||
}
|
||||
}
|
||||
|
||||
private static void updateRow( Context context, String table,
|
||||
long rowid, ContentValues values )
|
||||
{
|
||||
initDB( context );
|
||||
synchronized( s_dbHelper ) {
|
||||
SQLiteDatabase db = s_dbHelper.getWritableDatabase();
|
||||
|
||||
String selection = String.format( ROW_ID_FMT, rowid );
|
||||
|
||||
int result = db.update( table, values, selection, null );
|
||||
db.close();
|
||||
if ( 0 == result ) {
|
||||
DbgUtils.logf( "updateRow failed" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void notifyListeners( long rowid, boolean countChanged )
|
||||
{
|
||||
synchronized( s_listeners ) {
|
||||
|
|
|
@ -202,7 +202,10 @@ public class GameListAdapter implements ExpandableListAdapter {
|
|||
private View getChildView( int groupPosition, int childPosition )
|
||||
{
|
||||
long rowid = getRowIDFor( groupPosition, childPosition );
|
||||
return getItem( rowid );
|
||||
GameListItem result = (GameListItem)
|
||||
m_factory.inflate( R.layout.game_list_item, null );
|
||||
result.init( m_handler, rowid, m_fieldID, m_cb );
|
||||
return result;
|
||||
}
|
||||
|
||||
public View getGroupView( int groupPosition, boolean isExpanded,
|
||||
|
@ -372,9 +375,16 @@ public class GameListAdapter implements ExpandableListAdapter {
|
|||
private GameListItem getItemFor( long rowid )
|
||||
{
|
||||
GameListItem result = null;
|
||||
int position = positionFor( rowid );
|
||||
if ( 0 <= position ) {
|
||||
result = (GameListItem)m_list.getChildAt( position );
|
||||
int count = m_list.getChildCount();
|
||||
for ( int ii = 0; ii < count; ++ii ) {
|
||||
View view = m_list.getChildAt( ii );
|
||||
if ( view instanceof GameListItem ) {
|
||||
GameListItem tryme = (GameListItem)view;
|
||||
if ( tryme.getRowID() == rowid ) {
|
||||
result = tryme;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -397,16 +407,22 @@ public class GameListAdapter implements ExpandableListAdapter {
|
|||
return result;
|
||||
}
|
||||
|
||||
private int positionFor( long rowid )
|
||||
// private int positionFor( long rowid )
|
||||
// {
|
||||
// int position = -1;
|
||||
// long[] rowids = DBUtils.gamesList( m_context );
|
||||
// for ( int ii = 0; ii < rowids.length; ++ii ) {
|
||||
// if ( rowids[ii] == rowid ) {
|
||||
// position = ii;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// return position;
|
||||
// }
|
||||
|
||||
private HashMap<String,GameGroupInfo> gameInfo()
|
||||
{
|
||||
int position = -1;
|
||||
long[] rowids = DBUtils.gamesList( m_context );
|
||||
for ( int ii = 0; ii < rowids.length; ++ii ) {
|
||||
if ( rowids[ii] == rowid ) {
|
||||
position = ii;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return position;
|
||||
return DBUtils.getGroups( m_context );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -347,8 +347,8 @@ public class GamesList extends XWExpandableListActivity
|
|||
});
|
||||
|
||||
String field = CommonPrefs.getSummaryField( this );
|
||||
m_adapter = new GameListAdapter( this, getListView(), new Handler(),
|
||||
this, field );
|
||||
m_adapter = new GameListAdapter( this, getExpandableListView(),
|
||||
new Handler(), this, field );
|
||||
setListAdapter( m_adapter );
|
||||
|
||||
NetUtils.informOfDeaths( this );
|
||||
|
|
|
@ -29,7 +29,7 @@ import junit.framework.Assert;
|
|||
|
||||
|
||||
public class XWExpandableListActivity extends ExpandableListActivity
|
||||
implements DlgDelegate.DlgClickNotify, MultiService.BTEventListener {
|
||||
implements DlgDelegate.DlgClickNotify, MultiService.MultiEventListener {
|
||||
|
||||
private DlgDelegate m_delegate;
|
||||
|
||||
|
|
Loading…
Reference in a new issue