mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-24 07:58:34 +01:00
fix invite-how alert not scrolling
By setting a custom view I wasn't using I broke scrolling of the AlertDialog's list view which I was using. Known bug apparently....
This commit is contained in:
parent
19fa3fce05
commit
163eaf9612
6 changed files with 23 additions and 22 deletions
|
@ -41,9 +41,9 @@ public class ConfirmThenAlert extends DlgDelegateAlert {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populateBuilder( Context context, DlgState state,
|
public void populateBuilder( Context context, DlgState state,
|
||||||
AlertDialog.Builder builder,
|
AlertDialog.Builder builder )
|
||||||
NotAgainView naView )
|
|
||||||
{
|
{
|
||||||
|
NotAgainView naView = addNAView( state, builder );
|
||||||
OnClickListener lstnr = mkCallbackClickListener( naView );
|
OnClickListener lstnr = mkCallbackClickListener( naView );
|
||||||
|
|
||||||
builder.setTitle( state.m_titleId == 0 ? R.string.query_title : state.m_titleId )
|
builder.setTitle( state.m_titleId == 0 ? R.string.query_title : state.m_titleId )
|
||||||
|
|
|
@ -64,27 +64,32 @@ abstract class DlgDelegateAlert extends XWDialogFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract void populateBuilder( Context context, DlgState state,
|
abstract void populateBuilder( Context context, DlgState state,
|
||||||
AlertDialog.Builder builder,
|
AlertDialog.Builder builder );
|
||||||
NotAgainView naView );
|
|
||||||
|
|
||||||
Dialog create( AlertDialog.Builder builder ) { return builder.create(); }
|
Dialog create( AlertDialog.Builder builder ) { return builder.create(); }
|
||||||
|
|
||||||
|
protected NotAgainView addNAView( DlgState state, AlertDialog.Builder builder )
|
||||||
|
{
|
||||||
|
Context context = getActivity();
|
||||||
|
NotAgainView naView =
|
||||||
|
((NotAgainView)LocUtils.inflate( context, R.layout.not_again_view ))
|
||||||
|
.setMessage( state.m_msg )
|
||||||
|
.setShowNACheckbox( 0 != state.m_prefsNAKey );
|
||||||
|
|
||||||
|
builder.setView( naView );
|
||||||
|
|
||||||
|
return naView;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final Dialog onCreateDialog( Bundle sis )
|
public final Dialog onCreateDialog( Bundle sis )
|
||||||
{
|
{
|
||||||
Context context = getActivity();
|
Context context = getActivity();
|
||||||
DlgState state = getState( sis );
|
DlgState state = getState( sis );
|
||||||
|
|
||||||
NotAgainView naView =
|
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( context );
|
||||||
((NotAgainView)LocUtils.inflate( context, R.layout.not_again_view ))
|
|
||||||
.setMessage( state.m_msg )
|
|
||||||
.setShowNACheckbox( 0 != state.m_prefsNAKey );
|
|
||||||
|
|
||||||
AlertDialog.Builder builder = LocUtils.makeAlertBuilder( context )
|
populateBuilder( context, state, builder );
|
||||||
.setView( naView )
|
|
||||||
;
|
|
||||||
|
|
||||||
populateBuilder( context, state, builder, naView );
|
|
||||||
|
|
||||||
return create( builder );
|
return create( builder );
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,7 @@ public class EnableSMSAlert extends DlgDelegateAlert {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populateBuilder( Context context, final DlgState state,
|
public void populateBuilder( Context context, final DlgState state,
|
||||||
AlertDialog.Builder builder,
|
AlertDialog.Builder builder )
|
||||||
NotAgainView naView )
|
|
||||||
{
|
{
|
||||||
View layout = LocUtils.inflate( context, R.layout.confirm_sms );
|
View layout = LocUtils.inflate( context, R.layout.confirm_sms );
|
||||||
mSpinner = (Spinner)layout.findViewById( R.id.confirm_sms_reasons );
|
mSpinner = (Spinner)layout.findViewById( R.id.confirm_sms_reasons );
|
||||||
|
|
|
@ -35,7 +35,6 @@ import java.util.List;
|
||||||
import org.eehouse.android.xw4.DBUtils.SentInvitesInfo;
|
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.Perms23.Perm;
|
import org.eehouse.android.xw4.Perms23.Perm;
|
||||||
|
@ -54,8 +53,7 @@ public class InviteChoicesAlert extends DlgDelegateAlert {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populateBuilder( final Context context, final DlgState state,
|
public void populateBuilder( final Context context, final DlgState state,
|
||||||
AlertDialog.Builder builder,
|
AlertDialog.Builder builder )
|
||||||
NotAgainView naView )
|
|
||||||
{
|
{
|
||||||
final ArrayList<InviteMeans> means =
|
final ArrayList<InviteMeans> means =
|
||||||
new ArrayList<InviteMeans>();
|
new ArrayList<InviteMeans>();
|
||||||
|
|
|
@ -47,9 +47,9 @@ public class NotAgainAlert extends DlgDelegateAlert {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populateBuilder( Context context, DlgState state,
|
public void populateBuilder( Context context, DlgState state,
|
||||||
AlertDialog.Builder builder,
|
AlertDialog.Builder builder )
|
||||||
NotAgainView naView )
|
|
||||||
{
|
{
|
||||||
|
NotAgainView naView = addNAView( state, builder );
|
||||||
builder.setTitle( R.string.newbie_title )
|
builder.setTitle( R.string.newbie_title )
|
||||||
.setPositiveButton( android.R.string.ok,
|
.setPositiveButton( android.R.string.ok,
|
||||||
mkCallbackClickListener( naView ) );
|
mkCallbackClickListener( naView ) );
|
||||||
|
|
|
@ -47,8 +47,7 @@ public class OkOnlyAlert extends DlgDelegateAlert {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void populateBuilder( Context context, DlgState state,
|
public void populateBuilder( Context context, DlgState state,
|
||||||
AlertDialog.Builder builder,
|
AlertDialog.Builder builder )
|
||||||
NotAgainView naView )
|
|
||||||
{
|
{
|
||||||
builder.setTitle( state.m_titleId == 0 ? R.string.info_title : state.m_titleId )
|
builder.setTitle( state.m_titleId == 0 ? R.string.info_title : state.m_titleId )
|
||||||
.setPositiveButton( android.R.string.ok, null )
|
.setPositiveButton( android.R.string.ok, null )
|
||||||
|
|
Loading…
Add table
Reference in a new issue