include device role in game list summary

This commit is contained in:
eehouse 2010-01-31 21:46:04 +00:00
parent 9f250c99ef
commit 24285b5d7a

View file

@ -14,6 +14,7 @@ import java.io.InputStreamReader;
import java.nio.CharBuffer;
import org.eehouse.android.xw4.jni.*;
import org.eehouse.android.xw4.jni.CurGameInfo.DeviceRole;
public class GameListAdapter implements ListAdapter {
Context m_context;
@ -61,6 +62,18 @@ public class GameListAdapter implements ListAdapter {
sb.append( "\nDictionary: " );
sb.append( gi.dictName );
DeviceRole role = gi.serverRole;
if ( gi.serverRole != DeviceRole.SERVER_STANDALONE ) {
sb.append( "\n" )
.append( m_context.getString( R.string.role_label ) )
.append( ": " );
if ( role == DeviceRole.SERVER_ISSERVER ) {
sb.append( m_context.getString( R.string.role_host ) );
} else {
sb.append( m_context.getString( R.string.role_guest ) );
}
}
view.setText( sb.toString() );
}
return view;