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

Fix #476: Resume tracking btn change the state to stopped #477

Conversation

miltonials
Copy link

The “Resume tracking” btn should execute the setActiveTrack function only when the app has no active tracking.

@miltonials miltonials marked this pull request as ready for review December 4, 2024 23:34
@Binnette Binnette self-requested a review December 5, 2024 13:11
@Binnette
Copy link
Collaborator

Binnette commented Dec 5, 2024

Hi @miltonials, may be you can improve your check. Since we are in case R.id.trackmgr_contextmenu_resume we know that the user clicked on resume item on the context menu. Also TRACK_ID_NO_TRACK is final so its value is always -1.

Consider a condition like: "if current recording track is different from the one clicked in contextMenu", then close the current one and resume the contextMenu one.

So maybe something like :

case R.id.trackmgr_contextmenu_resume:
    // let's activate the track and start the TrackLogger activity
    if (currentTrackId != contextMenuSelectedTrackid) {
        // Resume a track that is not currently recording. Stop all recording and resume track choose by user
        setActiveTrack(contextMenuSelectedTrackid);
    }
    // ...

Can you please try/debug this, to see if it make "more sens". Also feel free to add more comments in code 👍
TY for your PR

Copy link
Collaborator

@Binnette Binnette left a comment

Choose a reason for hiding this comment

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

See previous comment

@miltonials
Copy link
Author

Hi @Binnette! Thank you for your suggestions. I’ve reviewed and implemented them, and the logic works smoothly

@miltonials miltonials requested a review from Binnette December 7, 2024 07:30
Copy link
Collaborator

@Binnette Binnette left a comment

Choose a reason for hiding this comment

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

@Binnette Binnette merged commit 140538a into labexp:develop Dec 7, 2024
2 checks passed
@miltonials miltonials deleted the fix-476-resume-tracking-btn-changes-tracking-status branch December 11, 2024 05:50
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