How do you scroll a webView w/ the volume hard keys? ...and can it be done with easing? If so, how? I'm a nooB to Android - Coming over from ActionScript and any help will be greatly appreciated.
my R.id.webPg001 is a WebView id.
This is where I'm at now:
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = event.getAction();
int keyCode = event.getKeyCode();
ScrollView scrollView;
scrollView = (ScrollView) findViewById(R.id.webPg001);
switch (keyCode) {
case KeyEvent.KEYCODE_VOLUME_UP:
if (action == KeyEvent.ACTION_UP) {
scrollView.pageScroll(ScrollView.FOCUS_UP);
scrollView.computeScroll();
}
return true;
case KeyEvent.KEYCODE_VOLUME_DOWN:
if (action == KeyEvent.ACTION_UP) {
scrollView.pageScroll(ScrollView.FOCUS_DOWN);
scrollView.computeScroll();
}
return true;
default:
return super.dispatchKeyEvent(event);
}
}