mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +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.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
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 )
|
||||
{
|
||||
|
@ -109,7 +108,7 @@ public class DlgDelegateAlert extends XWDialogFragment {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final Dialog onCreateDialog( Bundle sis )
|
||||
public final AlertDialog onCreateDialog( Bundle sis )
|
||||
{
|
||||
Context context = getActivity();
|
||||
DlgState state = getState( sis );
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.eehouse.android.xw4;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
|
@ -56,7 +55,7 @@ public class EnableSMSAlert extends DlgDelegateAlert {
|
|||
@Override
|
||||
public void onItemSelected( AdapterView<?> parent, View view,
|
||||
int position, long id ) {
|
||||
checkEnableButton( getDialog() );
|
||||
checkEnableButton( (AlertDialog)getDialog() );
|
||||
}
|
||||
@Override
|
||||
public void onNothingSelected( AdapterView<?> parent ) {}
|
||||
|
@ -80,20 +79,20 @@ public class EnableSMSAlert extends DlgDelegateAlert {
|
|||
}
|
||||
|
||||
@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() {
|
||||
@Override
|
||||
public void onShow( DialogInterface dialog ) {
|
||||
checkEnableButton( (Dialog)dialog );
|
||||
checkEnableButton( (AlertDialog)dialog );
|
||||
}
|
||||
});
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
private void checkEnableButton( Dialog dialog )
|
||||
private void checkEnableButton( AlertDialog dialog )
|
||||
{
|
||||
boolean enabled = 0 < mSpinner.getSelectedItemPosition();
|
||||
((AlertDialog)dialog)
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.eehouse.android.xw4;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -181,9 +180,9 @@ public class InviteChoicesAlert extends DlgDelegateAlert
|
|||
}
|
||||
|
||||
@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() {
|
||||
@Override
|
||||
public void onShow( DialogInterface diface ) {
|
||||
|
|
Loading…
Reference in a new issue