mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
put some of DlgDelegate's methods into an interface that can be passed around to be called by non-activities.
This commit is contained in:
parent
647282968a
commit
9dc94c97b2
3 changed files with 12 additions and 6 deletions
|
@ -59,6 +59,10 @@ public class DlgDelegate {
|
|||
public interface DlgClickNotify {
|
||||
void dlgButtonClicked( int id, int button, Object[] params );
|
||||
}
|
||||
public interface HasDlgDelegate {
|
||||
void showOKOnlyDialog( int msgID );
|
||||
void showOKOnlyDialog( String msg );
|
||||
}
|
||||
|
||||
private Activity m_activity;
|
||||
private DlgClickNotify m_clickCallback;
|
||||
|
|
|
@ -31,7 +31,8 @@ import android.widget.TextView;
|
|||
import junit.framework.Assert;
|
||||
|
||||
public class XWActivity extends Activity
|
||||
implements DlgDelegate.DlgClickNotify, MultiService.MultiEventListener {
|
||||
implements DlgDelegate.DlgClickNotify, DlgDelegate.HasDlgDelegate,
|
||||
MultiService.MultiEventListener {
|
||||
|
||||
private DlgDelegate m_delegate;
|
||||
|
||||
|
@ -123,12 +124,12 @@ public class XWActivity extends Activity
|
|||
m_delegate.showNotAgainDlgThen( msgID, prefsKey );
|
||||
}
|
||||
|
||||
protected void showOKOnlyDialog( int msgID )
|
||||
public void showOKOnlyDialog( int msgID )
|
||||
{
|
||||
m_delegate.showOKOnlyDialog( msgID );
|
||||
}
|
||||
|
||||
protected void showOKOnlyDialog( String msg )
|
||||
public void showOKOnlyDialog( String msg )
|
||||
{
|
||||
m_delegate.showOKOnlyDialog( msg );
|
||||
}
|
||||
|
|
|
@ -29,7 +29,8 @@ import junit.framework.Assert;
|
|||
|
||||
|
||||
public class XWExpandableListActivity extends ExpandableListActivity
|
||||
implements DlgDelegate.DlgClickNotify, MultiService.MultiEventListener {
|
||||
implements DlgDelegate.DlgClickNotify, DlgDelegate.HasDlgDelegate,
|
||||
MultiService.MultiEventListener {
|
||||
|
||||
private DlgDelegate m_delegate;
|
||||
|
||||
|
@ -107,12 +108,12 @@ public class XWExpandableListActivity extends ExpandableListActivity
|
|||
m_delegate.showAboutDialog();
|
||||
}
|
||||
|
||||
protected void showOKOnlyDialog( int msgID )
|
||||
public void showOKOnlyDialog( int msgID )
|
||||
{
|
||||
m_delegate.showOKOnlyDialog( msgID );
|
||||
}
|
||||
|
||||
protected void showOKOnlyDialog( String msg )
|
||||
public void showOKOnlyDialog( String msg )
|
||||
{
|
||||
m_delegate.showOKOnlyDialog( msg );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue