mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +01:00
move methods toward better encapsualtion (no behavior change)
This commit is contained in:
parent
ad606cdec0
commit
c041792f83
6 changed files with 24 additions and 24 deletions
|
@ -45,6 +45,14 @@ public class BTInviteActivity extends InviteActivity
|
||||||
private boolean m_firstScan;
|
private boolean m_firstScan;
|
||||||
private int m_checkCount;
|
private int m_checkCount;
|
||||||
|
|
||||||
|
public static void launchForResult( Activity activity, int nMissing,
|
||||||
|
int requestCode )
|
||||||
|
{
|
||||||
|
Intent intent = new Intent( activity, BTInviteActivity.class );
|
||||||
|
intent.putExtra( INTENT_KEY_NMISSING, nMissing );
|
||||||
|
activity.startActivityForResult( intent, requestCode );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate( Bundle savedInstanceState )
|
protected void onCreate( Bundle savedInstanceState )
|
||||||
{
|
{
|
||||||
|
|
|
@ -847,11 +847,11 @@ public class BoardActivity extends XWActivity
|
||||||
doSyncMenuitem();
|
doSyncMenuitem();
|
||||||
break;
|
break;
|
||||||
case BT_PICK_ACTION:
|
case BT_PICK_ACTION:
|
||||||
GameUtils.launchBTInviter( this, m_nMissingPlayers,
|
BTInviteActivity.launchForResult( this, m_nMissingPlayers,
|
||||||
BT_INVITE_RESULT );
|
BT_INVITE_RESULT );
|
||||||
break;
|
break;
|
||||||
case SMS_PICK_ACTION:
|
case SMS_PICK_ACTION:
|
||||||
GameUtils.launchSMSInviter( this, m_nMissingPlayers,
|
SMSInviteActivity.launchForResult( this, m_nMissingPlayers,
|
||||||
SMS_INVITE_RESULT );
|
SMS_INVITE_RESULT );
|
||||||
break;
|
break;
|
||||||
case SMS_CONFIG_ACTION:
|
case SMS_CONFIG_ACTION:
|
||||||
|
|
|
@ -508,22 +508,6 @@ public class GameUtils {
|
||||||
nPlayersH, null, gameID, isHost );
|
nPlayersH, null, gameID, isHost );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void launchBTInviter( Activity activity, int nMissing,
|
|
||||||
int requestCode )
|
|
||||||
{
|
|
||||||
Intent intent = new Intent( activity, BTInviteActivity.class );
|
|
||||||
intent.putExtra( BTInviteActivity.INTENT_KEY_NMISSING, nMissing );
|
|
||||||
activity.startActivityForResult( intent, requestCode );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void launchSMSInviter( Activity activity, int nMissing,
|
|
||||||
int requestCode )
|
|
||||||
{
|
|
||||||
Intent intent = new Intent( activity, SMSInviteActivity.class );
|
|
||||||
intent.putExtra( SMSInviteActivity.INTENT_KEY_NMISSING, nMissing );
|
|
||||||
activity.startActivityForResult( intent, requestCode );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void launchInviteActivity( Context context,
|
public static void launchInviteActivity( Context context,
|
||||||
boolean choseEmail,
|
boolean choseEmail,
|
||||||
String room, String inviteID,
|
String room, String inviteID,
|
||||||
|
|
|
@ -43,7 +43,7 @@ abstract class InviteActivity extends XWListActivity
|
||||||
implements View.OnClickListener {
|
implements View.OnClickListener {
|
||||||
|
|
||||||
public static final String DEVS = "DEVS";
|
public static final String DEVS = "DEVS";
|
||||||
public static final String INTENT_KEY_NMISSING = "NMISSING";
|
protected static final String INTENT_KEY_NMISSING = "NMISSING";
|
||||||
|
|
||||||
protected int m_nMissing;
|
protected int m_nMissing;
|
||||||
protected Button m_okButton;
|
protected Button m_okButton;
|
||||||
|
|
|
@ -357,7 +357,7 @@ public class NewGameActivity extends XWActivity {
|
||||||
intent.putExtra( GameUtils.INTENT_FORRESULT_ROWID, true );
|
intent.putExtra( GameUtils.INTENT_FORRESULT_ROWID, true );
|
||||||
startActivityForResult( intent, CONFIG_FOR_BT );
|
startActivityForResult( intent, CONFIG_FOR_BT );
|
||||||
} else {
|
} else {
|
||||||
GameUtils.launchBTInviter( this, 1, INVITE_FOR_BT );
|
BTInviteActivity.launchForResult( this, 1, INVITE_FOR_BT );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,7 +378,7 @@ public class NewGameActivity extends XWActivity {
|
||||||
intent.putExtra( GameUtils.INTENT_FORRESULT_ROWID, true );
|
intent.putExtra( GameUtils.INTENT_FORRESULT_ROWID, true );
|
||||||
startActivityForResult( intent, CONFIG_FOR_SMS );
|
startActivityForResult( intent, CONFIG_FOR_SMS );
|
||||||
} else {
|
} else {
|
||||||
GameUtils.launchSMSInviter( this, 1, INVITE_FOR_SMS );
|
SMSInviteActivity.launchForResult( this, 1, INVITE_FOR_SMS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,9 @@ import android.os.Bundle;
|
||||||
import android.provider.ContactsContract.CommonDataKinds.Phone;
|
import android.provider.ContactsContract.CommonDataKinds.Phone;
|
||||||
import android.provider.ContactsContract.CommonDataKinds;
|
import android.provider.ContactsContract.CommonDataKinds;
|
||||||
import android.provider.ContactsContract;
|
import android.provider.ContactsContract;
|
||||||
import android.text.method.DialerKeyListener;
|
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
|
import android.text.method.DialerKeyListener;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
|
@ -64,6 +64,14 @@ public class SMSInviteActivity extends InviteActivity {
|
||||||
private String m_pendingNumber;
|
private String m_pendingNumber;
|
||||||
private boolean m_immobileConfirmed;
|
private boolean m_immobileConfirmed;
|
||||||
|
|
||||||
|
public static void launchForResult( Activity activity, int nMissing,
|
||||||
|
int requestCode )
|
||||||
|
{
|
||||||
|
Intent intent = new Intent( activity, SMSInviteActivity.class );
|
||||||
|
intent.putExtra( INTENT_KEY_NMISSING, nMissing );
|
||||||
|
activity.startActivityForResult( intent, requestCode );
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate( Bundle savedInstanceState )
|
protected void onCreate( Bundle savedInstanceState )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue