mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +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 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
|
||||
protected void onCreate( Bundle savedInstanceState )
|
||||
{
|
||||
|
|
|
@ -847,12 +847,12 @@ public class BoardActivity extends XWActivity
|
|||
doSyncMenuitem();
|
||||
break;
|
||||
case BT_PICK_ACTION:
|
||||
GameUtils.launchBTInviter( this, m_nMissingPlayers,
|
||||
BT_INVITE_RESULT );
|
||||
BTInviteActivity.launchForResult( this, m_nMissingPlayers,
|
||||
BT_INVITE_RESULT );
|
||||
break;
|
||||
case SMS_PICK_ACTION:
|
||||
GameUtils.launchSMSInviter( this, m_nMissingPlayers,
|
||||
SMS_INVITE_RESULT );
|
||||
SMSInviteActivity.launchForResult( this, m_nMissingPlayers,
|
||||
SMS_INVITE_RESULT );
|
||||
break;
|
||||
case SMS_CONFIG_ACTION:
|
||||
Utils.launchSettings( this );
|
||||
|
|
|
@ -508,22 +508,6 @@ public class GameUtils {
|
|||
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,
|
||||
boolean choseEmail,
|
||||
String room, String inviteID,
|
||||
|
|
|
@ -43,7 +43,7 @@ abstract class InviteActivity extends XWListActivity
|
|||
implements View.OnClickListener {
|
||||
|
||||
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 Button m_okButton;
|
||||
|
|
|
@ -357,7 +357,7 @@ public class NewGameActivity extends XWActivity {
|
|||
intent.putExtra( GameUtils.INTENT_FORRESULT_ROWID, true );
|
||||
startActivityForResult( intent, CONFIG_FOR_BT );
|
||||
} 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 );
|
||||
startActivityForResult( intent, CONFIG_FOR_SMS );
|
||||
} 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;
|
||||
import android.provider.ContactsContract;
|
||||
import android.text.method.DialerKeyListener;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.text.method.DialerKeyListener;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CompoundButton;
|
||||
|
@ -64,6 +64,14 @@ public class SMSInviteActivity extends InviteActivity {
|
|||
private String m_pendingNumber;
|
||||
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
|
||||
protected void onCreate( Bundle savedInstanceState )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue