mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-01 19:57:11 +01:00
cleanup: use AlertDialog not Dialog
This commit is contained in:
parent
5c09d9b9a4
commit
9804594237
3 changed files with 9 additions and 12 deletions
|
@ -22,7 +22,6 @@ package org.eehouse.android.xw4;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -92,7 +91,7 @@ public class DlgDelegateAlert extends XWDialogFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Dialog create( AlertDialog.Builder builder ) { return builder.create(); }
|
AlertDialog create( AlertDialog.Builder builder ) { return builder.create(); }
|
||||||
|
|
||||||
private NotAgainView addNAView( DlgState state, AlertDialog.Builder builder )
|
private NotAgainView addNAView( DlgState state, AlertDialog.Builder builder )
|
||||||
{
|
{
|
||||||
|
@ -109,7 +108,7 @@ public class DlgDelegateAlert extends XWDialogFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final Dialog onCreateDialog( Bundle sis )
|
public final AlertDialog onCreateDialog( Bundle sis )
|
||||||
{
|
{
|
||||||
Context context = getActivity();
|
Context context = getActivity();
|
||||||
DlgState state = getState( sis );
|
DlgState state = getState( sis );
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
package org.eehouse.android.xw4;
|
package org.eehouse.android.xw4;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -56,7 +55,7 @@ public class EnableSMSAlert extends DlgDelegateAlert {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected( AdapterView<?> parent, View view,
|
public void onItemSelected( AdapterView<?> parent, View view,
|
||||||
int position, long id ) {
|
int position, long id ) {
|
||||||
checkEnableButton( getDialog() );
|
checkEnableButton( (AlertDialog)getDialog() );
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onNothingSelected( AdapterView<?> parent ) {}
|
public void onNothingSelected( AdapterView<?> parent ) {}
|
||||||
|
@ -80,20 +79,20 @@ public class EnableSMSAlert extends DlgDelegateAlert {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
Dialog create( AlertDialog.Builder builder )
|
AlertDialog create( AlertDialog.Builder builder )
|
||||||
{
|
{
|
||||||
Dialog dialog = super.create( builder );
|
AlertDialog dialog = super.create( builder );
|
||||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onShow( DialogInterface dialog ) {
|
public void onShow( DialogInterface dialog ) {
|
||||||
checkEnableButton( (Dialog)dialog );
|
checkEnableButton( (AlertDialog)dialog );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkEnableButton( Dialog dialog )
|
private void checkEnableButton( AlertDialog dialog )
|
||||||
{
|
{
|
||||||
boolean enabled = 0 < mSpinner.getSelectedItemPosition();
|
boolean enabled = 0 < mSpinner.getSelectedItemPosition();
|
||||||
((AlertDialog)dialog)
|
((AlertDialog)dialog)
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
package org.eehouse.android.xw4;
|
package org.eehouse.android.xw4;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -181,9 +180,9 @@ public class InviteChoicesAlert extends DlgDelegateAlert
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
Dialog create( AlertDialog.Builder builder )
|
AlertDialog create( AlertDialog.Builder builder )
|
||||||
{
|
{
|
||||||
Dialog dialog = super.create( builder );
|
AlertDialog dialog = super.create( builder );
|
||||||
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onShow( DialogInterface diface ) {
|
public void onShow( DialogInterface diface ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue