for game config replace onKeyDown() with onBackPressed() since only

one key was handled.
This commit is contained in:
Eric House 2015-02-03 21:49:33 -08:00
parent 5e6bb507b7
commit c55bba5aab
3 changed files with 5 additions and 14 deletions

View file

@ -20,9 +20,7 @@
package org.eehouse.android.xw4; package org.eehouse.android.xw4;
import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.KeyEvent;
public class GameConfigActivity extends XWActivity { public class GameConfigActivity extends XWActivity {
@ -34,11 +32,4 @@ public class GameConfigActivity extends XWActivity {
m_dlgt = new GameConfigDelegate( this, savedInstanceState ); m_dlgt = new GameConfigDelegate( this, savedInstanceState );
super.onCreate( savedInstanceState, m_dlgt ); super.onCreate( savedInstanceState, m_dlgt );
} // onCreate } // onCreate
@Override
public boolean onKeyDown( int keyCode, KeyEvent event )
{
boolean consumed = m_dlgt.onKeyDown( keyCode, event );
return consumed || super.onKeyDown( keyCode, event );
}
} }

View file

@ -725,12 +725,11 @@ public class GameConfigDelegate extends DelegateBase
} }
} // onClick } // onClick
protected boolean onKeyDown( int keyCode, KeyEvent event ) @Override
protected boolean onBackPressed()
{ {
boolean consumed = false; boolean consumed = false;
if ( null == m_gameLock ) { if ( null != m_gameLock ) {
// Do nothing; we're on our way out
} else if ( keyCode == KeyEvent.KEYCODE_BACK ) {
if ( m_forResult ) { if ( m_forResult ) {
deleteGame(); deleteGame();
} else { } else {

View file

@ -1207,7 +1207,8 @@ public class GamesListDelegate extends ListDelegateBase
} }
@Override @Override
protected boolean onBackPressed() { protected boolean onBackPressed()
{
boolean handled = 0 < m_selGames.size() || 0 < m_selGroupIDs.size(); boolean handled = 0 < m_selGames.size() || 0 < m_selGroupIDs.size();
if ( handled ) { if ( handled ) {
showNotAgainDlgThen( R.string.not_again_backclears, showNotAgainDlgThen( R.string.not_again_backclears,