-
-
Notifications
You must be signed in to change notification settings - Fork 153
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.
@Manash396 can you fix the issues please, so i can merge your PR |
yes , of cource
…On Sun, Sep 21, 2025 at 7:18 PM Clément Wawszczyk ***@***.***> wrote:
*clementwzk* left a comment (clementwzk/OpenCalc#577)
<#577 (comment)>
@Manash396 <https://github.com/Manash396> can you fix the issues please,
so i can merge your PR
—
Reply to this email directly, view it on GitHub
<#577 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJEAMQ5C4AJCROYXG4PJPET3T2UDTAVCNFSM6AAAAACBZUIOACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGMJWGAYDOMZVGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
…roved-vibration-feedback # Conflicts: # app/src/main/java/com/darkempire78/opencalculator/activities/MainActivity.kt
I have made those changes you requested
On Mon, Sep 22, 2025 at 7:20 AM Manash Khatowal ***@***.***>
wrote:
… yes , of cource
On Sun, Sep 21, 2025 at 7:18 PM Clément Wawszczyk <
***@***.***> wrote:
> *clementwzk* left a comment (clementwzk/OpenCalc#577)
> <#577 (comment)>
>
> @Manash396 <https://github.com/Manash396> can you fix the issues please,
> so i can merge your PR
>
> —
> Reply to this email directly, view it on GitHub
> <#577 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BJEAMQ5C4AJCROYXG4PJPET3T2UDTAVCNFSM6AAAAACBZUIOACVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGMJWGAYDOMZVGI>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
…roved-vibration-feedback
…sh396/OpenCalc into improved-vibration-feedback
No description provided.