[android-developers] Re: using long touch to set a seekbar

2010-10-13 Thread bagelboy
@Kumar,

I implemented that and it works like a charm, thanks for the
suggestion!
-BB

On Oct 12, 5:23 pm, Kumar Bibek coomar@gmail.com wrote:
 ACTION_CANCEL might help you to exit your custom event.



 On Tue, Oct 12, 2010 at 9:51 PM, bagelboy greg.do...@gmail.com wrote:
  OK, I solved this myself by attaching an onTouchListener to each
  button and listening for ACTION_DOWN and ACTION_UP events. the only
  problem is that if a user moves their finger off the button while
  holding it the ACTION_UP event is lost. This doesn't seem to be a
  major problem as all they have to do is tap the button again to stop,
  but if it gives any trouble I'll simply have to add a generic
  ACTION_UP listener.

  Hope this is useful to someone,
  -BB

  On Oct 12, 11:25 am, bagelboy greg.do...@gmail.com wrote:
   I have an app that uses seekbars with buttons on either side for fine
   adjustments. Right now I use simple onclick events for the buttons,
   every click changes the seekbar 1 unit.

   What I would like to do is use a long press to quickly scroll, so if a
   user holds down a button for say 800 millis it will start adding ten
   units per second.

   What I'm thinking my approach should be is to use onKeyDown and
   onKeyUp events, but is there a better way? OnLongClickListener won't
   work as far as I can tell because it doesn't detect key-up.

   Is my approach correct?

   Thanks!
   -BB

  --
  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+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: using long touch to set a seekbar

2010-10-12 Thread bagelboy
Actually, upon further review I think I misunderstood key events, I
don't think that approach is right at all.

It looks like I will need to use touch events.

On Oct 12, 11:25 am, bagelboy greg.do...@gmail.com wrote:
 I have an app that uses seekbars with buttons on either side for fine
 adjustments. Right now I use simple onclick events for the buttons,
 every click changes the seekbar 1 unit.

 What I would like to do is use a long press to quickly scroll, so if a
 user holds down a button for say 800 millis it will start adding ten
 units per second.

 What I'm thinking my approach should be is to use onKeyDown and
 onKeyUp events, but is there a better way? OnLongClickListener won't
 work as far as I can tell because it doesn't detect key-up.

 Is my approach correct?

 Thanks!
 -BB

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: using long touch to set a seekbar

2010-10-12 Thread Kumar Bibek
ACTION_CANCEL might help you to exit your custom event.

On Tue, Oct 12, 2010 at 9:51 PM, bagelboy greg.do...@gmail.com wrote:

 OK, I solved this myself by attaching an onTouchListener to each
 button and listening for ACTION_DOWN and ACTION_UP events. the only
 problem is that if a user moves their finger off the button while
 holding it the ACTION_UP event is lost. This doesn't seem to be a
 major problem as all they have to do is tap the button again to stop,
 but if it gives any trouble I'll simply have to add a generic
 ACTION_UP listener.

 Hope this is useful to someone,
 -BB

 On Oct 12, 11:25 am, bagelboy greg.do...@gmail.com wrote:
  I have an app that uses seekbars with buttons on either side for fine
  adjustments. Right now I use simple onclick events for the buttons,
  every click changes the seekbar 1 unit.
 
  What I would like to do is use a long press to quickly scroll, so if a
  user holds down a button for say 800 millis it will start adding ten
  units per second.
 
  What I'm thinking my approach should be is to use onKeyDown and
  onKeyUp events, but is there a better way? OnLongClickListener won't
  work as far as I can tell because it doesn't detect key-up.
 
  Is my approach correct?
 
  Thanks!
  -BB

 --
 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+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: using long touch to set a seekbar

2010-10-12 Thread bagelboy
@Kumar, many thanks for that useful suggestion, I'll have a look.
-BB

On Oct 12, 5:23 pm, Kumar Bibek coomar@gmail.com wrote:
 ACTION_CANCEL might help you to exit your custom event.



 On Tue, Oct 12, 2010 at 9:51 PM, bagelboy greg.do...@gmail.com wrote:
  OK, I solved this myself by attaching an onTouchListener to each
  button and listening for ACTION_DOWN and ACTION_UP events. the only
  problem is that if a user moves their finger off the button while
  holding it the ACTION_UP event is lost. This doesn't seem to be a
  major problem as all they have to do is tap the button again to stop,
  but if it gives any trouble I'll simply have to add a generic
  ACTION_UP listener.

  Hope this is useful to someone,
  -BB

  On Oct 12, 11:25 am, bagelboy greg.do...@gmail.com wrote:
   I have an app that uses seekbars with buttons on either side for fine
   adjustments. Right now I use simple onclick events for the buttons,
   every click changes the seekbar 1 unit.

   What I would like to do is use a long press to quickly scroll, so if a
   user holds down a button for say 800 millis it will start adding ten
   units per second.

   What I'm thinking my approach should be is to use onKeyDown and
   onKeyUp events, but is there a better way? OnLongClickListener won't
   work as far as I can tell because it doesn't detect key-up.

   Is my approach correct?

   Thanks!
   -BB

  --
  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+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en