Hi all,
I'm working with the Gallery (which is terrific btw), and I have a
simple question. Right now, in order to scroll left and right in the
gallery via the keypad, I have to move my cursor down to the gallery
before I do anything.
I want to make it so that regardless where the cursor is, pressing
DPAD_LEFT or DPAD_RIGHT will scroll the gallery left and right. I've
been able to do this through overriding onKeyDown(), but that takes
away the default scrolling animation. How do I do this and keep the
scrolling animation in?
Thanks,
James
case KeyEvent.KEYCODE_DPAD_LEFT:
int position;
if ((position =
f_gallery.getSelectedItemPosition())>0);
{
f_gallery.setSelection(position-1);
f_gallery.invalidate();
}
return true;
case KeyEvent.KEYCODE_DPAD_RIGHT:
if ((position =
f_gallery.getSelectedItemPosition())<(f_gallery.getCount()-1));
{
f_gallery.setSelection(position
+1);
f_gallery.invalidate();
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---