[android-developers] Re: Advice on Swipe Direction and Velocity
On Feb 20, 8:28 pm, joshbeck <josh.beck2...@gmail.com> wrote:
> Ok, I've done some reading and I have a working theory:
>
> It's done using something this:
>
> @Override
> public boolean onKeyDown(int keyCode, KeyEvent event) {
> switch (keyCode)
> {
>
> case KeyEvent.KEYCODE_DPAD_DOWN:
> (increment static value X by Y );
> break;
>
> {
>
> This way a faster swipe results in a higher value?
>
> Sound logical or am I off?
>
> Thanks again,
> Josh Beck
>
> On Feb 20, 12:52 pm, joshbeck <josh.beck2...@gmail.com> wrote:
>
>
>
> > Hello all,
>
> > I'm looking for a starting point on this:
>
> > Here's a good example:
> > -When you create a 'ListView', as the user swipes up or down the
> > list scrolls
> > in accordance with how fast the user swiped. Give it a fast swipe, and
> > the list scrolls farther, faster.
>
> > Same thing is true within the web browser.
>
> > Now, I've downloaded the native source code for OS. So, I have that
> > as a resource to
> > poke around and see exactly how this is being accompished natively.
>
> > Question:
>
> > Is swipe direction/velocity documented anywhere. --Example code would
> > be helpful.
>
> > I'd like to start by applying an OnTouchEvent(); to a 2D canvas and
> > simply rotate
> > the canvas based on swipe velocity.
>
> > Any tips are appreciated.
>
> > Thanks,
> > Josh Beck
i haven't seen sources but what you posted is all about key events not
touch events
i think that list view's swipe model is based on gesture detector &
scroller - at least it could be the easiest way to implement it
pskink
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home