-
-
Notifications
You must be signed in to change notification settings - Fork 149
Improved vibration feedback on both ACTION_DOWN and ACTION_UP #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves vibration feedback for calculator buttons by implementing custom touch listeners that trigger vibration on ACTION_DOWN events instead of relying on default haptic feedback. This provides more immediate tactile response when users touch calculator buttons.
- Added custom touch listeners to all calculator buttons for improved vibration feedback timing
- Implemented helper functions to apply vibration consistently across all button types
- Added MotionEvent import to support touch event handling
Comments suppressed due to low confidence (2)
app/src/main/java/com/darkempire78/opencalculator/activities/MainActivity.kt:118
- The function name 'setOnBottontouchlistener' should follow camelCase convention and be more descriptive. Consider renaming to 'setupButtonTouchListeners'.
setOnBottontouchlistener()
app/src/main/java/com/darkempire78/opencalculator/activities/MainActivity.kt:328
- The function name 'setOnBottontouchlistener' should follow camelCase convention and be more descriptive. Consider renaming to 'setupButtonTouchListeners'.
private fun setOnBottontouchlistener() {
applyVibrationToKey(binding.piButton) | ||
applyVibrationToKey(binding.exponentButton) | ||
applyVibrationToKey(binding.factorialButton) | ||
applyVibrationToKey(binding.squareButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate call to applyVibrationToKey(binding.squareButton). This button is configured twice on lines 329 and 333.
applyVibrationToKey(binding.squareButton) |
Copilot uses AI. Check for mistakes.
applyVibrationToKey(binding.exponentButton) | ||
applyVibrationToKey(binding.factorialButton) | ||
applyVibrationToKey(binding.squareButton) | ||
applyVibrationToKey(binding.piButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate call to applyVibrationToKey(binding.piButton). This button is configured twice on lines 330 and 334.
applyVibrationToKey(binding.piButton) |
Copilot uses AI. Check for mistakes.
applyVibrationToKey(binding.factorialButton) | ||
applyVibrationToKey(binding.squareButton) | ||
applyVibrationToKey(binding.piButton) | ||
applyVibrationToKey(binding.exponentButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate call to applyVibrationToKey(binding.exponentButton). This button is configured twice on lines 331 and 335.
applyVibrationToKey(binding.exponentButton) |
Copilot uses AI. Check for mistakes.
applyVibrationToKey(binding.squareButton) | ||
applyVibrationToKey(binding.piButton) | ||
applyVibrationToKey(binding.exponentButton) | ||
applyVibrationToKey(binding.factorialButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate call to applyVibrationToKey(binding.factorialButton). This button is configured twice on lines 332 and 336.
applyVibrationToKey(binding.factorialButton) |
Copilot uses AI. Check for mistakes.
No description provided.