Skip to content

Conversation

@kavishdevar
Copy link
Owner

This pull request refactors the codebase by reorganizing constants, improving modularity, and enhancing the PressAndHoldSettings functionality. The most significant changes include moving constants from utils to a new constants package, adding logic for customizable long-press actions, and cleaning up unused imports and code.

Refactoring and Modularization:

  • Moved constants like AirPodsNotifications, NoiseControlMode, and Battery from utils to a new constants package for better organization (android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt, android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt) [1] [2].
  • Removed unused constants and enums from the Packets file during the refactor to streamline the codebase (android/app/src/main/java/me/kavishdevar/librepods/constants/Packets.kt).

Enhancements to PressAndHoldSettings:

  • Added logic to retrieve and display user-configurable long-press actions for AirPods stems using SharedPreferences. This includes support for actions like "Cycle Noise Control Modes" and "Digital Assistant" (android/app/src/main/java/me/kavishdevar/librepods/composables/PressAndHoldSettings.kt) [1] [2] [3].
  • Introduced a new StemAction enum to define possible long-press actions (android/app/src/main/java/me/kavishdevar/librepods/constants/StemAction.kt).

Import Cleanup:

  • Removed redundant imports and adjusted import paths to reflect the new constants package structure across multiple files (e.g., MainActivity.kt, QuickSettingsDialogActivity.kt, and BatteryView.kt) [1] [2] [3].

Minor Functional Updates:

  • Added a new bleOnlyMode setting in AirPodsSettingsScreen to support BLE-only mode configuration (android/app/src/main/java/me/kavishdevar/librepods/screens/AirPodsSettingsScreen.kt).

These changes improve code maintainability, enhance user customization options, and align with best practices for modularization.

^^ obviously ai :]

@kavishdevar kavishdevar merged commit 24686da into main Jul 13, 2025
5 checks passed
@kavishdevar kavishdevar deleted the dev branch November 16, 2025 20:57
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.

2 participants