mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
restore some default after download cancelled
Don't leave the text "download more" as the spinner's value when onActivityResult() is called with a cancel.
This commit is contained in:
parent
99d47fd067
commit
7cb2560b2d
1 changed files with 21 additions and 18 deletions
|
@ -377,7 +377,8 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
} else {
|
} else {
|
||||||
dictLabel.setVisibility( View.GONE );
|
dictLabel.setVisibility( View.GONE );
|
||||||
}
|
}
|
||||||
m_playerDictSpinner = ((LabeledSpinner)playerView.findViewById( R.id.player_dict_spinner ))
|
m_playerDictSpinner = ((LabeledSpinner)playerView
|
||||||
|
.findViewById( R.id.player_dict_spinner ))
|
||||||
.getSpinner();
|
.getSpinner();
|
||||||
if ( localOnlyGame() ) {
|
if ( localOnlyGame() ) {
|
||||||
configDictSpinner( m_playerDictSpinner, m_gi.dictLang, m_gi.dictName(lp) );
|
configDictSpinner( m_playerDictSpinner, m_gi.dictLang, m_gi.dictName(lp) );
|
||||||
|
@ -553,22 +554,25 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult( RequestCode requestCode, int resultCode, Intent data )
|
protected void onActivityResult( RequestCode requestCode, int resultCode, Intent data )
|
||||||
{
|
{
|
||||||
if ( Activity.RESULT_CANCELED != resultCode ) {
|
boolean cancelled = Activity.RESULT_CANCELED == resultCode;
|
||||||
loadGame();
|
|
||||||
switch( requestCode ) {
|
loadGame();
|
||||||
case REQUEST_DICT:
|
switch( requestCode ) {
|
||||||
String dictName = data.getStringExtra( DictsDelegate.RESULT_LAST_DICT );
|
case REQUEST_DICT:
|
||||||
configDictSpinner( m_dictSpinner, m_gi.dictLang, dictName );
|
String dictName = cancelled ? m_gi.dictName
|
||||||
configDictSpinner( m_playerDictSpinner, m_gi.dictLang, dictName );
|
: data.getStringExtra( DictsDelegate.RESULT_LAST_DICT );
|
||||||
break;
|
configDictSpinner( m_dictSpinner, m_gi.dictLang, dictName );
|
||||||
case REQUEST_LANG_GC:
|
configDictSpinner( m_playerDictSpinner, m_gi.dictLang, dictName );
|
||||||
String langName = data.getStringExtra( DictsDelegate.RESULT_LAST_LANG );
|
break;
|
||||||
selLangChanged( langName );
|
case REQUEST_LANG_GC:
|
||||||
setLangSpinnerSelection( langName );
|
String langName = cancelled
|
||||||
break;
|
? DictLangCache.getLangName( m_activity, m_gi.dictLang )
|
||||||
default:
|
: data.getStringExtra( DictsDelegate.RESULT_LAST_LANG );
|
||||||
Assert.failDbg();
|
selLangChanged( langName );
|
||||||
}
|
setLangSpinnerSelection( langName );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Assert.failDbg();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1206,7 +1210,6 @@ public class GameConfigDelegate extends DelegateBase
|
||||||
|
|
||||||
private void adjustPlayersLabel()
|
private void adjustPlayersLabel()
|
||||||
{
|
{
|
||||||
Log.i( TAG, "adjustPlayersLabel()" );
|
|
||||||
String label;
|
String label;
|
||||||
if ( localOnlyGame() ) {
|
if ( localOnlyGame() ) {
|
||||||
label = getString( R.string.players_label_standalone );
|
label = getString( R.string.players_label_standalone );
|
||||||
|
|
Loading…
Reference in a new issue