AIMP Forum

English pages => Suggestions => Topic started by: sn0 on September 25, 2018, 23:33:17

Title: [Android] Volume Buttons - "Double click switches the track" improvement
Post by: sn0 on September 25, 2018, 23:33:17
Hi there,
the previous/next-switching by doubleclicking on the volume-buttons works good - but is not 100%-perfect yet. I love this feature, because i use headphones that don't have any buttons.

Current behavior of the "Double click switches the track" function:
OnKeyDown (1st click): The volume rises/lowers.
OnKeyDown (2nd click): The volume rises/lowers again, then the volume goes back to previous value. Then the track switches.

The problems here:
- It's not possible to rise or lower the volume quickly anymore by clicking the volume buttons quickly multiple times. (Like clicking 3-times Vol+ for 30% more volume).
- You hear the two unwanted volume changes clearly on headphones (This is not a problem if you're listening via speakers).

My suggestion:
Use "OnKeyUp" for volume changes and "onKeyLongPress" for track-switching. You then should be able to prevent the execution of the onKeyUp-event (raise/lower volume) if the longKeyPress-function fires first.

It may conflict with the default longPress behaviors (super fast volume up/down), but it think overriding this is not a problem for users that use this track-switching function.


I'm not an high-skilled developer, but i think it might work and i'm excited for you answer :-)
Thanks.
Title: Re: [Android] Volume Buttons - "Double click switches the track" improvement
Post by: Artem on September 26, 2018, 22:10:32
Events like a onKeyUp / onKeyLongPress are not called when player runs in background.
Title: Re: [Android] Volume Buttons - "Double click switches the track" improvement
Post by: sn0 on September 26, 2018, 22:41:22
oh, i knew i did miss something (didn't know that).  :-[ Thanks for explaining. Seems that we have to stick with the current solution.

I always wondered why such few audioplayer-apps have a function like this. I've had an Sony Xperia a few years ago where the pre-installed Sony Music App had this Volume-Button-control-feature. Now i know that this is maybe the reason why it is like vendor-exclusive. Thanks Artem.
Title: Re: [Android] Volume Buttons - "Double click switches the track" improvement
Post by: Artem on September 27, 2018, 09:07:42
oh, i knew i did miss something (didn't know that).  :-[ Thanks for explaining. Seems that we have to stick with the current solution.

I always wondered why such few audioplayer-apps have a function like this. I've had an Sony Xperia a few years ago where the pre-installed Sony Music App had this Volume-Button-control-feature. Now i know that this is maybe the reason why it is like vendor-exclusive. Thanks Artem.

Yes, you are absolutely right.
Title: Re: [Android] Volume Buttons - "Double click switches the track" improvement
Post by: kakamal on January 08, 2020, 07:45:34
Nice features sadly the function doesn't work on my Android Head Unit. The NEXT & BACK button on my steering wheel only works for stock music & radio but not for downloaded apps. My volume button is functioning though but double tap for skipping track does not work.