mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-26 19:02:17 -05:00
ConversationActivity: Small changes in onKeyDown() (also removed onBackPressed())
This commit is contained in:
parent
8bfe1d1a75
commit
6e2c835869
@ -271,7 +271,9 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
deckAdapter.removeItem(target);
|
||||
|
||||
if (deckAdapter.isSwitched()) {
|
||||
onBackPressed();
|
||||
switcher.showNext();
|
||||
switcher.removeView(deckAdapter.getSwitchedView());
|
||||
deckAdapter.setSwitched(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -310,32 +312,21 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
||||
/**
|
||||
* On key down
|
||||
*
|
||||
* This is glue code to call onBackPressed() which
|
||||
* will be automatically called by later android releases
|
||||
* XXX: As we only track the back key: Android >= 2.0 will call a method called onBackPressed()
|
||||
*/
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event)
|
||||
{
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* On back key pressed
|
||||
*/
|
||||
public void onBackPressed()
|
||||
{
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
|
||||
if (deckAdapter.isSwitched()) {
|
||||
switcher.showNext();
|
||||
switcher.removeView(deckAdapter.getSwitchedView());
|
||||
deckAdapter.setSwitched(null, null);
|
||||
} else {
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.onKeyDown(keyCode, event);
|
||||
}
|
||||
|
||||
/**
|
||||
* On key pressed (input line)
|
||||
|
Loading…
Reference in New Issue
Block a user