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

Recording should pause when back button pressed #1174

Merged
merged 2 commits into from Aug 16, 2019

Conversation

mXaln
Copy link
Contributor

@mXaln mXaln commented Aug 9, 2019

Issue #1173 ;

Also audioPlayer seeks to the beginning when it finished playing

@mXaln mXaln requested a review from jsarabia August 9, 2019 19:23
@mXaln mXaln changed the title Recording pauses when back button pressed Recording should pause when back button pressed Aug 12, 2019
Copy link
Contributor

@jsarabia jsarabia left a comment

Choose a reason for hiding this comment

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

This would work, but is pretty backwards in my opinion.
The RecordingControls fragment doesn't hold the player or anything like that, it just is an interface for the user to input pause/play commands. Now, there's some extra logic and state here because the buttons have to reflect the state of an audio player, as well as maintain a timer, but it's really not a widget that needs or should care about application lifecycle.

The fragment has a public API for pausing (which you call in your onBackPressed method). Since you already have to call a method on the fragment from the activity; why not just call the pause button directly.

@jsarabia jsarabia merged commit baa0bb2 into export-with-user Aug 16, 2019
@jsarabia jsarabia deleted the mm_stop_recording_on_backpress branch August 16, 2019 14:47
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.

None yet

2 participants