invitations: track multiple per device in superclass

This commit is contained in:
Eric House 2016-12-15 07:10:54 -08:00
parent 502888ee03
commit f8bba60798
5 changed files with 12 additions and 14 deletions

View file

@ -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] );
}

View file

@ -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 );

View file

@ -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();
}

View file

@ -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 );

View file

@ -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;
}
}