move show(DialogFragment) to XWActivity

First of probably many bugs running new alert changes in
non-dualpane-mode: Activities get to show dialogs too!
This commit is contained in:
Eric House 2017-02-15 06:44:01 -08:00
parent 8e874fa45c
commit f5c022bb72
3 changed files with 9 additions and 8 deletions

View file

@ -437,8 +437,8 @@ public class DelegateBase implements DlgClickNotify,
protected void show( DialogFragment df )
{
if ( m_activity instanceof MainActivity ) {
((MainActivity)m_activity).show( df );
if ( m_activity instanceof XWActivity ) {
((XWActivity)m_activity).show( df );
} else if ( m_activity instanceof PrefsActivity ) {
((PrefsActivity)m_activity).show( df );
} else {

View file

@ -112,11 +112,6 @@ public class MainActivity extends XWActivity
m_dlgt.handleNewIntent( intent );
}
protected void show( DialogFragment df )
{
df.show( getSupportFragmentManager(), "dialog" );
}
/* Sometimes I'm getting crashes because views don't have fragments
* associated yet. I suspect that's because adding them's been postponed
* via the m_runWhenSafe mechanism. So: postpone handling intents too.

View file

@ -25,9 +25,10 @@ import android.app.Dialog;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@ -274,6 +275,11 @@ public class XWActivity extends FragmentActivity
Assert.fail();
}
protected void show( DialogFragment df )
{
df.show( getSupportFragmentManager(), "dialog" );
}
protected Dialog makeDialog( DlgID dlgID, Object[] params )
{
return m_dlgt.makeDialog( dlgID, params );