summaryrefslogtreecommitdiffstats
path: root/samples/BrowserPlugin
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2009-07-08 11:11:33 -0400
committerDerek Sollenberger <djsollen@google.com>2009-07-08 11:11:33 -0400
commit0e827219dd85b70d57d5aabb4bd158b598cb9282 (patch)
treebaa6cdbc8a146dc933bc0b7a265af48f03dec7f3 /samples/BrowserPlugin
parentea82c57a49300d6324b4cdd0576228d2a5065686 (diff)
downloadandroid_development-0e827219dd85b70d57d5aabb4bd158b598cb9282.tar.gz
android_development-0e827219dd85b70d57d5aabb4bd158b598cb9282.tar.bz2
android_development-0e827219dd85b70d57d5aabb4bd158b598cb9282.zip
Adding navigation support to the sample form plugin.
Diffstat (limited to 'samples/BrowserPlugin')
-rw-r--r--samples/BrowserPlugin/jni/form/FormPlugin.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/samples/BrowserPlugin/jni/form/FormPlugin.cpp b/samples/BrowserPlugin/jni/form/FormPlugin.cpp
index 29c70c792..f6f344c3b 100644
--- a/samples/BrowserPlugin/jni/form/FormPlugin.cpp
+++ b/samples/BrowserPlugin/jni/form/FormPlugin.cpp
@@ -268,9 +268,8 @@ int16 FormPlugin::handleEvent(const ANPEvent* evt) {
evt->data.key.unichar);
inval(instance, m_activeInput->rect, true);
}
- return 1;
}
- break;
+ return 1;
case kVisibleRect_ANPEventType: {
@@ -314,24 +313,29 @@ bool FormPlugin::handleNavigation(ANPKeyCode keyCode) {
if (!m_activeInput) {
switchActiveInput(&m_usernameInput);
scrollIntoView(m_activeInput);
- return true;
}
else if (m_activeInput == &m_usernameInput) {
if (keyCode == kDpadDown_ANPKeyCode) {
switchActiveInput(&m_passwordInput);
scrollIntoView(m_activeInput);
- return true;
}
+ else if (keyCode == kDpadCenter_ANPKeyCode)
+ gWindowI.showKeyboard(instance, false);
+ else if (keyCode == kDpadUp_ANPKeyCode)
+ return false;
}
else if (m_activeInput == &m_passwordInput) {
if (keyCode == kDpadUp_ANPKeyCode) {
switchActiveInput(&m_usernameInput);
scrollIntoView(m_activeInput);
- return true;
}
+ else if (keyCode == kDpadCenter_ANPKeyCode)
+ gWindowI.showKeyboard(instance, false);
+ else if (keyCode == kDpadDown_ANPKeyCode)
+ return false;
}
- return false;
+ return true;
}
void FormPlugin::handleTextInput(TextInput* input, ANPKeyCode keyCode, int32_t unichar) {