Skip to content
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

chore(android): refactor audio focus #4176

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

freeboub
Copy link
Collaborator

Summary

WIP
refactor audio focus listener to kotlin

Motivation

Changes

Move audio focus management in a dedicated kotlin file
create RNVPlayerInterface to be able to handle generic code
Add lazy init of audioFocusDelegate (will not be instanciated if not necessary)

Test plan

Move audio focus management in a dedicated kotlin file
create RNVPlayerInterface to be able to handle generic code
Add lazy init of audioFocusDelegate (will not be instanciated if not necessary)
* Delegate audio management to this class
* This is an helper to group all generic android code which do not depend on player implementation
*/
class AudioManagerDelegate(player: RNVPlayerInterface, themedReactContext: ThemedReactContext) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add private val because they are not expected to change after initialization.

Suggested change
class AudioManagerDelegate(player: RNVPlayerInterface, themedReactContext: ThemedReactContext) {
class AudioManagerDelegate(private val player: RNVPlayerInterface, private val themedReactContext: ThemedReactContext
)```

@freeboub freeboub marked this pull request as draft September 18, 2024 09:59
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