mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
prevent lookup dialogs from coming up before button pressed by not
assigning m_words too early.
This commit is contained in:
parent
9152609bdd
commit
5773466fb6
1 changed files with 5 additions and 4 deletions
|
@ -256,19 +256,19 @@ public class BoardActivity extends XWActivity
|
||||||
};
|
};
|
||||||
ab.setNegativeButton( R.string.button_no, lstnr );
|
ab.setNegativeButton( R.string.button_no, lstnr );
|
||||||
} else if ( DLG_SCORES_BLK == id ) {
|
} else if ( DLG_SCORES_BLK == id ) {
|
||||||
m_words = m_wordsWaiting;
|
if ( null != m_wordsWaiting && m_wordsWaiting.length > 0 ) {
|
||||||
if ( null != m_words && m_words.length > 0 ) {
|
|
||||||
String buttonTxt;
|
String buttonTxt;
|
||||||
if ( m_words.length == 1 ) {
|
if ( m_wordsWaiting.length == 1 ) {
|
||||||
buttonTxt = Utils.format( this,
|
buttonTxt = Utils.format( this,
|
||||||
R.string.button_lookupf,
|
R.string.button_lookupf,
|
||||||
m_words[0] );
|
m_wordsWaiting[0] );
|
||||||
} else {
|
} else {
|
||||||
buttonTxt = getString( R.string.button_lookup );
|
buttonTxt = getString( R.string.button_lookup );
|
||||||
}
|
}
|
||||||
lstnr = new DialogInterface.OnClickListener() {
|
lstnr = new DialogInterface.OnClickListener() {
|
||||||
public void onClick( DialogInterface dialog,
|
public void onClick( DialogInterface dialog,
|
||||||
int whichButton ) {
|
int whichButton ) {
|
||||||
|
m_words = m_wordsWaiting;
|
||||||
lookupWord();
|
lookupWord();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1228,6 +1228,7 @@ public class BoardActivity extends XWActivity
|
||||||
m_dlgBytes = expl;
|
m_dlgBytes = expl;
|
||||||
m_dlgTitle = R.string.info_title;
|
m_dlgTitle = R.string.info_title;
|
||||||
m_wordsWaiting = wordsToMWords( words );
|
m_wordsWaiting = wordsToMWords( words );
|
||||||
|
Assert.assertNull( m_words );
|
||||||
Assert.assertTrue( wordCount == m_wordsWaiting.length );
|
Assert.assertTrue( wordCount == m_wordsWaiting.length );
|
||||||
waitBlockingDialog( DLG_SCORES_BLK, 0 );
|
waitBlockingDialog( DLG_SCORES_BLK, 0 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue