bajabob / FastPhrase

A voice recording application inspired by emergency crews
0 stars 0 forks source link

Add sound "blips" to button presses #87

Closed bajabob closed 8 years ago

bajabob commented 8 years ago

As a user of the application, I require audio and haptic feedback when a button is pressed in the application.

As a developer of this application, I am to create two helper classes. One called HapticClickHelper and another called AudioClickHelper. These classes shall go in the helper folder and have static methods to initiate a sound blip or haptic vibrate on the device. Static methods are nice because classes do not need instantiated and thus can be called like AudioClickHelper.onClick(...), and so on.

Additionally as a developer, I need to create another helper class called SettingsHelper. This class shall use android's SharedPreferences class to remember whether the user wants Audio clicks or Haptic clicks turned off and off. This class allows you to store booleans to the device to persist from app session to session. In the AboutActivity at the bottom of the screen add a horizontal line with two checkboxes. One for Audio Click Feedback and one for Haptic Click Feedback. Ensure all strings are put in Strings.xml. These settings should be on by default.

Combined, the AboutActivity shall control whether these actions occur. Then in the application, wherever a click occurs, you shall be able to call a helper, SettingsHelper.onClick(...) that sends an onClick to both HapticClickHelper and AudioClickHelper depending on if the user has these settings turned on. Add this single helper function in all click events in the application.