mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
invitations: track multiple per device in superclass
This commit is contained in:
parent
502888ee03
commit
f8bba60798
5 changed files with 12 additions and 14 deletions
|
@ -142,11 +142,10 @@ public class BTInviteDelegate extends InviteDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void listSelected( InviterItem[] selected, String[] devs, int[] counts )
|
||||
protected void listSelected( InviterItem[] selected, String[] devs )
|
||||
{
|
||||
for ( int ii = 0; ii < selected.length; ++ii ) {
|
||||
TwoStringPair rec = (TwoStringPair)selected[ii];
|
||||
counts[ii] = 1; // rec.m_nPlayers;
|
||||
devs[ii] = rec.str1;
|
||||
DbgUtils.logd( TAG, "selecting address %s", devs[ii] );
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ abstract class InviteDelegate extends ListDelegateBase
|
|||
|
||||
// Children implement ...
|
||||
abstract void onChildAdded( View child, InviterItem item );
|
||||
abstract void listSelected( InviterItem[] selected, String[] devsP, int[] countsP );
|
||||
abstract void listSelected( InviterItem[] selected, String[] devs );
|
||||
|
||||
public static final String DEVS = "DEVS";
|
||||
public static final String COUNTS = "COUNTS";
|
||||
|
@ -166,9 +166,14 @@ abstract class InviteDelegate extends ListDelegateBase
|
|||
if ( m_inviteButton == view ) {
|
||||
int len = m_checked.size();
|
||||
String[] devs = new String[len];
|
||||
int[] counts = new int[len];
|
||||
|
||||
listSelected( getSelItems(), devs, counts );
|
||||
InviterItem[] items = getSelItems();
|
||||
listSelected( items, devs );
|
||||
|
||||
int[] counts = new int[len];
|
||||
for ( int ii = 0; ii < len; ++ii ) {
|
||||
counts[ii] = m_counts.get( items[ii] );
|
||||
}
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( DEVS, devs );
|
||||
|
|
|
@ -208,7 +208,7 @@ public class RelayInviteDelegate extends InviteDelegate {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void listSelected( InviterItem[] selected, String[] devsP, int[] countsP )
|
||||
public void listSelected( InviterItem[] selected, String[] devsP )
|
||||
{
|
||||
Assert.fail();
|
||||
}
|
||||
|
|
|
@ -192,12 +192,10 @@ public class SMSInviteDelegate extends InviteDelegate
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void listSelected( InviterItem[] selected, String[] devs,
|
||||
int[] counts )
|
||||
protected void listSelected( InviterItem[] selected, String[] devs )
|
||||
{
|
||||
for ( int ii = 0; ii < selected.length; ++ii ) {
|
||||
PhoneRec rec = (PhoneRec)selected[ii];
|
||||
counts[ii] = rec.m_nPlayers;
|
||||
devs[ii] = rec.m_phone;
|
||||
}
|
||||
}
|
||||
|
@ -372,7 +370,6 @@ public class SMSInviteDelegate extends InviteDelegate
|
|||
public String m_phone;
|
||||
public String m_name;
|
||||
public boolean m_isChecked;
|
||||
public int m_nPlayers;
|
||||
public PhoneRec( String name, String phone )
|
||||
{
|
||||
this( name, phone, false );
|
||||
|
@ -386,7 +383,6 @@ public class SMSInviteDelegate extends InviteDelegate
|
|||
{
|
||||
m_phone = phone;
|
||||
m_isChecked = checked;
|
||||
m_nPlayers = 1;
|
||||
|
||||
if ( null == name ) {
|
||||
name = Utils.phoneToContact( m_activity, phone, false );
|
||||
|
|
|
@ -86,12 +86,10 @@ public class WiDirInviteDelegate extends InviteDelegate
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void listSelected( InviterItem[] selected, String[] devs,
|
||||
int[] counts )
|
||||
protected void listSelected( InviterItem[] selected, String[] devs )
|
||||
{
|
||||
for ( int ii = 0; ii < selected.length; ++ii ) {
|
||||
TwoStringPair pair = (TwoStringPair)selected[ii];
|
||||
counts[ii] = 1;// rec.m_nPlayers;
|
||||
devs[ii] = pair.str1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue