I don't see anything in Preference that would do this out-of-the-box.

However, you could receive key events in your PreferenceActivity subclass and dispatch it to the current (that would need to be defined, too) preference.

Another way that comes to mind is using a dialog preference with a slider, instead of a slider directly in the preference list... which has the advantage of already having the concept of currently affected value. You'd then receive key events in the dialog (sub)class.

( Regarding the device - are there still cars that can use those DIN-sized radios? I thought this was a thing of the past, apparently not? )

-- Kostya

29.10.2011 17:15, lbendlin пишет:
A number of my custom preferences are of the'"Seekbar" variety. They can be adjusted nicely on a touch screen device. However, our app is no also being used on the Parrot Asteroid which doesn't even have proper left/right keys (the scroll wheel emulated up/down). I can map the media keys prev/next to left/right, so there is a hardware workaround. I just don't know how to catch these key events for my custom preference (without impacting the up/down paradigm) and convert them into slider changes. I guess worst case I could override the onClick event for the custom preference so that hitting the big button would cycle through a few discrete slider settings.
Is it possible to override onKeyDown for a custom preference?
--
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Kostya Vasilyev

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

Reply via email to