mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
pass summary rather than have callee refetch it
This commit is contained in:
parent
7efbd2697d
commit
ce803a928c
2 changed files with 4 additions and 5 deletions
|
@ -67,7 +67,7 @@ public class GameListAdapter extends XWListAdapter {
|
|||
private HashSet<Long> m_loadedRows;
|
||||
|
||||
public interface LoadItemCB {
|
||||
public void itemClicked( long rowid );
|
||||
public void itemClicked( long rowid, GameSummary summary );
|
||||
}
|
||||
|
||||
private class LoadItemTask extends AsyncTask<Void, Void, GameSummary> {
|
||||
|
@ -225,7 +225,7 @@ public class GameListAdapter extends XWListAdapter {
|
|||
return result;
|
||||
}
|
||||
|
||||
private void setData( GameListItem layout, GameSummary summary )
|
||||
private void setData( GameListItem layout, final GameSummary summary )
|
||||
{
|
||||
if ( null != summary ) {
|
||||
final long rowid = layout.getRowID();
|
||||
|
@ -263,7 +263,7 @@ public class GameListAdapter extends XWListAdapter {
|
|||
layout.setOnClickListener( new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick( View v ) {
|
||||
m_cb.itemClicked( rowid );
|
||||
m_cb.itemClicked( rowid, summary );
|
||||
}
|
||||
} );
|
||||
|
||||
|
|
|
@ -392,12 +392,11 @@ public class GamesList extends XWListActivity
|
|||
}
|
||||
|
||||
// GameListAdapter.LoadItemCB interface
|
||||
public void itemClicked( long rowid )
|
||||
public void itemClicked( long rowid, GameSummary summary )
|
||||
{
|
||||
// We need a way to let the user get back to the basic-config
|
||||
// dialog in case it was dismissed. That way it to check for
|
||||
// an empty room name.
|
||||
GameSummary summary = DBUtils.getSummary( this, rowid );
|
||||
if ( summary.conType == CommsAddrRec.CommsConnType.COMMS_CONN_RELAY
|
||||
&& summary.roomName.length() == 0 ) {
|
||||
// If it's unconfigured and of the type RelayGameActivity
|
||||
|
|
Loading…
Reference in a new issue