mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
remove dead code around public rooms
This commit is contained in:
parent
cdbdf8a121
commit
fd9e519eaa
8 changed files with 10 additions and 383 deletions
|
@ -42,7 +42,6 @@ public enum DlgID {
|
||||||
, MOVE_DICT
|
, MOVE_DICT
|
||||||
, NAME_GAME
|
, NAME_GAME
|
||||||
, NEW_GROUP
|
, NEW_GROUP
|
||||||
, NO_NAME_FOUND
|
|
||||||
, PLAYER_EDIT
|
, PLAYER_EDIT
|
||||||
, ENABLE_SMS
|
, ENABLE_SMS
|
||||||
, QUERY_ENDGAME
|
, QUERY_ENDGAME
|
||||||
|
|
|
@ -60,9 +60,7 @@ import org.eehouse.android.xw4.jni.LocalPlayer;
|
||||||
import org.eehouse.android.xw4.jni.XwJNI;
|
import org.eehouse.android.xw4.jni.XwJNI;
|
||||||
|
|
||||||
public class GameConfigDelegate extends DelegateBase
|
public class GameConfigDelegate extends DelegateBase
|
||||||
implements View.OnClickListener
|
implements View.OnClickListener, XWListItem.DeleteCallback {
|
||||||
,XWListItem.DeleteCallback
|
|
||||||
,RefreshNamesTask.NoNameFound {
|
|
||||||
private static final String TAG = GameConfigDelegate.class.getSimpleName();
|
private static final String TAG = GameConfigDelegate.class.getSimpleName();
|
||||||
|
|
||||||
private static final String INTENT_FORRESULT_NEWGAME = "newgame";
|
private static final String INTENT_FORRESULT_NEWGAME = "newgame";
|
||||||
|
@ -73,31 +71,22 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
private static final String DIS_MAP = "DIS_MAP";
|
private static final String DIS_MAP = "DIS_MAP";
|
||||||
|
|
||||||
private Activity m_activity;
|
private Activity m_activity;
|
||||||
private CheckBox m_joinPublicCheck;
|
|
||||||
private CheckBox m_gameLockedCheck;
|
private CheckBox m_gameLockedCheck;
|
||||||
private boolean m_isLocked;
|
private boolean m_isLocked;
|
||||||
private boolean m_haveClosed;
|
private boolean m_haveClosed;
|
||||||
private LinearLayout m_publicRoomsSet;
|
|
||||||
private LinearLayout m_privateRoomsSet;
|
|
||||||
|
|
||||||
private CommsConnTypeSet m_conTypes;
|
private CommsConnTypeSet m_conTypes;
|
||||||
private Button m_addPlayerButton;
|
private Button m_addPlayerButton;
|
||||||
private Button m_changeConnButton;
|
private Button m_changeConnButton;
|
||||||
private Button m_jugglePlayersButton;
|
private Button m_jugglePlayersButton;
|
||||||
private ImageButton m_refreshRoomsButton;
|
|
||||||
private View m_connectSetRelay;
|
|
||||||
private Spinner m_dictSpinner;
|
private Spinner m_dictSpinner;
|
||||||
private Spinner m_playerDictSpinner;
|
private Spinner m_playerDictSpinner;
|
||||||
private Spinner m_roomChoose;
|
|
||||||
// private Button m_configureButton;
|
|
||||||
private long m_rowid;
|
private long m_rowid;
|
||||||
private boolean m_isNewGame;
|
private boolean m_isNewGame;
|
||||||
private CurGameInfo m_gi;
|
private CurGameInfo m_gi;
|
||||||
private CurGameInfo m_giOrig;
|
private CurGameInfo m_giOrig;
|
||||||
private JNIThread m_jniThread;
|
private JNIThread m_jniThread;
|
||||||
private int m_whichPlayer;
|
private int m_whichPlayer;
|
||||||
// private Spinner m_roleSpinner;
|
|
||||||
// private Spinner m_connectSpinner;
|
|
||||||
private Spinner m_phoniesSpinner;
|
private Spinner m_phoniesSpinner;
|
||||||
private Spinner m_boardsizeSpinner;
|
private Spinner m_boardsizeSpinner;
|
||||||
private Spinner m_traysizeSpinner;
|
private Spinner m_traysizeSpinner;
|
||||||
|
@ -118,11 +107,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
R.id.add_player,
|
R.id.add_player,
|
||||||
R.id.lang_spinner,
|
R.id.lang_spinner,
|
||||||
R.id.dict_spinner,
|
R.id.dict_spinner,
|
||||||
R.id.join_public_room_check,
|
|
||||||
R.id.room_edit,
|
|
||||||
R.id.advertise_new_room_check,
|
|
||||||
R.id.room_spinner,
|
|
||||||
R.id.refresh_button,
|
|
||||||
R.id.hints_allowed,
|
R.id.hints_allowed,
|
||||||
R.id.duplicate_check,
|
R.id.duplicate_check,
|
||||||
R.id.pick_faceup,
|
R.id.pick_faceup,
|
||||||
|
@ -262,18 +246,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NO_NAME_FOUND: {
|
|
||||||
String langName = DictLangCache.getLangName( m_activity,
|
|
||||||
m_gi.dictLang );
|
|
||||||
String msg = getString( R.string.no_name_found_fmt,
|
|
||||||
m_gi.nPlayers, xlateLang( langName ) );
|
|
||||||
dialog = makeAlertBuilder()
|
|
||||||
.setPositiveButton( android.R.string.ok, null )
|
|
||||||
// message added below since varies with language etc.
|
|
||||||
.setMessage( msg )
|
|
||||||
.create();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CHANGE_CONN: {
|
case CHANGE_CONN: {
|
||||||
CommsConnTypeSet conTypes = (CommsConnTypeSet)params[0];
|
CommsConnTypeSet conTypes = (CommsConnTypeSet)params[0];
|
||||||
LinearLayout layout = (LinearLayout)inflate( R.layout.conn_types_display );
|
LinearLayout layout = (LinearLayout)inflate( R.layout.conn_types_display );
|
||||||
|
@ -331,8 +303,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
m_car.populate( m_activity, m_conTypes );
|
m_car.populate( m_activity, m_conTypes );
|
||||||
|
|
||||||
setConnLabel();
|
setConnLabel();
|
||||||
setupRelayStuffIf();
|
|
||||||
showHideRelayStuff();
|
|
||||||
setDisableds();
|
setDisableds();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -510,8 +480,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
Assert.assertTrue( DBUtils.ROWID_NOTFOUND != m_rowid );
|
Assert.assertTrue( DBUtils.ROWID_NOTFOUND != m_rowid );
|
||||||
m_isNewGame = args.getBoolean( INTENT_FORRESULT_NEWGAME, false );
|
m_isNewGame = args.getBoolean( INTENT_FORRESULT_NEWGAME, false );
|
||||||
|
|
||||||
m_connectSetRelay = findViewById( R.id.connect_set_relay );
|
|
||||||
|
|
||||||
m_addPlayerButton = (Button)findViewById(R.id.add_player);
|
m_addPlayerButton = (Button)findViewById(R.id.add_player);
|
||||||
m_addPlayerButton.setOnClickListener( this );
|
m_addPlayerButton.setOnClickListener( this );
|
||||||
m_changeConnButton = (Button)findViewById( R.id.change_connection );
|
m_changeConnButton = (Button)findViewById( R.id.change_connection );
|
||||||
|
@ -670,7 +638,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
}
|
}
|
||||||
|
|
||||||
setConnLabel();
|
setConnLabel();
|
||||||
setupRelayStuffIf();
|
|
||||||
loadPlayersList();
|
loadPlayersList();
|
||||||
configLangSpinner();
|
configLangSpinner();
|
||||||
|
|
||||||
|
@ -783,6 +750,7 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteCallback interface
|
// DeleteCallback interface
|
||||||
|
@Override
|
||||||
public void deleteCalled( XWListItem item )
|
public void deleteCalled( XWListItem item )
|
||||||
{
|
{
|
||||||
if ( m_gi.delete( item.getPosition() ) ) {
|
if ( m_gi.delete( item.getPosition() ) ) {
|
||||||
|
@ -790,12 +758,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NoNameFound interface
|
|
||||||
public void NoNameFound()
|
|
||||||
{
|
|
||||||
showDialogFragment( DlgID.NO_NAME_FOUND );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPosButton( Action action, Object[] params )
|
public boolean onPosButton( Action action, Object[] params )
|
||||||
{
|
{
|
||||||
|
@ -859,18 +821,12 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
m_gi.juggle();
|
m_gi.juggle();
|
||||||
loadPlayersList();
|
loadPlayersList();
|
||||||
break;
|
break;
|
||||||
case R.id.join_public_room_check:
|
|
||||||
adjustConnectStuff();
|
|
||||||
break;
|
|
||||||
case R.id.game_locked_check:
|
case R.id.game_locked_check:
|
||||||
makeNotAgainBuilder( R.string.not_again_unlock,
|
makeNotAgainBuilder( R.string.not_again_unlock,
|
||||||
R.string.key_notagain_unlock,
|
R.string.key_notagain_unlock,
|
||||||
Action.LOCKED_CHANGE_ACTION )
|
Action.LOCKED_CHANGE_ACTION )
|
||||||
.show();
|
.show();
|
||||||
break;
|
break;
|
||||||
case R.id.refresh_button:
|
|
||||||
refreshNames();
|
|
||||||
break;
|
|
||||||
case R.id.change_connection:
|
case R.id.change_connection:
|
||||||
showConnAfterCheck();
|
showConnAfterCheck();
|
||||||
break;
|
break;
|
||||||
|
@ -1024,8 +980,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
.setVisibility( names.length <= 1 ?
|
.setVisibility( names.length <= 1 ?
|
||||||
View.GONE : View.VISIBLE );
|
View.GONE : View.VISIBLE );
|
||||||
|
|
||||||
showHideRelayStuff();
|
|
||||||
|
|
||||||
if ( ! localOnlyGame()
|
if ( ! localOnlyGame()
|
||||||
&& ((0 == m_gi.remoteCount() )
|
&& ((0 == m_gi.remoteCount() )
|
||||||
|| (m_gi.nPlayers == m_gi.remoteCount()) ) ) {
|
|| (m_gi.nPlayers == m_gi.remoteCount()) ) ) {
|
||||||
|
@ -1243,20 +1197,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
((TextView)findViewById( R.id.players_label )).setText( label );
|
((TextView)findViewById( R.id.players_label )).setText( label );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void adjustConnectStuff()
|
|
||||||
{
|
|
||||||
if ( XWPrefs.getPublicRoomsEnabled( m_activity ) ) {
|
|
||||||
if ( m_joinPublicCheck.isChecked() ) {
|
|
||||||
refreshNames();
|
|
||||||
m_privateRoomsSet.setVisibility( View.GONE );
|
|
||||||
m_publicRoomsSet.setVisibility( View.VISIBLE );
|
|
||||||
} else {
|
|
||||||
m_privateRoomsSet.setVisibility( View.VISIBLE );
|
|
||||||
m_publicRoomsSet.setVisibility( View.GONE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// User's toggling whether everything's locked. That should mean
|
// User's toggling whether everything's locked. That should mean
|
||||||
// we enable/disable a bunch of widgits. And if we're going from
|
// we enable/disable a bunch of widgits. And if we're going from
|
||||||
// unlocked to locked we need to confirm that everything can be
|
// unlocked to locked we need to confirm that everything can be
|
||||||
|
@ -1329,23 +1269,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
m_gi.boardSize = positionToSize( position );
|
m_gi.boardSize = positionToSize( position );
|
||||||
m_gi.traySize = Integer.parseInt( m_traysizeSpinner.getSelectedItem().toString() );
|
m_gi.traySize = Integer.parseInt( m_traysizeSpinner.getSelectedItem().toString() );
|
||||||
|
|
||||||
if ( m_conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) {
|
|
||||||
m_car.ip_relay_seeksPublicRoom = m_joinPublicCheck.isChecked();
|
|
||||||
m_car.ip_relay_advertiseRoom =
|
|
||||||
getChecked( R.id.advertise_new_room_check );
|
|
||||||
if ( m_car.ip_relay_seeksPublicRoom ) {
|
|
||||||
SpinnerAdapter adapter = m_roomChoose.getAdapter();
|
|
||||||
if ( null != adapter ) {
|
|
||||||
int pos = m_roomChoose.getSelectedItemPosition();
|
|
||||||
if ( pos >= 0 && pos < adapter.getCount() ) {
|
|
||||||
m_car.ip_relay_invite = (String)adapter.getItem(pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
m_car.ip_relay_invite = getText( R.id.room_edit ).trim();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_car.conTypes = m_conTypes;
|
m_car.conTypes = m_conTypes;
|
||||||
} // saveChanges
|
} // saveChanges
|
||||||
|
|
||||||
|
@ -1381,13 +1304,13 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void refreshNames()
|
// private void refreshNames()
|
||||||
{
|
// {
|
||||||
if ( !m_isLocked ) {
|
// if ( !m_isLocked ) {
|
||||||
new RefreshNamesTask( m_activity, this, m_gi.dictLang,
|
// new RefreshNamesTask( m_activity, this, m_gi.dictLang,
|
||||||
m_gi.nPlayers, m_roomChoose ).execute();
|
// m_gi.nPlayers, m_roomChoose ).execute();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setTitle()
|
protected void setTitle()
|
||||||
|
@ -1432,48 +1355,4 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
findViewById( R.id.pick_faceup ).setVisibility( View.GONE );
|
findViewById( R.id.pick_faceup ).setVisibility( View.GONE );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupRelayStuffIf()
|
|
||||||
{
|
|
||||||
if ( m_conTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) {
|
|
||||||
boolean publicEnabled = XWPrefs.getPublicRoomsEnabled( m_activity );
|
|
||||||
int vis = publicEnabled ? View.VISIBLE : View.GONE;
|
|
||||||
if ( null == m_joinPublicCheck ) {
|
|
||||||
m_joinPublicCheck =
|
|
||||||
(CheckBox)findViewById(R.id.join_public_room_check);
|
|
||||||
m_joinPublicCheck.setVisibility( vis );
|
|
||||||
|
|
||||||
CheckBox advertise = (CheckBox)
|
|
||||||
findViewById( R.id.advertise_new_room_check );
|
|
||||||
advertise.setVisibility( vis );
|
|
||||||
if ( publicEnabled ) {
|
|
||||||
m_joinPublicCheck.setOnClickListener( this );
|
|
||||||
m_joinPublicCheck.setChecked( m_car.ip_relay_seeksPublicRoom );
|
|
||||||
advertise.setChecked( m_car.ip_relay_advertiseRoom );
|
|
||||||
m_publicRoomsSet =
|
|
||||||
(LinearLayout)findViewById(R.id.public_rooms_set );
|
|
||||||
m_privateRoomsSet =
|
|
||||||
(LinearLayout)findViewById(R.id.private_rooms_set );
|
|
||||||
}
|
|
||||||
|
|
||||||
setText( R.id.room_edit, m_car.ip_relay_invite );
|
|
||||||
|
|
||||||
m_roomChoose = (Spinner)findViewById( R.id.room_spinner );
|
|
||||||
m_roomChoose.setVisibility( vis );
|
|
||||||
|
|
||||||
m_refreshRoomsButton =
|
|
||||||
(ImageButton)findViewById( R.id.refresh_button );
|
|
||||||
m_refreshRoomsButton.setVisibility( vis );
|
|
||||||
m_refreshRoomsButton.setOnClickListener( this );
|
|
||||||
|
|
||||||
adjustConnectStuff();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showHideRelayStuff()
|
|
||||||
{
|
|
||||||
boolean show = m_conTypes.contains( CommsConnType.COMMS_CONN_RELAY );
|
|
||||||
m_connectSetRelay.setVisibility( show ? View.VISIBLE : View.GONE );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,143 +0,0 @@
|
||||||
/* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */
|
|
||||||
/*
|
|
||||||
* Copyright 2009 - 2012 by Eric House (xwords@eehouse.org). All
|
|
||||||
* rights reserved.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but
|
|
||||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.eehouse.android.xw4;
|
|
||||||
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
|
|
||||||
import org.eehouse.android.xw4.loc.LocUtils;
|
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
|
||||||
import java.io.DataOutputStream;
|
|
||||||
import java.net.Socket;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class RefreshNamesTask extends AsyncTask<Void, Void, String[]> {
|
|
||||||
private static final String TAG = RefreshNamesTask.class.getSimpleName();
|
|
||||||
|
|
||||||
public interface NoNameFound {
|
|
||||||
public void NoNameFound();
|
|
||||||
};
|
|
||||||
|
|
||||||
private Context m_context;
|
|
||||||
private Spinner m_resultSpinner;
|
|
||||||
private int m_lang;
|
|
||||||
private int m_nInGame;
|
|
||||||
private ProgressDialog m_progress;
|
|
||||||
private NoNameFound m_nnf;
|
|
||||||
|
|
||||||
public RefreshNamesTask( Context context, NoNameFound nnf,
|
|
||||||
int lang, int nInGame,
|
|
||||||
Spinner getsResults )
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
m_context = context;
|
|
||||||
m_nnf = nnf;
|
|
||||||
m_resultSpinner = getsResults;
|
|
||||||
m_lang = lang;
|
|
||||||
m_nInGame = nInGame;
|
|
||||||
|
|
||||||
String langName = DictLangCache.getLangName( context, lang );
|
|
||||||
langName = LocUtils.xlateLang( context, langName );
|
|
||||||
String msg = LocUtils.getString( context, R.string.public_names_progress_fmt,
|
|
||||||
nInGame, langName );
|
|
||||||
m_progress = ProgressDialog.show( context, msg, null, true, true );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String[] doInBackground( Void...unused )
|
|
||||||
{
|
|
||||||
ArrayList<String> names = new ArrayList<>();
|
|
||||||
Log.i( TAG, "doInBackground()" );
|
|
||||||
|
|
||||||
try {
|
|
||||||
Socket socket = NetUtils.makeProxySocket( m_context, 15000 );
|
|
||||||
if ( null != socket ) {
|
|
||||||
DataOutputStream outStream =
|
|
||||||
new DataOutputStream( socket.getOutputStream() );
|
|
||||||
|
|
||||||
outStream.writeShort( 4 ); // total packet length
|
|
||||||
outStream.writeByte( NetUtils.PROTOCOL_VERSION );
|
|
||||||
outStream.writeByte( NetUtils.PRX_PUB_ROOMS );
|
|
||||||
outStream.writeByte( (byte)m_lang );
|
|
||||||
outStream.writeByte( (byte)m_nInGame );
|
|
||||||
outStream.flush();
|
|
||||||
|
|
||||||
// read result -- will block
|
|
||||||
DataInputStream dis =
|
|
||||||
new DataInputStream(socket.getInputStream());
|
|
||||||
short len = dis.readShort();
|
|
||||||
short nRooms = dis.readShort();
|
|
||||||
Log.i( TAG, "doInBackground(): got %d rooms", nRooms );
|
|
||||||
|
|
||||||
// Can't figure out how to read a null-terminated string
|
|
||||||
// from DataInputStream so parse it myself.
|
|
||||||
byte[] bytes = new byte[len];
|
|
||||||
dis.readFully( bytes );
|
|
||||||
|
|
||||||
int index = -1;
|
|
||||||
for ( int ii = 0; ii < nRooms; ++ii ) {
|
|
||||||
int lastIndex = ++index; // skip the null
|
|
||||||
while ( bytes[index] != '\n' ) {
|
|
||||||
++index;
|
|
||||||
}
|
|
||||||
String name = new String( bytes, lastIndex, index - lastIndex );
|
|
||||||
Log.i( TAG, "got public room name: %s", name );
|
|
||||||
int indx = name.lastIndexOf( "/" );
|
|
||||||
indx = name.lastIndexOf( "/", indx-1 );
|
|
||||||
names.add( name.substring(0, indx ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch ( java.io.IOException ioe ) {
|
|
||||||
Log.ex( TAG, ioe );
|
|
||||||
}
|
|
||||||
Log.i( TAG, "doInBackground() returning" );
|
|
||||||
return names.toArray( new String[names.size()] );
|
|
||||||
}
|
|
||||||
|
|
||||||
// protected void onProgressUpdate(Integer... progress) {
|
|
||||||
// setProgressPercent(progress[0]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute( String[] result )
|
|
||||||
{
|
|
||||||
Log.i( TAG, "onPostExecute()" );
|
|
||||||
ArrayAdapter<String> adapter =
|
|
||||||
new ArrayAdapter<>( m_context,
|
|
||||||
android.R.layout.simple_spinner_item,
|
|
||||||
result );
|
|
||||||
int resID = android.R.layout.simple_spinner_dropdown_item;
|
|
||||||
adapter.setDropDownViewResource( resID );
|
|
||||||
m_resultSpinner.setAdapter( adapter );
|
|
||||||
|
|
||||||
m_progress.cancel();
|
|
||||||
|
|
||||||
if ( result.length == 0 ) {
|
|
||||||
m_nnf.NoNameFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.i( TAG, "onPostExecute() done" );
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -103,11 +103,6 @@ public class XWPrefs {
|
||||||
false );
|
false );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean getPublicRoomsEnabled( Context context )
|
|
||||||
{
|
|
||||||
return getPrefsBoolean( context, R.string.key_enable_pubroom, false );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setHideNewgameButtons( Context context, boolean set )
|
public static void setHideNewgameButtons( Context context, boolean set )
|
||||||
{
|
{
|
||||||
setPrefsBoolean( context, R.string.key_hide_newgames, set );
|
setPrefsBoolean( context, R.string.key_hide_newgames, set );
|
||||||
|
|
|
@ -105,81 +105,6 @@
|
||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/connect_set_relay"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
>
|
|
||||||
<!-- We'll use either the spinner or simple edit text
|
|
||||||
depending on whether user is naming room or picking from
|
|
||||||
a set one. -->
|
|
||||||
<CheckBox android:id="@+id/join_public_room_check"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/join_room"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/private_rooms_set"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
>
|
|
||||||
<TextView android:layout_height="wrap_content"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:text="@string/new_room_hint"
|
|
||||||
android:gravity="left"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- maxLength derives from MAX_INVITE_LEN in xwrelay.h -->
|
|
||||||
<EditText android:id="@+id/room_edit"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:scrollHorizontally="false"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:inputType="text"
|
|
||||||
android:selectAllOnFocus="true"
|
|
||||||
android:windowSoftInputMode="stateHidden"
|
|
||||||
android:maxLength="31"
|
|
||||||
android:hint="@string/new_room_hint"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<CheckBox android:id="@+id/advertise_new_room_check"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/room_public"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/public_rooms_set"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
>
|
|
||||||
<Spinner android:id="@+id/room_spinner"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:drawSelectorOnTop="true"
|
|
||||||
android:gravity="left"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:prompt="@string/room_public_prompt"
|
|
||||||
/>
|
|
||||||
<ImageButton android:id="@+id/refresh_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:src="@drawable/refresh"
|
|
||||||
android:gravity="right"
|
|
||||||
android:layout_weight="0"
|
|
||||||
/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout> <!--connect_set_relay-->
|
|
||||||
|
|
||||||
<Button android:id="@+id/change_connection"
|
<Button android:id="@+id/change_connection"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
<string name="key_hide_values">key_hide_values</string>
|
<string name="key_hide_values">key_hide_values</string>
|
||||||
<string name="key_hide_title">key_hide_title</string>
|
<string name="key_hide_title">key_hide_title</string>
|
||||||
<string name="key_hide_newgames">key_hide_newgames</string>
|
<string name="key_hide_newgames">key_hide_newgames</string>
|
||||||
<string name="key_enable_pubroom">key_enable_pubroom</string>
|
|
||||||
|
|
||||||
<string name="key_player0">key_clr_player0</string>
|
<string name="key_player0">key_clr_player0</string>
|
||||||
<string name="key_player1">key_clr_player1</string>
|
<string name="key_player1">key_clr_player1</string>
|
||||||
|
|
|
@ -295,27 +295,7 @@
|
||||||
<string name="langdict_label">Game language/wordlist</string>
|
<string name="langdict_label">Game language/wordlist</string>
|
||||||
<!-- text of separator marking out the connection area of the dialog -->
|
<!-- text of separator marking out the connection area of the dialog -->
|
||||||
<string name="connect_label_fmt">Connection (via %1$s)</string>
|
<string name="connect_label_fmt">Connection (via %1$s)</string>
|
||||||
<!-- text of checkbox asking if user wants to search for open
|
|
||||||
public rooms -->
|
|
||||||
<string name="join_room">Join public room</string>
|
|
||||||
<!-- hint (text shown when field is empty) for room name field -->
|
|
||||||
<string name="new_room_hint">Room name</string>
|
|
||||||
<!-- text of checkbox -->
|
|
||||||
<string name="room_public">Make new room public</string>
|
|
||||||
<!-- title for popup of public rooms found on server -->
|
|
||||||
<string name="room_public_prompt">Select public room</string>
|
|
||||||
<!-- If you check the join_room checkbox CrossWords queries the
|
|
||||||
relay. This is the text of the progress indicator displayed what
|
|
||||||
that's going on. (It's often visible for only a very short
|
|
||||||
time.)-->
|
|
||||||
<string name="public_names_progress_fmt">Fetching public rooms for
|
|
||||||
%1$d-player games in %2$s.</string>
|
|
||||||
<!-- If the query returns no rooms, this message is displayed,
|
|
||||||
with the number of players in the game and its language
|
|
||||||
substituted. -->
|
|
||||||
<string name="no_name_found_fmt">No public rooms found for
|
|
||||||
%1$d-player games in %2$s. Try refreshing or creating your
|
|
||||||
own.</string>
|
|
||||||
<!-- text of separator marking out other-setting area of the dialog -->
|
<!-- text of separator marking out other-setting area of the dialog -->
|
||||||
<string name="settings_label">Other settings</string>
|
<string name="settings_label">Other settings</string>
|
||||||
<!-- text of checkbox. If this checkbox is checked, buttons will
|
<!-- text of checkbox. If this checkbox is checked, buttons will
|
||||||
|
@ -2278,8 +2258,6 @@
|
||||||
<string name="network_advanced_summary">For experienced players</string>
|
<string name="network_advanced_summary">For experienced players</string>
|
||||||
<string name="invite_multi_title">Invite multiple</string>
|
<string name="invite_multi_title">Invite multiple</string>
|
||||||
<string name="invite_multi_summary">Invite more than one player per remote device</string>
|
<string name="invite_multi_summary">Invite more than one player per remote device</string>
|
||||||
<string name="enable_pubroom_title">Enable public rooms</string>
|
|
||||||
<string name="enable_pubroom_summary">Rooms others can see and join</string>
|
|
||||||
<string name="connection_via_label">Change Communicate via</string>
|
<string name="connection_via_label">Change Communicate via</string>
|
||||||
<string name="set_pref">Hide buttons</string>
|
<string name="set_pref">Hide buttons</string>
|
||||||
<string name="not_again_hidenewgamebuttons">The two buttons at the
|
<string name="not_again_hidenewgamebuttons">The two buttons at the
|
||||||
|
|
|
@ -6,11 +6,6 @@
|
||||||
<PreferenceCategory android:title="@string/network_advanced_title"
|
<PreferenceCategory android:title="@string/network_advanced_title"
|
||||||
android:summary="@string/network_advanced_summary"
|
android:summary="@string/network_advanced_summary"
|
||||||
>
|
>
|
||||||
<CheckBoxPreference android:key="@string/key_enable_pubroom"
|
|
||||||
android:title="@string/enable_pubroom_title"
|
|
||||||
android:summary="@string/enable_pubroom_summary"
|
|
||||||
android:defaultValue="false"
|
|
||||||
/>
|
|
||||||
<CheckBoxPreference android:key="@string/key_invite_multi"
|
<CheckBoxPreference android:key="@string/key_invite_multi"
|
||||||
android:title="@string/invite_multi_title"
|
android:title="@string/invite_multi_title"
|
||||||
android:summary="@string/invite_multi_summary"
|
android:summary="@string/invite_multi_summary"
|
||||||
|
|
Loading…
Reference in a new issue