From ce803a928cdcc3f50ef475b5ba8c2f3613f9e601 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 8 Dec 2012 08:55:45 -0800 Subject: [PATCH] pass summary rather than have callee refetch it --- .../src/org/eehouse/android/xw4/GameListAdapter.java | 6 +++--- .../XWords4/src/org/eehouse/android/xw4/GamesList.java | 3 +-- 2 files changed, 4 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 87b65e852..9693a0eba 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameListAdapter.java @@ -67,7 +67,7 @@ public class GameListAdapter extends XWListAdapter { private HashSet m_loadedRows; public interface LoadItemCB { - public void itemClicked( long rowid ); + public void itemClicked( long rowid, GameSummary summary ); } private class LoadItemTask extends AsyncTask { @@ -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 ); } } ); 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 3bb68c661..99697680b 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -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