Add support for Bell messages#349
Conversation
|
Thanks @EtienneMiret .
Yeah, makes sense. I didn't know about Only feedback I have is regarding the setting. Do we really need to make the tone configurable? I thought a simple ON/OFF Switch with a default bell sound would suffice. |
| override fun onAttach(context: Context) { | ||
| super.onAttach(context) | ||
| val prefs = AppPreferences(context) | ||
| listener = OnSharedPreferenceChangeListener { _, key -> | ||
| if (key == "bell") { | ||
| prefs.ui.bell?.let { Tones.notify(it) } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
You could simplify this by using setOnPreferenceChangeListener() inside onCreate(). You wouldn't have to fiddle with OnSharedPreferenceChangeListener at all.
c761f53 to
22ee21f
Compare
I thought it was nice to let user choose, but if you feel it overloads the settings UI, I just pushed a new version with a simpler on/off switch.
Indeed. I did so because I wanted a |
|
Hi @EtienneMiret , an update regarding this: I have been using it for approximately a month now. More often than not, multiple bell messages are triggered quickly on server (e.g. when holding down Backspace key to erase a command in terminal). And sometimes the bell message generated during UI navigation feels a bit unexpected. In both of these cases, I found the loudness of the tone to be quite irritating/jarring. So I am reducing the tone volume for bell messages. |
Closes #347.
A new setting allow users to choose a specific tone to play on Bell messages. The new tone is also played when the user changes the selected tone.
As explained in the setting help message, the volume of the played tone is set from the system volume for notifications.
I used ToneGenerator instead of playSoundEffect() because the latter is intended for feedbacks on user gestures, which doesn't seem the case here.