mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
toward adding name to config and transmitting it
This commit is contained in:
parent
828f8b3af3
commit
4f8afadb25
3 changed files with 26 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
/* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */
|
/* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */
|
||||||
/*
|
/*
|
||||||
* Copyright 2009 - 2020 by Eric House (xwords@eehouse.org). All rights
|
* Copyright 2009 - 2022 by Eric House (xwords@eehouse.org). All rights
|
||||||
* reserved.
|
* reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
|
@ -36,6 +36,7 @@ import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.EditText;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
@ -65,6 +66,7 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
private static final String TAG = GameConfigDelegate.class.getSimpleName();
|
private static final String TAG = GameConfigDelegate.class.getSimpleName();
|
||||||
|
|
||||||
private static final String INTENT_FORRESULT_SOLO = "solo";
|
private static final String INTENT_FORRESULT_SOLO = "solo";
|
||||||
|
private static final String INTENT_FORRESULT_NAME = "name";
|
||||||
private static final String WHICH_PLAYER = "WHICH_PLAYER";
|
private static final String WHICH_PLAYER = "WHICH_PLAYER";
|
||||||
private static final String LOCAL_GI = "LOCAL_GI";
|
private static final String LOCAL_GI = "LOCAL_GI";
|
||||||
private static final String LOCAL_TYPES = "LOCAL_TYPES";
|
private static final String LOCAL_TYPES = "LOCAL_TYPES";
|
||||||
|
@ -88,6 +90,7 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
private long m_rowid;
|
private long m_rowid;
|
||||||
private boolean m_isNewGame;
|
private boolean m_isNewGame;
|
||||||
private boolean m_newGameIsSolo; // only used if m_isNewGame is true
|
private boolean m_newGameIsSolo; // only used if m_isNewGame is true
|
||||||
|
private String m_newGameName;
|
||||||
private CurGameInfo m_gi;
|
private CurGameInfo m_gi;
|
||||||
private CurGameInfo m_giOrig;
|
private CurGameInfo m_giOrig;
|
||||||
private JNIThread m_jniThread;
|
private JNIThread m_jniThread;
|
||||||
|
@ -486,6 +489,7 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, DBUtils.ROWID_NOTFOUND );
|
m_rowid = args.getLong( GameUtils.INTENT_KEY_ROWID, DBUtils.ROWID_NOTFOUND );
|
||||||
m_newGameIsSolo = args.getBoolean( INTENT_FORRESULT_SOLO, false );
|
m_newGameIsSolo = args.getBoolean( INTENT_FORRESULT_SOLO, false );
|
||||||
|
m_newGameName = args.getString( INTENT_FORRESULT_NAME );
|
||||||
m_isNewGame = DBUtils.ROWID_NOTFOUND == m_rowid;
|
m_isNewGame = DBUtils.ROWID_NOTFOUND == m_rowid;
|
||||||
|
|
||||||
m_addPlayerButton = (Button)findViewById(R.id.add_player);
|
m_addPlayerButton = (Button)findViewById(R.id.add_player);
|
||||||
|
@ -663,6 +667,8 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
setConnLabel();
|
setConnLabel();
|
||||||
loadPlayersList();
|
loadPlayersList();
|
||||||
configLangSpinner();
|
configLangSpinner();
|
||||||
|
EditText et = (EditText)findViewById( R.id.name_edit );
|
||||||
|
et.setText( m_newGameName );
|
||||||
|
|
||||||
m_phoniesSpinner.setSelection( m_gi.phoniesAction.ordinal() );
|
m_phoniesSpinner.setSelection( m_gi.phoniesAction.ordinal() );
|
||||||
|
|
||||||
|
@ -910,7 +916,8 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
// we can insert later.
|
// we can insert later.
|
||||||
intent.putExtra( INTENT_KEY_SADDR, m_car );
|
intent.putExtra( INTENT_KEY_SADDR, m_car );
|
||||||
// Game name should be a field in this layout
|
// Game name should be a field in this layout
|
||||||
intent.putExtra( INTENT_KEY_NAME, "Config Me" );
|
EditText et = (EditText)findViewById( R.id.name_edit );
|
||||||
|
intent.putExtra( INTENT_KEY_NAME, et.getText().toString() );
|
||||||
} else {
|
} else {
|
||||||
intent.putExtra( GameUtils.INTENT_KEY_ROWID, m_rowid );
|
intent.putExtra( GameUtils.INTENT_KEY_ROWID, m_rowid );
|
||||||
}
|
}
|
||||||
|
@ -1357,9 +1364,10 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
|
|
||||||
public static void configNewForResult( Delegator delegator,
|
public static void configNewForResult( Delegator delegator,
|
||||||
RequestCode requestCode,
|
RequestCode requestCode,
|
||||||
boolean solo )
|
String name, boolean solo )
|
||||||
{
|
{
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putSerializable( INTENT_FORRESULT_NAME, name );
|
||||||
bundle.putBoolean( INTENT_FORRESULT_SOLO, solo );
|
bundle.putBoolean( INTENT_FORRESULT_SOLO, solo );
|
||||||
|
|
||||||
delegator
|
delegator
|
||||||
|
|
|
@ -3139,7 +3139,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
if ( doConfigure ) {
|
if ( doConfigure ) {
|
||||||
GameConfigDelegate.configNewForResult( getDelegator(),
|
GameConfigDelegate.configNewForResult( getDelegator(),
|
||||||
RequestCode.CONFIG_GAME,
|
RequestCode.CONFIG_GAME,
|
||||||
m_mySIS.nextIsSolo );
|
name, m_mySIS.nextIsSolo );
|
||||||
} else {
|
} else {
|
||||||
long rowID;
|
long rowID;
|
||||||
long groupID = 1 == m_mySIS.selGroupIDs.size()
|
long groupID = 1 == m_mySIS.selGroupIDs.size()
|
||||||
|
|
|
@ -52,6 +52,20 @@
|
||||||
android:layout_margin="4dp"
|
android:layout_margin="4dp"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
<LinearLayout android:orientation="horizontal"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
>
|
||||||
|
<TextView android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/game_name_label"
|
||||||
|
/>
|
||||||
|
<EditText android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/name_edit"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView style="@style/config_separator"
|
<TextView style="@style/config_separator"
|
||||||
android:id="@+id/lang_separator"
|
android:id="@+id/lang_separator"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in a new issue