mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +01:00
display the Banned alert from invite-choice dialog
This commit is contained in:
parent
8cb53eb884
commit
a093dae712
2 changed files with 17 additions and 3 deletions
|
@ -32,13 +32,14 @@ import android.widget.Button;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eehouse.android.xw4.DBUtils.SentInvitesInfo;
|
||||||
import org.eehouse.android.xw4.DlgDelegate.Action;
|
import org.eehouse.android.xw4.DlgDelegate.Action;
|
||||||
import org.eehouse.android.xw4.DlgDelegate.ActionPair;
|
import org.eehouse.android.xw4.DlgDelegate.ActionPair;
|
||||||
|
import org.eehouse.android.xw4.DlgDelegate.ConfirmThenBuilder;
|
||||||
import org.eehouse.android.xw4.DlgDelegate.DlgClickNotify.InviteMeans;
|
import org.eehouse.android.xw4.DlgDelegate.DlgClickNotify.InviteMeans;
|
||||||
import org.eehouse.android.xw4.DlgDelegate.NotAgainBuilder;
|
import org.eehouse.android.xw4.DlgDelegate.NotAgainBuilder;
|
||||||
import org.eehouse.android.xw4.DlgDelegate.ConfirmThenBuilder;
|
import org.eehouse.android.xw4.Perms23.Perm;
|
||||||
import org.eehouse.android.xw4.loc.LocUtils;
|
import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
import org.eehouse.android.xw4.DBUtils.SentInvitesInfo;
|
|
||||||
|
|
||||||
public class InviteChoicesAlert extends DlgDelegateAlert {
|
public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
|
|
||||||
|
@ -117,7 +118,14 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
.show();
|
.show();
|
||||||
break;
|
break;
|
||||||
case SMS_DATA:
|
case SMS_DATA:
|
||||||
if ( ! XWPrefs.getNBSEnabled( context ) ) {
|
if ( !Perms23.havePermissions( activity, Perm.SEND_SMS, Perm.RECEIVE_SMS )
|
||||||
|
&& Perm.SEND_SMS.isBanned() ) {
|
||||||
|
activity
|
||||||
|
.makeOkOnlyBuilder( R.string.sms_banned_ok_only )
|
||||||
|
.setActionPair(new ActionPair( Action.PERMS_BANNED_INFO,
|
||||||
|
R.string.button_more_info ) )
|
||||||
|
.show();
|
||||||
|
} else if ( ! XWPrefs.getNBSEnabled( context ) ) {
|
||||||
activity
|
activity
|
||||||
.makeConfirmThenBuilder( R.string.warn_sms_disabled,
|
.makeConfirmThenBuilder( R.string.warn_sms_disabled,
|
||||||
Action.ENABLE_NBS_ASK )
|
Action.ENABLE_NBS_ASK )
|
||||||
|
@ -127,6 +135,7 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Button button = ((AlertDialog)dlg)
|
Button button = ((AlertDialog)dlg)
|
||||||
.getButton( AlertDialog.BUTTON_POSITIVE );
|
.getButton( AlertDialog.BUTTON_POSITIVE );
|
||||||
button.setEnabled( true );
|
button.setEnabled( true );
|
||||||
|
|
|
@ -221,6 +221,11 @@ public class XWActivity extends FragmentActivity
|
||||||
return m_dlgt.makeConfirmThenBuilder( msgID, action );
|
return m_dlgt.makeConfirmThenBuilder( msgID, action );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DlgDelegate.OkOnlyBuilder makeOkOnlyBuilder( int msgID )
|
||||||
|
{
|
||||||
|
return m_dlgt.makeOkOnlyBuilder( msgID );
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Delegator interface
|
// Delegator interface
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in a new issue