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

Show "Hold to enqueue" tip in local playlists #9196

Merged

Conversation

Jfax510
Copy link
Contributor

@Jfax510 Jfax510 commented Oct 25, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

  • Display a Toast with the text "Hold to enqueue" when either one of the headers(background, play all, popup) in a playlist is clicked

Before/After Screenshots/Screen Record

  • Before:
BeforeTest.mov
  • After:
AfterTest.mov

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@opusforlife2
Copy link
Collaborator

Does this respect the "show tip" toggle in Appearance settings?

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

The toast should only be shown if the user did not disable enqueue tips, as opusforlife2 pointed out. Refer to the show_hold_to_append_key shared preferences key.

@Jfax510
Copy link
Contributor Author

Jfax510 commented Oct 26, 2022

The toast should only be shown if the user did not disable enqueue tips, as opusforlife2 pointed out. Refer to the show_hold_to_append_key shared preferences key.

I've now made the toasts only appear when enqueue tips are enabled

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Thanks, almost good

Comment on lines 516 to 519
if (PreferenceManager.getDefaultSharedPreferences(activity)
.getBoolean(getString(R.string.show_hold_to_append_key), true)) {
Toast.makeText(activity, R.string.hold_to_append, Toast.LENGTH_SHORT).show();
}
Copy link
Member

Choose a reason for hiding this comment

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

Instead of duplicating these four lines of code three times, it's better if you create a function (e.g. right after the handleResult) named showHoldToAppendTipIfNeeded containing these four lines, and then you can just call it in the three places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, I've put those four lines of code in a function

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Thanks, looks good to me ;-)
I tested myself since the CI is not working.
Note that this change only applies to the local playlist fragment, while it should apply to other list fragments, too (e.g. history, remote playlist, channel, ...). If you want to fix those fragment, too, go ahead.

@Stypox Stypox merged commit 0d73d19 into TeamNewPipe:dev Oct 26, 2022
@Stypox Stypox changed the title Added Toast Notification "Hold to enqueue" Show "Hold to enqueue" tip in local playlists Oct 26, 2022
@Jfax510 Jfax510 deleted the Add_Toast_Notification_To_Enqueue_Playlist branch October 26, 2022 10:54
@Jfax510 Jfax510 restored the Add_Toast_Notification_To_Enqueue_Playlist branch October 26, 2022 10:54
@opusforlife2
Copy link
Collaborator

@Jfax510 ANU student?

@Jfax510
Copy link
Contributor Author

Jfax510 commented Oct 29, 2022

@Jfax510 ANU student?

Yes, I did this issue as part of a group assignment

This was referenced Nov 4, 2022
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.

Toast notification to enqueue a playlist
3 participants