Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Manash396
Copy link

No description provided.

@clementwzk clementwzk requested a review from Copilot July 18, 2025 12:28
Copy link

@Copilot Copilot AI left a 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)
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
applyVibrationToKey(binding.squareButton)

Copilot uses AI. Check for mistakes.

applyVibrationToKey(binding.exponentButton)
applyVibrationToKey(binding.factorialButton)
applyVibrationToKey(binding.squareButton)
applyVibrationToKey(binding.piButton)
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
applyVibrationToKey(binding.piButton)

Copilot uses AI. Check for mistakes.

applyVibrationToKey(binding.factorialButton)
applyVibrationToKey(binding.squareButton)
applyVibrationToKey(binding.piButton)
applyVibrationToKey(binding.exponentButton)
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
applyVibrationToKey(binding.exponentButton)

Copilot uses AI. Check for mistakes.

applyVibrationToKey(binding.squareButton)
applyVibrationToKey(binding.piButton)
applyVibrationToKey(binding.exponentButton)
applyVibrationToKey(binding.factorialButton)
Copy link
Preview

Copilot AI Jul 18, 2025

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.

Suggested change
applyVibrationToKey(binding.factorialButton)

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant